From: Vitaly Chikunov Date: Sat, 4 Dec 2021 08:09:52 +0000 (+0300) Subject: MSVC: Fix absence of 'setenv' X-Git-Tag: v3.0.1~23 X-Git-Url: http://www.wagner.pp.ru/gitweb/?p=openssl-gost%2Fengine.git;a=commitdiff_plain;h=ae5079bb87b16f6ac437e5dc5409c1f83f551cea MSVC: Fix absence of 'setenv' Error message: test_keyexpimp.c(111,11): warning C4013: 'setenv' undefined; assuming extern returning int Signed-off-by: Vitaly Chikunov --- diff --git a/test_keyexpimp.c b/test_keyexpimp.c index 31a42f7..0fa549b 100644 --- a/test_keyexpimp.c +++ b/test_keyexpimp.c @@ -6,6 +6,7 @@ */ #ifdef _MSC_VER # include +# include #else # include #endif @@ -108,7 +109,11 @@ int main(void) unsigned char tlsseq[8]; unsigned char out[32]; +#ifdef _MSC_VER + _putenv_s("OPENSSL_ENGINES", ENGINE_DIR); +#else setenv("OPENSSL_ENGINES", ENGINE_DIR, 0); +#endif OPENSSL_add_all_algorithms_conf(); ERR_load_crypto_strings(); ENGINE *eng;