diff --git a/configure.ac b/configure.ac index ff190a5a..7aa31fa3 100644 --- a/configure.ac +++ b/configure.ac @@ -1640,7 +1640,6 @@ case "$host" in CPPFLAGS="$CPPFLAGS -DWIN32" WIN32_EXTRA_LIBADD="-lws2_32" WIN32_EXTRA_LDFLAGS="-no-undefined" - AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation]) if test "${PYTHON}" != "" then WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython$(echo ${PYTHON_VERSION} | tr -d .)" diff --git a/dict.c b/dict.c index 7b005ebe..bcfc8bdd 100644 --- a/dict.c +++ b/dict.c @@ -48,7 +48,7 @@ #else #ifdef HAVE_INTTYPES_H #include -#elif defined(WIN32) +#elif defined(_WIN32) typedef unsigned __int32 uint32_t; #endif #endif diff --git a/include/libxml/nanoftp.h b/include/libxml/nanoftp.h index abb4bf71..7335faf1 100644 --- a/include/libxml/nanoftp.h +++ b/include/libxml/nanoftp.h @@ -16,7 +16,7 @@ #ifdef LIBXML_FTP_ENABLED /* Needed for portability to Windows 64 bits */ -#if defined(__MINGW32__) || defined(_WIN32_WCE) +#if defined(_WIN32) && !defined(__CYGWIN__) #include #else /** diff --git a/include/win32config.h b/include/win32config.h index 40cf7df8..85967551 100644 --- a/include/win32config.h +++ b/include/win32config.h @@ -10,7 +10,6 @@ #if defined(_WIN32_WCE) #undef HAVE_ERRNO_H -#include #include "wincecompat.h" #else #define HAVE_SYS_STAT_H @@ -29,10 +28,6 @@ #define ICONV_CONST const #endif -#ifdef NEED_SOCKETS -#include -#endif - /* * Windows platforms may define except */ diff --git a/nanoftp.c b/nanoftp.c index 9219f477..16248813 100644 --- a/nanoftp.c +++ b/nanoftp.c @@ -12,8 +12,6 @@ #define HAVE_NETINET_IN_H #define HAVE_NETDB_H #define HAVE_SYS_TIME_H -#else /* TESTING */ -#define NEED_SOCKETS #endif /* TESTING */ #define IN_LIBXML @@ -77,12 +75,8 @@ #endif -#if defined(__MINGW32__) || defined(_WIN32_WCE) -#ifndef _WINSOCKAPI_ -#define _WINSOCKAPI_ -#endif +#if defined(_WIN32) && !defined(__CYGWIN__) #include -#include #endif /** diff --git a/nanohttp.c b/nanohttp.c index 667d2acd..3441ecae 100644 --- a/nanohttp.c +++ b/nanohttp.c @@ -11,7 +11,6 @@ * daniel@veillard.com */ -#define NEED_SOCKETS #define IN_LIBXML #include "libxml.h" @@ -74,12 +73,8 @@ #define XML_SOCKLEN_T unsigned int #endif -#if defined(__MINGW32__) || defined(_WIN32_WCE) -#ifndef _WINSOCKAPI_ -#define _WINSOCKAPI_ -#endif +#if defined(_WIN32) && !defined(__CYGWIN__) #include -#include #endif #include diff --git a/os400/os400config.h.in b/os400/os400config.h.in index 3966ac81..ad5abb70 100644 --- a/os400/os400config.h.in +++ b/os400/os400config.h.in @@ -333,9 +333,6 @@ #define below would cause a syntax error. */ #undef _UINT32_T -/* Using the Win32 Socket implementation */ -#undef _WINSOCKAPI_ - /* ss_family is not defined here, use __ss_family instead */ #undef ss_family diff --git a/parser.c b/parser.c index a816db0d..1c5e036e 100644 --- a/parser.c +++ b/parser.c @@ -38,7 +38,7 @@ #define IN_LIBXML #include "libxml.h" -#if defined(WIN32) && !defined (__CYGWIN__) +#if defined(_WIN32) && !defined (__CYGWIN__) #define XML_DIR_SEP '\\' #else #define XML_DIR_SEP '/' diff --git a/parserInternals.c b/parserInternals.c index 43a0f5ac..efb23872 100644 --- a/parserInternals.c +++ b/parserInternals.c @@ -10,7 +10,7 @@ #define IN_LIBXML #include "libxml.h" -#if defined(WIN32) && !defined (__CYGWIN__) +#if defined(_WIN32) && !defined (__CYGWIN__) #define XML_DIR_SEP '\\' #else #define XML_DIR_SEP '/' diff --git a/runtest.c b/runtest.c index 714de275..0d237018 100644 --- a/runtest.c +++ b/runtest.c @@ -4021,7 +4021,7 @@ thread_specific_data(void *private_data) return ((void *) Okay); } -#if defined WIN32 +#if defined(_WIN32) && !defined(__CYGWIN__) #include #include diff --git a/threads.c b/threads.c index e52f2638..88606974 100644 --- a/threads.c +++ b/threads.c @@ -27,6 +27,7 @@ #ifdef HAVE_PTHREAD_H #include #elif defined HAVE_WIN32_THREADS +#define WIN32_LEAN_AND_MEAN #include #ifndef HAVE_COMPILER_TLS #include diff --git a/timsort.h b/timsort.h index 19aebf2a..724e0669 100644 --- a/timsort.h +++ b/timsort.h @@ -24,14 +24,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #else #ifdef HAVE_INTTYPES_H #include -#elif defined(WIN32) +#elif defined(_WIN32) typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #endif #endif #ifndef MK_UINT64 -#if defined(WIN32) && defined(_MSC_VER) && _MSC_VER < 1300 +#if defined(_MSC_VER) && _MSC_VER < 1300 #define MK_UINT64(x) ((uint64_t)(x)) #else #define MK_UINT64(x) x##ULL diff --git a/win32/Makefile.mingw b/win32/Makefile.mingw index 18893760..f579923a 100644 --- a/win32/Makefile.mingw +++ b/win32/Makefile.mingw @@ -71,11 +71,9 @@ LDFLAGS += -Wl,--minor-image-version,$(LIBXML_MINOR_VERSION) LDFLAGS += -Wl,-L,$(BINDIR) -Wl,-L,$(LIBPREFIX) LIBS = ifeq ($(WITH_FTP),1) -CFLAGS += -D_WINSOCKAPI_ LIBS += -lwsock32 -lws2_32 endif ifeq ($(WITH_HTTP),1) -CFLAGS += -D_WINSOCKAPI_ LIBS += -lwsock32 -lws2_32 endif ifeq ($(WITH_ICONV),1) diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc index d16c1a2d..bb7fa4a6 100644 --- a/win32/Makefile.msvc +++ b/win32/Makefile.msvc @@ -43,7 +43,7 @@ CPPFLAGS = $(CPPFLAGS) /D "_REENTRANT" # The compiler and its options. CC = cl.exe -CFLAGS = /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "NOLIBTOOL" /W1 $(CRUNTIME) +CFLAGS = /nologo /D "_WINDOWS" /D "_MBCS" /D "NOLIBTOOL" /W1 $(CRUNTIME) CFLAGS = $(CFLAGS) /I$(XML_SRCDIR) /I$(XML_SRCDIR)\include /I$(INCPREFIX) !if "$(WITH_THREADS)" != "no" CFLAGS = $(CFLAGS) /D "_REENTRANT" diff --git a/win32/VC10/config.h b/win32/VC10/config.h index 891b57e4..4e184a3d 100644 --- a/win32/VC10/config.h +++ b/win32/VC10/config.h @@ -9,7 +9,6 @@ #if defined(_WIN32_WCE) #undef HAVE_ERRNO_H -#include #include "wincecompat.h" #else #define HAVE_SYS_STAT_H @@ -28,10 +27,6 @@ #define ICONV_CONST const #endif -#ifdef NEED_SOCKETS -#include -#endif - /* * Windows platforms may define except */ diff --git a/xmlIO.c b/xmlIO.c index 5902f627..b15d91d1 100644 --- a/xmlIO.c +++ b/xmlIO.c @@ -40,7 +40,8 @@ #include #endif -#if defined(WIN32) || defined(_WIN32) +#if defined(_WIN32) && !defined(__CYGWIN__) +#define WIN32_LEAN_AND_MEAN #include #endif @@ -3829,7 +3830,7 @@ xmlParserGetDirectory(const char *filename) { if (filename == NULL) return(NULL); -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) # define IS_XMLPGD_SEP(ch) ((ch=='/')||(ch=='\\')) #else # define IS_XMLPGD_SEP(ch) (ch=='/') diff --git a/xmlmodule.c b/xmlmodule.c index 7f70f9cb..e3a8bd64 100644 --- a/xmlmodule.c +++ b/xmlmodule.c @@ -301,8 +301,9 @@ xmlModulePlatformSymbol(void *handle, const char *name, void **symbol) #endif /* HAVE_SHLLOAD */ #endif /* ! HAVE_DLOPEN */ -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__CYGWIN__) +#define WIN32_LEAN_AND_MEAN #include /*