From e105d5c28f3f6c7034a8da2682bbc662ad6c15e1 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 16 Dec 2005 20:55:07 +0000 Subject: 'Fix' windows builds --- src/config-win32.h | 12 ++++++++++++ src/setup.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) (limited to 'src') diff --git a/src/config-win32.h b/src/config-win32.h index e6dde29d1..307627f27 100644 --- a/src/config-win32.h +++ b/src/config-win32.h @@ -23,6 +23,18 @@ /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define if you have the header file. */ +#define HAVE_WINDOWS_H 1 + +/* Define if you have the header file. */ +#define HAVE_WINSOCK_H 1 + +/* Define if you have the header file. */ +#define HAVE_WINSOCK2_H 1 + +/* Define if you have the header file. */ +#define HAVE_WS2TCPIP_H 1 + /* Define if you have utime() */ #if !defined(__BORLANDC__) #define HAVE_UTIME 1 diff --git a/src/setup.h b/src/setup.h index 01823157c..4cc41dd87 100644 --- a/src/setup.h +++ b/src/setup.h @@ -60,6 +60,34 @@ #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 +# ifdef HAVE_WINSOCK2_H +# include +# ifdef HAVE_WS2TCPIP_H +# include +# endif +# else +# ifdef HAVE_WINSOCK_H +# include +# endif +# endif +# endif +#endif + + #include #ifdef __TANDEM -- cgit v1.2.3