On 13 April 2010 12:47, Dave Shield <[email protected]> wrote:
> (I'm looking at problems with builds with some of the other
> parameters enabled...)
The attached patch seems to fix the errors running build.bat on Windows
with Visual Studio 2008, and enabling IPv6 support.
(This patch is against the 5.2.x code - the 5.4.x version is
essentially the same, but the context has changed slightly)
I'm therefore calling for votes as to whether this should be applied
to the two lines currently in release freeze.
Dave
Index: snmplib/snmpUDPIPv6Domain.c
===================================================================
--- snmplib/snmpUDPIPv6Domain.c (revision 18463)
+++ snmplib/snmpUDPIPv6Domain.c (working copy)
@@ -45,8 +45,12 @@
#include <ws2tcpip.h>
#undef HAVE_IF_NAMETOINDEX
+#ifndef HAVE_INET_PTON
extern int inet_pton(int, const char*, void*);
+#endif
+#ifndef HAVE_INET_NTOP
extern const char *inet_ntop(int, const void*, char*, size_t);
+#endif
const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
#endif
Index: snmplib/snmpTCPIPv6Domain.c
===================================================================
--- snmplib/snmpTCPIPv6Domain.c (revision 18463)
+++ snmplib/snmpTCPIPv6Domain.c (working copy)
@@ -43,7 +43,9 @@
#include <winsock2.h>
#include <ws2tcpip.h>
+#ifndef HAVE_INET_NTOP
extern const char *inet_ntop(int, const void*, char*, size_t);
+#endif
#endif
Index: win32/net-snmp/net-snmp-config.h.in
===================================================================
--- win32/net-snmp/net-snmp-config.h.in (revision 18498)
+++ win32/net-snmp/net-snmp-config.h.in (working copy)
@@ -1641,17 +1641,23 @@
#endif
#if defined(_MSC_VER)
+ /* MSVC ^+ has inet_ntop() and inet_pton() but anything before
+ MSVC 2008 only supports IPv4 */
+ /* "have" implies "dont compile here" for snmplib/inet_?to?.c */
+ #define HAVE_INET_NTOP 1
+ #define HAVE_INET_PTON 1
+
/* this bit of magic enables or disables IPv6 transports */
#if INET6
+ /* Older than MSVC 2008 */
+ #if _MSC_VER < 1500
/* "dont have" implies "compile here" for snmplib/inet_?to?.c */
#undef HAVE_INET_NTOP
#undef HAVE_INET_PTON
+ #endif
#define SNMP_TRANSPORT_TCPIPV6_DOMAIN 1
#define SNMP_TRANSPORT_UDPIPV6_DOMAIN 1
#else
- /* "have" implies "dont compile here" for snmplib/inet_?to?.c */
- #define HAVE_INET_NTOP 1
- #define HAVE_INET_PTON 1
#undef SNMP_TRANSPORT_TCPIPV6_DOMAIN
#undef SNMP_TRANSPORT_UDPIPV6_DOMAIN
#endif
Index: win32/net-snmp/net-snmp-config.h
===================================================================
--- win32/net-snmp/net-snmp-config.h (revision 18498)
+++ win32/net-snmp/net-snmp-config.h (working copy)
@@ -1625,7 +1625,7 @@
#define DMALLOC_FUNC_CHECK
#endif
-/* #undef INET6 */
+#define INET6 1
/* #undef LOCAL_SMUX */
/* define if agentx transport is to use domain sockets only */
@@ -1641,17 +1641,23 @@
#endif
#if defined(_MSC_VER)
+ /* MSVC ^+ has inet_ntop() and inet_pton() but anything before
+ MSVC 2008 only supports IPv4 */
+ /* "have" implies "dont compile here" for snmplib/inet_?to?.c */
+ #define HAVE_INET_NTOP 1
+ #define HAVE_INET_PTON 1
+
/* this bit of magic enables or disables IPv6 transports */
#if INET6
+ /* Older than MSVC 2008 */
+ #if _MSC_VER < 1500
/* "dont have" implies "compile here" for snmplib/inet_?to?.c */
#undef HAVE_INET_NTOP
#undef HAVE_INET_PTON
+ #endif
#define SNMP_TRANSPORT_TCPIPV6_DOMAIN 1
#define SNMP_TRANSPORT_UDPIPV6_DOMAIN 1
#else
- /* "have" implies "dont compile here" for snmplib/inet_?to?.c */
- #define HAVE_INET_NTOP 1
- #define HAVE_INET_PTON 1
#undef SNMP_TRANSPORT_TCPIPV6_DOMAIN
#undef SNMP_TRANSPORT_UDPIPV6_DOMAIN
#endif
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders