]> granicus.if.org Git - curl/commitdiff
'Fix' windows builds
authorYang Tse <yangsita@gmail.com>
Fri, 16 Dec 2005 20:55:07 +0000 (20:55 +0000)
committerYang Tse <yangsita@gmail.com>
Fri, 16 Dec 2005 20:55:07 +0000 (20:55 +0000)
ares/config-win32.h
ares/setup.h
lib/config-win32.h
lib/config-win32ce.h
lib/setup.h
src/config-win32.h
src/setup.h

index 5026728b43d006727fa76dbcc6e727147c801bdd..4847507f5fcb75ae0bf2e72eebdada20e558c9e2 100644 (file)
 #ifndef __CONFIG_WIN32_H
 #define __CONFIG_WIN32_H
 
+#define HAVE_WINDOWS_H
+#define HAVE_WINSOCK2_H
+#define HAVE_WS2TCPIP_H
+
 #if defined(__MINGW32__)
 #define HAVE_GETOPT_H
 #endif
index 831bda4601df652423f29858dbbd26fa728e9d9f..05eb76b3dd4768e31b47c2fcab8d1197b1d10b94 100644 (file)
 #include "config-win32.h"
 #endif
 
+
+/* 
+ * Include header files for windows builds before redefining anything.
+ * Use this preproessor block only to include or exclude windows.h, 
+ * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs 
+ * to any other further and independant block.
+ */
+
+#ifdef WIN32
+#  ifdef HAVE_WINDOWS_H
+#    ifndef WIN32_LEAN_AND_MEAN
+#      define WIN32_LEAN_AND_MEAN
+#    endif
+#    include <windows.h>
+#    ifdef HAVE_WINSOCK2_H
+#      include <winsock2.h>
+#      ifdef HAVE_WS2TCPIP_H
+#         include <ws2tcpip.h>
+#      endif
+#    else
+#      ifdef HAVE_WINSOCK_H
+#        include <winsock.h>
+#      endif
+#    endif
+#  endif
+#endif
+
+
 /* simple work-around for now, for systems without configure support */
 #ifndef __DJGPP__
 #define ssize_t int
@@ -44,8 +72,6 @@
 
 /* now typedef our socket type */
 #if defined(WIN32) && !defined(WATT32)
-#include <winsock2.h>
-#include <ws2tcpip.h>
 typedef SOCKET ares_socket_t;
 #define ARES_SOCKET_BAD INVALID_SOCKET
 #else
index 030b82dfce7084845737d43b623b63f7a60cb69b..81216461d6dfa6c66cc41058165f89adb2a0c388 100644 (file)
 /* Define if you have the <time.h> header file.  */
 #define HAVE_TIME_H 1
 
+/* Define if you have the <windows.h> header file.  */
+#define HAVE_WINDOWS_H 1
+
 /* Define if you have the <winsock.h> header file.  */
 #define HAVE_WINSOCK_H 1
 
index 84c5eb8f6864f26488a03ee88968e8fdba386429..ffc89d0b2b93fba0bc54375d11ad30fd7eacb0ca 100644 (file)
 /* Define if you have the <time.h> header file.  */
 #define HAVE_TIME_H 1
 
+/* Define if you have the <windows.h> header file.  */
+#define HAVE_WINDOWS_H 1
+
 /* Define if you have the <winsock.h> header file.  */
 #define HAVE_WINSOCK_H 1
 
index 2fcc29cd845400ddb14915771bcc26fa44f1df05..6719aa27d5cc7605d00bebe1bd6815fcad3ce925 100644 (file)
 #include "amigaos.h"
 #endif
 
+
+/* 
+ * Include header files for windows builds before redefining anything.
+ * Use this preproessor block only to include or exclude windows.h, 
+ * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs 
+ * to any other further and independant block.
+ */
+
+#ifdef WIN32
+#  ifdef HAVE_WINDOWS_H
+#    ifndef WIN32_LEAN_AND_MEAN
+#      define WIN32_LEAN_AND_MEAN
+#    endif
+#    include <windows.h>
+#    ifdef HAVE_WINSOCK2_H
+#      include <winsock2.h>
+#      ifdef HAVE_WS2TCPIP_H
+#         include <ws2tcpip.h>
+#      endif
+#    else
+#      ifdef HAVE_WINSOCK_H
+#        include <winsock.h>
+#      endif
+#    endif
+#  endif
+#endif
+
+
 #ifndef TRUE
 #define TRUE 1
 #endif
@@ -161,20 +189,6 @@ typedef unsigned char bool;
 
 #ifdef WIN32
 
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN  /* Prevent including <winsock*.h> in <windows.h> */
-#endif /* WIN32_LEAN_AND_MEAN */
-
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>        /* required by telnet.c */
-#endif
-
-#if defined(ENABLE_IPV6) || defined(USE_SSLEAY)
-#if !defined(_MSC_VER) || (_MSC_VER >= 1300)
-#include <ws2tcpip.h>
-#endif
-#endif
-
 #if !defined(__GNUC__) || defined(__MINGW32__)
 #define sclose(x) closesocket(x)
 
index e6dde29d1b786285c4506ed820a4c2b10b9dfabd..307627f27df0d7339039a5d943ae70dbe5a5733b 100644 (file)
 /* Define if you have the <fcntl.h> header file.  */
 #define HAVE_FCNTL_H 1
 
+/* Define if you have the <windows.h> header file.  */
+#define HAVE_WINDOWS_H 1
+
+/* Define if you have the <winsock.h> header file.  */
+#define HAVE_WINSOCK_H 1
+
+/* Define if you have the <winsock2.h> header file.  */
+#define HAVE_WINSOCK2_H 1
+
+/* Define if you have the <ws2tcpip.h> header file.  */
+#define HAVE_WS2TCPIP_H 1
+
 /* Define if you have utime() */
 #if !defined(__BORLANDC__)
 #define HAVE_UTIME 1
index 01823157c1598e0588bad9d2ca0f3bc54e281b60..4cc41dd878c16c5a5cba522db9653ed0f15707d4 100644 (file)
 #include "../lib/setup.h"
 #endif
 
+
+/* 
+ * Include header files for windows builds before redefining anything.
+ * Use this preproessor block only to include or exclude windows.h, 
+ * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs 
+ * to any other further and independant block.
+ */
+
+#ifdef WIN32
+#  ifdef HAVE_WINDOWS_H
+#    ifndef WIN32_LEAN_AND_MEAN
+#      define WIN32_LEAN_AND_MEAN
+#    endif
+#    include <windows.h>
+#    ifdef HAVE_WINSOCK2_H
+#      include <winsock2.h>
+#      ifdef HAVE_WS2TCPIP_H
+#         include <ws2tcpip.h>
+#      endif
+#    else
+#      ifdef HAVE_WINSOCK_H
+#        include <winsock.h>
+#      endif
+#    endif
+#  endif
+#endif
+
+
 #include <stdio.h>
 
 #ifdef __TANDEM