Use #ifdef instead of #if for all feature tests. Check that _MSC_VER is defined before using it.
Index: dlls/gdi/bidi.c =================================================================== RCS file: /home/wine/wine/dlls/gdi/bidi.c,v retrieving revision 1.2 diff -u -r1.2 bidi.c --- dlls/gdi/bidi.c 5 Sep 2003 23:08:38 -0000 1.2 +++ dlls/gdi/bidi.c 29 Sep 2003 18:46:18 -0000 @@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(bidi); -#if HAVE_ICU +#ifdef HAVE_ICU BOOL BidiAvail = TRUE; #else BOOL BidiAvail = FALSE; Index: dlls/iphlpapi/ipstats.c =================================================================== RCS file: /home/wine/wine/dlls/iphlpapi/ipstats.c,v retrieving revision 1.6 diff -u -r1.6 ipstats.c --- dlls/iphlpapi/ipstats.c 5 Sep 2003 23:08:37 -0000 1.6 +++ dlls/iphlpapi/ipstats.c 29 Sep 2003 18:46:22 -0000 @@ -34,16 +34,16 @@ #ifdef HAVE_ARPA_INET_H #include <arpa/inet.h> #endif -#if HAVE_NET_IF_H +#ifdef HAVE_NET_IF_H #include <net/if.h> #endif -#if HAVE_NET_IF_ARP_H +#ifdef HAVE_NET_IF_ARP_H #include <net/if_arp.h> #endif -#if HAVE_NETINET_TCP_H +#ifdef HAVE_NETINET_TCP_H #include <netinet/tcp.h> #endif -#if HAVE_NETINET_TCP_FSM_H +#ifdef HAVE_NETINET_TCP_FSM_H #include <netinet/tcp_fsm.h> #endif Index: dlls/kernel/pthread.c =================================================================== RCS file: /home/wine/wine/dlls/kernel/pthread.c,v retrieving revision 1.3 diff -u -r1.3 pthread.c --- dlls/kernel/pthread.c 23 Sep 2003 22:59:44 -0000 1.3 +++ dlls/kernel/pthread.c 29 Sep 2003 18:46:25 -0000 @@ -34,7 +34,7 @@ #endif #include <string.h> #include <sys/types.h> -#if HAVE_SYS_SOCKET_H +#ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif #ifdef HAVE_SYS_MMAN_H Index: dlls/msvcrt/process.c =================================================================== RCS file: /home/wine/wine/dlls/msvcrt/process.c,v retrieving revision 1.18 diff -u -r1.18 process.c --- dlls/msvcrt/process.c 20 Aug 2003 03:34:20 -0000 1.18 +++ dlls/msvcrt/process.c 29 Sep 2003 18:46:29 -0000 @@ -153,10 +153,10 @@ char* p; char *ret; -#if HAVE_VA_COPY +#ifdef HAVE_VA_COPY va_copy(alist2,alist); #else -# if HAVE___VA_COPY +# ifdef HAVE___VA_COPY __va_copy(alist2,alist); # else alist2 = alist; Index: dlls/winsock/async.c =================================================================== RCS file: /home/wine/wine/dlls/winsock/async.c,v retrieving revision 1.31 diff -u -r1.31 async.c --- dlls/winsock/async.c 5 Sep 2003 23:08:26 -0000 1.31 +++ dlls/winsock/async.c 29 Sep 2003 18:46:40 -0000 @@ -400,7 +400,7 @@ case AQ_GETHOST: { struct hostent *he; char *copy_hostent = targetptr; -#if HAVE_LINUX_GETHOSTBYNAME_R_6 +#ifdef HAVE_LINUX_GETHOSTBYNAME_R_6 char *extrabuf; int ebufsize=1024; struct hostent hostentry; @@ -442,7 +442,7 @@ size = -size; } } -#if HAVE_LINUX_GETHOSTBYNAME_R_6 +#ifdef HAVE_LINUX_GETHOSTBYNAME_R_6 HeapFree(GetProcessHeap(),0,extrabuf); #else LeaveCriticalSection( &csWSgetXXXbyYYY ); Index: dlls/winsock/socket.c =================================================================== RCS file: /home/wine/wine/dlls/winsock/socket.c,v retrieving revision 1.136 diff -u -r1.136 socket.c --- dlls/winsock/socket.c 5 Sep 2003 23:08:26 -0000 1.136 +++ dlls/winsock/socket.c 29 Sep 2003 18:46:59 -0000 @@ -2838,7 +2838,7 @@ WIN_hostent *retval = NULL; struct hostent* host; -#if HAVE_LINUX_GETHOSTBYNAME_R_6 +#ifdef HAVE_LINUX_GETHOSTBYNAME_R_6 char *extrabuf; int ebufsize=1024; struct hostent hostentry; Index: include/pshpack1.h =================================================================== RCS file: /home/wine/wine/include/pshpack1.h,v retrieving revision 1.6 diff -u -r1.6 pshpack1.h --- include/pshpack1.h 11 Sep 2003 23:08:58 -0000 1.6 +++ include/pshpack1.h 29 Sep 2003 18:47:02 -0000 @@ -38,7 +38,7 @@ # include <poppack.h> # endif -# if _MSC_VER >= 800 +# if defined(_MSC_VER) && (_MSC_VER >= 800) # pragma warning(disable:4103) # endif Index: include/pshpack2.h =================================================================== RCS file: /home/wine/wine/include/pshpack2.h,v retrieving revision 1.6 diff -u -r1.6 pshpack2.h --- include/pshpack2.h 11 Sep 2003 23:08:58 -0000 1.6 +++ include/pshpack2.h 29 Sep 2003 18:47:02 -0000 @@ -38,7 +38,7 @@ # include <poppack.h> # endif -# if _MSC_VER >= 800 +# if defined(_MSC_VER) && (_MSC_VER >= 800) # pragma warning(disable:4103) # endif Index: include/pshpack4.h =================================================================== RCS file: /home/wine/wine/include/pshpack4.h,v retrieving revision 1.7 diff -u -r1.7 pshpack4.h --- include/pshpack4.h 11 Sep 2003 23:08:58 -0000 1.7 +++ include/pshpack4.h 29 Sep 2003 18:47:03 -0000 @@ -38,7 +38,7 @@ # include <poppack.h> # endif -# if _MSC_VER >= 800 +# if defined(_MSC_VER) && (_MSC_VER >= 800) # pragma warning(disable:4103) # endif Index: include/pshpack8.h =================================================================== RCS file: /home/wine/wine/include/pshpack8.h,v retrieving revision 1.6 diff -u -r1.6 pshpack8.h --- include/pshpack8.h 11 Sep 2003 23:08:58 -0000 1.6 +++ include/pshpack8.h 29 Sep 2003 18:47:03 -0000 @@ -38,7 +38,7 @@ # include <poppack.h> # endif -# if _MSC_VER >= 800 +# if defined(_MSC_VER) && (_MSC_VER >= 800) # pragma warning(disable:4103) # endif Index: include/winnt.h =================================================================== RCS file: /home/wine/wine/include/winnt.h,v retrieving revision 1.171 diff -u -r1.171 winnt.h --- include/winnt.h 24 Sep 2003 05:26:00 -0000 1.171 +++ include/winnt.h 29 Sep 2003 18:47:23 -0000 @@ -48,7 +48,7 @@ #endif #ifndef DECLSPEC_NORETURN -# if (_MSC_VER >= 1200) && !defined(MIDL_PASS) +# if defined(_MSC_VER) && (_MSC_VER >= 1200) && !defined(MIDL_PASS) # define DECLSPEC_NORETURN __declspec(noreturn) # elif defined(__GNUC__) # define DECLSPEC_NORETURN __attribute__((noreturn)) @@ -58,7 +58,7 @@ #endif #ifndef DECLSPEC_ALIGN -# if (_MSC_VER >= 1300) && !defined(MIDL_PASS) +# if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS) # define DECLSPEC_ALIGN(x) __declspec(align(x)) # elif defined(__GNUC__) # define DECLSPEC_ALIGN(x) __attribute__((aligned(x))) @@ -72,7 +72,7 @@ #endif #ifndef DECLSPEC_UUID -# if (_MSC_VER >= 1100) && defined (__cplusplus) +# if defined(_MSC_VER) && (_MSC_VER >= 1100) && defined (__cplusplus) # define DECLSPEC_UUID(x) __declspec(uuid(x)) # else # define DECLSPEC_UUID(x) @@ -80,7 +80,7 @@ #endif #ifndef DECLSPEC_NOVTABLE -# if (_MSC_VER >= 1100) && defined(__cplusplus) +# if defined(_MSC_VER) && (_MSC_VER >= 1100) && defined(__cplusplus) # define DECLSPEC_NOVTABLE __declspec(novtable) # else # define DECLSPEC_NOVTABLE @@ -88,7 +88,7 @@ #endif #ifndef DECLSPEC_SELECTANY -#if (_MSC_VER >= 1100) +#if defined(_MSC_VER) && (_MSC_VER >= 1100) #define DECLSPEC_SELECTANY __declspec(selectany) #else #define DECLSPEC_SELECTANY @@ -96,7 +96,7 @@ #endif #ifndef NOP_FUNCTION -# if (_MSC_VER >= 1210) +# if defined(_MSC_VER) && (_MSC_VER >= 1210) # define NOP_FUNCTION __noop # else # define NOP_FUNCTION (void)0 @@ -104,7 +104,7 @@ #endif #ifndef DECLSPEC_ADDRSAFE -# if (_MSC_VER >= 1200) && (defined(_M_ALPHA) || defined(_M_AXP64)) +# if defined(_MSC_VER) && (_MSC_VER >= 1200) && (defined(_M_ALPHA) || defined(_M_AXP64)) # define DECLSPEC_ADDRSAFE __declspec(address_safe) # else # define DECLSPEC_ADDRSAFE @@ -112,7 +112,7 @@ #endif #ifndef FORCEINLINE -# if (_MSC_VER >= 1200) +# if defined(_MSC_VER) && (_MSC_VER >= 1200) # define FORCEINLINE __forceinline # elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2))) # define FORCEINLINE __attribute__((always_inline)) @@ -122,7 +122,7 @@ #endif #ifndef DECLSPEC_DEPRECATED -# if (_MSC_VER >= 1300) && !defined(MIDL_PASS) +# if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS) # define DECLSPEC_DEPRECATED __declspec(deprecated) # define DEPRECATE_SUPPORTED # elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2))) @@ -234,7 +234,7 @@ #define MEMORY_ALLOCATION_ALIGNMENT 8 #endif -#if (_MSC_VER >= 1300) && defined(__cplusplus) +#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus) # define TYPE_ALIGNMENT(t) __alignof(t) #elif defined(__GNUC__) # define TYPE_ALIGNMENT(t) __alignof__(t) Index: scheduler/pthread.c =================================================================== RCS file: /home/wine/wine/scheduler/pthread.c,v retrieving revision 1.42 diff -u -r1.42 pthread.c --- scheduler/pthread.c 25 Sep 2003 20:30:18 -0000 1.42 +++ scheduler/pthread.c 29 Sep 2003 18:47:32 -0000 @@ -39,7 +39,7 @@ #endif #include <string.h> #include <sys/types.h> -#if HAVE_SYS_SOCKET_H +#ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif #ifdef HAVE_SYS_MMAN_H Index: tools/winapi/winapi_test =================================================================== RCS file: /home/wine/wine/tools/winapi/winapi_test,v retrieving revision 1.10 diff -u -r1.10 winapi_test --- tools/winapi/winapi_test 12 Nov 2002 01:05:17 -0000 1.10 +++ tools/winapi/winapi_test 29 Sep 2003 18:47:38 -0000 @@ -483,7 +483,7 @@ print OUT " * Windows API extension\n"; print OUT " */\n"; print OUT "\n"; - print OUT "#if (_MSC_VER >= 1300) && defined(__cplusplus)\n"; + print OUT "#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)\n"; print OUT "# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field)\n"; print OUT "#elif defined(__GNUC__)\n"; print OUT "# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field)\n"; @@ -491,7 +491,7 @@ print OUT "/* FIXME: Not sure if is possible to do without compiler extension */\n"; print OUT "#endif\n"; print OUT "\n"; - print OUT "#if (_MSC_VER >= 1300) && defined(__cplusplus)\n"; + print OUT "#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)\n"; print OUT "# define _TYPE_ALIGNMENT(type) __alignof(type)\n"; print OUT "#elif defined(__GNUC__)\n"; print OUT "# define _TYPE_ALIGNMENT(type) __alignof__(type)\n";