C preprocessor only handles integers for conditional compilation. Build MSC_VER_REQUI...
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 31 Jan 2007 02:23:06 +0000 (02:23 +0000)
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 31 Jan 2007 02:23:06 +0000 (02:23 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@20637 f5534014-38df-0310-8fa8-9805f1628bb7

Makefile.nmake
config.h.win32
config.nmake

index 16a974c69baaac2bad32740d58d2bb9f233b59ca..e31a05a8e95ffdca6fb206bb7af5e834ef95332e 100644 (file)
@@ -17,7 +17,7 @@ CFLAGS=-DHAVE_CONFIG_H $(LOCAL_CFLAGS) $(GLIB_CFLAGS) /I. /Iwiretap \
        $(ZLIB_CFLAGS) /I$(PCAP_DIR)\include \
        $(NET_SNMP_CFLAGS) \
        $(ADNS_CFLAGS) $(PCRE_CFLAGS) $(GNUTLS_CFLAGS) $(LUA_CFLAGS) \
-       -D_U_="" -D_NEED_VAR_IMPORT_
+       -D_U_="" -D_NEED_VAR_IMPORT_ -DMSC_VER_REQUIRED=$(MSC_VER_REQUIRED)
 
 CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
 
index 1bc5ab3e8e3e841002e8e12b82107df8f8c40a9d..4d5d6052621aad284ac0942815afcfc2ed467e51 100644 (file)
 /* We shouldn't need this under Windows but we'll define it anyway. */
 #define HTML_VIEWER "mozilla"
 
-/* check if the MSVC_VARIANT setting in config.nmake and the current MSVC compiler version matches together */
-/* user might forget to set this or the PATH to the C compiler could be wrong */
-#if _MSC_VER == 1400 && (MSVC_VARIANT != MSVC2005EE || MSVC_VARIANT != MSVC2005 || MSVC_VARIANT != DOTNET20 || MSVC_VARIANT != DOTNET30)
-#error Your MSVC_VARIANT setting in config.nmake and the C compiler version 14.00 (V8.0) don't match!
-#elseif _MSC_VER == 1310 && (MSVC_VARIANT != MSVC2003 || MSVC_VARIANT != DOTNET11)
-#error Your MSVC_VARIANT setting in config.nmake and the C compiler version 13.10 (V7.1) don't match!
-#elseif _MSC_VER == 1300 && (MSVC_VARIANT != MSVC2002 || MSVC_VARIANT != DOTNET10)
-#error Your MSVC_VARIANT setting in config.nmake and the C compiler version 13.00 (V7.0) don't match!
-#elseif _MSC_VER == 1200 && (MSVC_VARIANT != MSVC6)
-#error Your MSVC_VARIANT setting in config.nmake and the C compiler version 12.00 (V6.0) don't match!
+/* Check for the required _MSC_VER */
+#if MSC_VER_REQUIRED != _MSC_VER
+#define WS_TO_STRING2(x) #x
+#define WS_TO_STRING(x) WS_TO_STRING2(x)
+#pragma message( "_MSC_VER is:" WS_TO_STRING(_MSC_VER) " but required is:" WS_TO_STRING(MSC_VER_REQUIRED) )
+#error Your MSVC_VARIANT setting in config.nmake doesn't match the MS compiler version!
 #endif
index 3b2a67a9e26c1a578df0244b32a1f5d4f292ff54..2144c7b1f0d2e71011e5fa4a5e2d4a7e34a916f6 100644 (file)
@@ -768,3 +768,17 @@ LIBWIRESHARK_CONFIG=
 
 # Construct the path
 PATH=$(PATH);$(CYGWIN_PATH);$(GLIB_DIR)\bin;$(GETTEXT_DIR)\bin;$(ICONV_DIR)\bin;$(ZLIB_PATH);$(ADNS_PATH)
+
+
+# "convert" the MSVC variant into the required MSC compiler version
+!IF "$(MSVC_VARIANT)" == "MSVC6"
+MSC_VER_REQUIRED=1300
+!ELSEIF "$(MSVC_VARIANT)" == "MSVC2002" || "$(MSVC_VARIANT)" == "DOTNET10"
+MSC_VER_REQUIRED=1300
+!ELSEIF "$(MSVC_VARIANT)" == "MSVC2003" || "$(MSVC_VARIANT)" == "DOTNET11"
+MSC_VER_REQUIRED=1310
+!ELSEIF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20"
+MSC_VER_REQUIRED=1400
+!ELSE
+!ERROR MSVC_VARIANT unknown
+!ENDIF