]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
MSVC: Fix absence of 'setenv'
authorVitaly Chikunov <vt@altlinux.org>
Sat, 4 Dec 2021 08:09:52 +0000 (11:09 +0300)
committerDmitry Belyavskiy <beldmit@users.noreply.github.com>
Sat, 11 Dec 2021 16:45:14 +0000 (19:45 +0300)
Error message:

  test_keyexpimp.c(111,11): warning C4013: 'setenv' undefined; assuming extern returning int

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
test_keyexpimp.c

index 31a42f7260c041faabe7bee50f7ea6904fc76686..0fa549bf4bbfeddee0e5fda969ea19abbc38feac 100644 (file)
@@ -6,6 +6,7 @@
  */
 #ifdef _MSC_VER
 # include <Winsock2.h>
+# include <stdlib.h>
 #else
 # include <arpa/inet.h>
 #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;