Commit a87236a9c62329993463b1a1809cd4ab109ff087

Steffen Jaeckel 2019-10-18T15:04:22

Merge pull request #385 from libtom/fix-msvc-2 Move disabling of warning C4003 from makefile.msvc to tommath_private.h

diff --git a/makefile.msvc b/makefile.msvc
index d282e93..d155bc6 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 /wd4003 /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 /wd4710 /wd4711 /wd4820 /WX $(CFLAGS)
 LTM_LDFLAGS = advapi32.lib
 
 #Libraries to be created (this makefile builds only static libraries)
diff --git a/tommath_private.h b/tommath_private.h
index 7c167a5..1a0096f 100644
--- a/tommath_private.h
+++ b/tommath_private.h
@@ -141,6 +141,10 @@ extern void MP_FREE(void *mem, size_t size);
 #endif
 
 /* feature detection macro */
+#ifdef _MSC_VER
+/* Prevent false positive: not enough arguments for function-like macro invocation */
+#pragma warning(disable: 4003)
+#endif
 #define MP_STRINGIZE(x)  MP__STRINGIZE(x)
 #define MP__STRINGIZE(x) ""#x""
 #define MP_HAS(x)        (sizeof(MP_STRINGIZE(BN_##x##_C)) == 1u)