Commit 192fad32e0e915497bfbb54b2ae139da43f2baf1

Steffen Jaeckel 2019-10-18T15:55:54

Merge pull request #386 from libtom/fix-msvc-3 Fix build with latest visual studio (2019)

diff --git a/appveyor.yml b/appveyor.yml
index 7d85d3f..efe4568 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -6,11 +6,13 @@ branches:
   - /^release/
   - /^travis/
 image:
+- Visual Studio 2019
 - Visual Studio 2017
 - Visual Studio 2015
 build_script:
 - cmd: >-
-    if "Visual Studio 2017"=="%APPVEYOR_BUILD_WORKER_IMAGE%" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
+    if "Visual Studio 2019"=="%APPVEYOR_BUILD_WORKER_IMAGE%" call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
+        if "Visual Studio 2017"=="%APPVEYOR_BUILD_WORKER_IMAGE%" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
         if "Visual Studio 2015"=="%APPVEYOR_BUILD_WORKER_IMAGE%" call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
         if "Visual Studio 2015"=="%APPVEYOR_BUILD_WORKER_IMAGE%" call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
         nmake -f makefile.msvc all
diff --git a/bn_s_mp_rand_platform.c b/bn_s_mp_rand_platform.c
index 07555db..27339bf 100644
--- a/bn_s_mp_rand_platform.c
+++ b/bn_s_mp_rand_platform.c
@@ -27,16 +27,9 @@ static mp_err s_read_arc4random(void *p, size_t n)
 #define ARM
 #endif
 
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning (disable : 4668)
-#endif
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <wincrypt.h>
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
 
 static mp_err s_read_wincsp(void *p, size_t n)
 {
diff --git a/makefile.msvc b/makefile.msvc
index d155bc6..aa8d8be 100644
--- a/makefile.msvc
+++ b/makefile.msvc
@@ -14,7 +14,7 @@ PREFIX    = c:\devel
 CFLAGS    = /Ox
 
 #Compilation flags
-LTM_CFLAGS  = /nologo /I./ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /D__STDC_WANT_SECURE_LIB__=1 /D_CRT_HAS_CXX17=0 /Wall /wd4146 /wd4127 /wd4710 /wd4711 /wd4820 /WX $(CFLAGS)
+LTM_CFLAGS  = /nologo /I./ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /D__STDC_WANT_SECURE_LIB__=1 /D_CRT_HAS_CXX17=0 /Wall /wd4146 /wd4127 /wd4668 /wd4710 /wd4711 /wd4820 /wd5045 /WX $(CFLAGS)
 LTM_LDFLAGS = advapi32.lib
 
 #Libraries to be created (this makefile builds only static libraries)