Vista and higher have inet_pton().
msc_util.h has this trick to void declaring inet_pton() when building for
Win >= Vista:
#if !(NTDDI_VERSION >= NTDDI_VISTA)
int DSOLOCAL inet_pton(int family, const char *src, void *dst);
#endif
I understand that this resolved a declaration problem, but with Visual
Studio 2012 64-bit on Win 2008 R2 I get this link-time error for multiply
defined symbols:
CL -MD -I. -I.. -Ifoopath/stage/install\include -Ifoopath/stage/install
-Ifoopath/stage/install\include\libxml2 -Ifoopath/stage/install\include
/nologo /O2 /LD /W3 /wd4244 /wd4018 -DWIN32 -DWINNT -Dinline=APR_INLINE
-Dfooversion /Zi -LD mod_security2.obj apache2_config.obj apache2_io.obj
apache2_util.obj re.obj re_operators.obj re_actions.obj re_tfns.obj
re_variables.obj msc_logging.obj msc_xml.obj msc_multipart.obj
modsecurity.obj msc_parsers.obj msc_util.obj msc_pcre.obj persist_dbm.obj
msc_reqbody.obj msc_geo.obj msc_gsb.obj msc_crypt.obj msc_tree.obj
msc_unicode.obj acmp.obj msc_lua.obj msc_release.obj
libinjection\libinjection_sqli.obj -Femod_security2.so
foopath/stage/install\lib\libhttpd.lib
foopath/stage/install\lib\libapr-1.lib
foopath/stage/install\lib\libaprutil-1.lib
foopath/stage/install\lib\pcre.lib foopath/stage/install\lib\libxml2.lib
Ws2_32.lib /link
Ws2_32.lib(WS2_32.dll) : error LNK2005: inet_pton already defined in
msc_util.obj
Creating library mod_security2.lib and object mod_security2.exp
mod_security2.so : fatal error LNK1169: one or more multiply defined
symbols found
I'm using this patch to hide the implementation in the same manner that the
prototype is hidden:
--- mod_security.orig/apache2/msc_util.c 2013-07-27
21:58:50.000000000 -0600
+++ mod_security/apache2/msc_util.c 2013-11-25 16:40:09.599279200 -0700
@@ -835,7 +835,7 @@
return ((char *)haystack);
}
-#ifdef WIN32
+#if defined(WIN32) && !(NTDDI_VERSION >= NTDDI_VISTA)
int inet_pton(int family, const char *src, void *dst) {
struct addrinfo addr;
struct sockaddr_in *in = NULL;
(Only tested with mod_security for Apache building for Vista with VS 2012)
--
Born in Roswell... married an alien...
http://emptyhammock.com/
|