Windows: Suppress Visual Studio 2013 warnings about strtoull()
diff --git a/snmplib/strtoull.c b/snmplib/strtoull.c
index 6c98fc4..9ee53b4 100644
--- a/snmplib/strtoull.c
+++ b/snmplib/strtoull.c
@@ -20,6 +20,8 @@
#include <net-snmp/net-snmp-config.h>
+#ifndef HAVE_STRTOULL
+
#include <errno.h>
#include <ctype.h>
#include <limits.h>
@@ -156,3 +158,5 @@
*endptr = (char *) nptr;
return 0;
}
+
+#endif /* HAVE_STRTOULL */
diff --git a/win32/net-snmp/net-snmp-config.h b/win32/net-snmp/net-snmp-config.h
index 131191b..1608563 100644
--- a/win32/net-snmp/net-snmp-config.h
+++ b/win32/net-snmp/net-snmp-config.h
@@ -5,12 +5,14 @@
#define NET_SNMP_CONFIG_H
/* _MSC_VER values
- 1600 = 10.0 (2010)
- 1500 = 9.0 (2008)
- 1400 = 8.0 (2005)
- 1310 = 7.1 (2003)
- 1300 = 7.0 (2002)
- 1200 = 6.0
+ 1800 = MSVC++ 12.0 (Visual Studio 2013)
+ 1700 = MSVC++ 11.0 (Visual Studio 2012)
+ 1600 = MSVC++ 10.0 (Visual Studio 2010)
+ 1500 = MSVC++ 9.0 (Visual Studio 2008)
+ 1400 = MSVC++ 8.0 (Visual Studio 2005)
+ 1310 = MSVC++ 7.1 (Visual Studio 2003)
+ 1300 = MSVC++ 7.0 (Visual Studio 2002)
+ 1200 = MSVC++ 6.0
*/
#ifdef _MSC_VER
@@ -1616,10 +1618,17 @@
#endif
#ifndef __cplusplus
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 4804) // '-' : unsafe use of type 'bool' in operation
+#endif
enum {
netsnmp_compile_time_uintptr_t_size_check
= sizeof(struct netsnmp_compile_time_uintptr_t_size_check_s { int:-!(sizeof(uintptr_t) == sizeof(void*)); })
};
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
#endif
/* Define if you have the closesocket function. */
@@ -1751,7 +1760,11 @@
#endif
/* Define to 1 if you have the `strtoull' function. */
+#if _MSC_VER >= 1800
+#define HAVE_STRTOULL 1
+#else
/* #undef HAVE_STRTOULL */
+#endif
/*
* Module configuration and control starts here.
diff --git a/win32/net-snmp/net-snmp-config.h.in b/win32/net-snmp/net-snmp-config.h.in
index 2469c77..9693730 100644
--- a/win32/net-snmp/net-snmp-config.h.in
+++ b/win32/net-snmp/net-snmp-config.h.in
@@ -5,12 +5,14 @@
#define NET_SNMP_CONFIG_H
/* _MSC_VER values
- 1600 = 10.0 (2010)
- 1500 = 9.0 (2008)
- 1400 = 8.0 (2005)
- 1310 = 7.1 (2003)
- 1300 = 7.0 (2002)
- 1200 = 6.0
+ 1800 = MSVC++ 12.0 (Visual Studio 2013)
+ 1700 = MSVC++ 11.0 (Visual Studio 2012)
+ 1600 = MSVC++ 10.0 (Visual Studio 2010)
+ 1500 = MSVC++ 9.0 (Visual Studio 2008)
+ 1400 = MSVC++ 8.0 (Visual Studio 2005)
+ 1310 = MSVC++ 7.1 (Visual Studio 2003)
+ 1300 = MSVC++ 7.0 (Visual Studio 2002)
+ 1200 = MSVC++ 6.0
*/
#ifdef _MSC_VER
@@ -1758,7 +1760,11 @@
#endif
/* Define to 1 if you have the `strtoull' function. */
+#if _MSC_VER >= 1800
+#define HAVE_STRTOULL
+#else
/* #undef HAVE_STRTOULL */
+#endif
/*
* Module configuration and control starts here.