Commit a613de2a authored by Daniel Marmier's avatar Daniel Marmier Committed by Alexandre Julliard

Use #ifdef instead of #if for all feature tests.

Check that _MSC_VER is defined before using it.
parent bd554e63
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(bidi); WINE_DEFAULT_DEBUG_CHANNEL(bidi);
#if HAVE_ICU #ifdef HAVE_ICU
BOOL BidiAvail = TRUE; BOOL BidiAvail = TRUE;
#else #else
BOOL BidiAvail = FALSE; BOOL BidiAvail = FALSE;
......
...@@ -34,16 +34,16 @@ ...@@ -34,16 +34,16 @@
#ifdef HAVE_ARPA_INET_H #ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h> #include <arpa/inet.h>
#endif #endif
#if HAVE_NET_IF_H #ifdef HAVE_NET_IF_H
#include <net/if.h> #include <net/if.h>
#endif #endif
#if HAVE_NET_IF_ARP_H #ifdef HAVE_NET_IF_ARP_H
#include <net/if_arp.h> #include <net/if_arp.h>
#endif #endif
#if HAVE_NETINET_TCP_H #ifdef HAVE_NETINET_TCP_H
#include <netinet/tcp.h> #include <netinet/tcp.h>
#endif #endif
#if HAVE_NETINET_TCP_FSM_H #ifdef HAVE_NETINET_TCP_FSM_H
#include <netinet/tcp_fsm.h> #include <netinet/tcp_fsm.h>
#endif #endif
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#endif #endif
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#if HAVE_SYS_SOCKET_H #ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h> # include <sys/socket.h>
#endif #endif
#ifdef HAVE_SYS_MMAN_H #ifdef HAVE_SYS_MMAN_H
......
...@@ -153,10 +153,10 @@ static char* msvcrt_valisttos(const char* arg0, va_list alist, char delim) ...@@ -153,10 +153,10 @@ static char* msvcrt_valisttos(const char* arg0, va_list alist, char delim)
char* p; char* p;
char *ret; char *ret;
#if HAVE_VA_COPY #ifdef HAVE_VA_COPY
va_copy(alist2,alist); va_copy(alist2,alist);
#else #else
# if HAVE___VA_COPY # ifdef HAVE___VA_COPY
__va_copy(alist2,alist); __va_copy(alist2,alist);
# else # else
alist2 = alist; alist2 = alist;
......
...@@ -400,7 +400,7 @@ static DWORD WINAPI _async_queryfun(LPVOID arg) { ...@@ -400,7 +400,7 @@ static DWORD WINAPI _async_queryfun(LPVOID arg) {
case AQ_GETHOST: { case AQ_GETHOST: {
struct hostent *he; struct hostent *he;
char *copy_hostent = targetptr; char *copy_hostent = targetptr;
#if HAVE_LINUX_GETHOSTBYNAME_R_6 #ifdef HAVE_LINUX_GETHOSTBYNAME_R_6
char *extrabuf; char *extrabuf;
int ebufsize=1024; int ebufsize=1024;
struct hostent hostentry; struct hostent hostentry;
...@@ -442,7 +442,7 @@ static DWORD WINAPI _async_queryfun(LPVOID arg) { ...@@ -442,7 +442,7 @@ static DWORD WINAPI _async_queryfun(LPVOID arg) {
size = -size; size = -size;
} }
} }
#if HAVE_LINUX_GETHOSTBYNAME_R_6 #ifdef HAVE_LINUX_GETHOSTBYNAME_R_6
HeapFree(GetProcessHeap(),0,extrabuf); HeapFree(GetProcessHeap(),0,extrabuf);
#else #else
LeaveCriticalSection( &csWSgetXXXbyYYY ); LeaveCriticalSection( &csWSgetXXXbyYYY );
......
...@@ -2838,7 +2838,7 @@ static WIN_hostent* __ws_gethostbyaddr(const char *addr, int len, int type, int ...@@ -2838,7 +2838,7 @@ static WIN_hostent* __ws_gethostbyaddr(const char *addr, int len, int type, int
WIN_hostent *retval = NULL; WIN_hostent *retval = NULL;
struct hostent* host; struct hostent* host;
#if HAVE_LINUX_GETHOSTBYNAME_R_6 #ifdef HAVE_LINUX_GETHOSTBYNAME_R_6
char *extrabuf; char *extrabuf;
int ebufsize=1024; int ebufsize=1024;
struct hostent hostentry; struct hostent hostentry;
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
# include <poppack.h> # include <poppack.h>
# endif # endif
# if _MSC_VER >= 800 # if defined(_MSC_VER) && (_MSC_VER >= 800)
# pragma warning(disable:4103) # pragma warning(disable:4103)
# endif # endif
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
# include <poppack.h> # include <poppack.h>
# endif # endif
# if _MSC_VER >= 800 # if defined(_MSC_VER) && (_MSC_VER >= 800)
# pragma warning(disable:4103) # pragma warning(disable:4103)
# endif # endif
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
# include <poppack.h> # include <poppack.h>
# endif # endif
# if _MSC_VER >= 800 # if defined(_MSC_VER) && (_MSC_VER >= 800)
# pragma warning(disable:4103) # pragma warning(disable:4103)
# endif # endif
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
# include <poppack.h> # include <poppack.h>
# endif # endif
# if _MSC_VER >= 800 # if defined(_MSC_VER) && (_MSC_VER >= 800)
# pragma warning(disable:4103) # pragma warning(disable:4103)
# endif # endif
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
#endif #endif
#ifndef DECLSPEC_NORETURN #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) # define DECLSPEC_NORETURN __declspec(noreturn)
# elif defined(__GNUC__) # elif defined(__GNUC__)
# define DECLSPEC_NORETURN __attribute__((noreturn)) # define DECLSPEC_NORETURN __attribute__((noreturn))
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
#endif #endif
#ifndef DECLSPEC_ALIGN #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)) # define DECLSPEC_ALIGN(x) __declspec(align(x))
# elif defined(__GNUC__) # elif defined(__GNUC__)
# define DECLSPEC_ALIGN(x) __attribute__((aligned(x))) # define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
#endif #endif
#ifndef DECLSPEC_UUID #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)) # define DECLSPEC_UUID(x) __declspec(uuid(x))
# else # else
# define DECLSPEC_UUID(x) # define DECLSPEC_UUID(x)
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
#endif #endif
#ifndef DECLSPEC_NOVTABLE #ifndef DECLSPEC_NOVTABLE
# if (_MSC_VER >= 1100) && defined(__cplusplus) # if defined(_MSC_VER) && (_MSC_VER >= 1100) && defined(__cplusplus)
# define DECLSPEC_NOVTABLE __declspec(novtable) # define DECLSPEC_NOVTABLE __declspec(novtable)
# else # else
# define DECLSPEC_NOVTABLE # define DECLSPEC_NOVTABLE
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
#endif #endif
#ifndef DECLSPEC_SELECTANY #ifndef DECLSPEC_SELECTANY
#if (_MSC_VER >= 1100) #if defined(_MSC_VER) && (_MSC_VER >= 1100)
#define DECLSPEC_SELECTANY __declspec(selectany) #define DECLSPEC_SELECTANY __declspec(selectany)
#else #else
#define DECLSPEC_SELECTANY #define DECLSPEC_SELECTANY
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
#endif #endif
#ifndef NOP_FUNCTION #ifndef NOP_FUNCTION
# if (_MSC_VER >= 1210) # if defined(_MSC_VER) && (_MSC_VER >= 1210)
# define NOP_FUNCTION __noop # define NOP_FUNCTION __noop
# else # else
# define NOP_FUNCTION (void)0 # define NOP_FUNCTION (void)0
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
#endif #endif
#ifndef DECLSPEC_ADDRSAFE #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) # define DECLSPEC_ADDRSAFE __declspec(address_safe)
# else # else
# define DECLSPEC_ADDRSAFE # define DECLSPEC_ADDRSAFE
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
#endif #endif
#ifndef FORCEINLINE #ifndef FORCEINLINE
# if (_MSC_VER >= 1200) # if defined(_MSC_VER) && (_MSC_VER >= 1200)
# define FORCEINLINE __forceinline # define FORCEINLINE __forceinline
# elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2))) # elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2)))
# define FORCEINLINE __attribute__((always_inline)) # define FORCEINLINE __attribute__((always_inline))
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
#endif #endif
#ifndef DECLSPEC_DEPRECATED #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 DECLSPEC_DEPRECATED __declspec(deprecated)
# define DEPRECATE_SUPPORTED # define DEPRECATE_SUPPORTED
# elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2))) # elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2)))
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
#define MEMORY_ALLOCATION_ALIGNMENT 8 #define MEMORY_ALLOCATION_ALIGNMENT 8
#endif #endif
#if (_MSC_VER >= 1300) && defined(__cplusplus) #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
# define TYPE_ALIGNMENT(t) __alignof(t) # define TYPE_ALIGNMENT(t) __alignof(t)
#elif defined(__GNUC__) #elif defined(__GNUC__)
# define TYPE_ALIGNMENT(t) __alignof__(t) # define TYPE_ALIGNMENT(t) __alignof__(t)
......
...@@ -39,7 +39,7 @@ struct _pthread_cleanup_buffer; ...@@ -39,7 +39,7 @@ struct _pthread_cleanup_buffer;
#endif #endif
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#if HAVE_SYS_SOCKET_H #ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h> # include <sys/socket.h>
#endif #endif
#ifdef HAVE_SYS_MMAN_H #ifdef HAVE_SYS_MMAN_H
......
...@@ -483,7 +483,7 @@ sub output_header { ...@@ -483,7 +483,7 @@ sub output_header {
print OUT " * Windows API extension\n"; print OUT " * Windows API extension\n";
print OUT " */\n"; print OUT " */\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 "# define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field)\n";
print OUT "#elif defined(__GNUC__)\n"; print OUT "#elif defined(__GNUC__)\n";
print OUT "# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field)\n"; print OUT "# define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field)\n";
...@@ -491,7 +491,7 @@ sub output_header { ...@@ -491,7 +491,7 @@ sub output_header {
print OUT "/* FIXME: Not sure if is possible to do without compiler extension */\n"; print OUT "/* FIXME: Not sure if is possible to do without compiler extension */\n";
print OUT "#endif\n"; print OUT "#endif\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 _TYPE_ALIGNMENT(type) __alignof(type)\n"; print OUT "# define _TYPE_ALIGNMENT(type) __alignof(type)\n";
print OUT "#elif defined(__GNUC__)\n"; print OUT "#elif defined(__GNUC__)\n";
print OUT "# define _TYPE_ALIGNMENT(type) __alignof__(type)\n"; print OUT "# define _TYPE_ALIGNMENT(type) __alignof__(type)\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment