From a613de2a22e648c7b0b3a9e97ea74dcef640f24b Mon Sep 17 00:00:00 2001 From: Daniel Marmier Date: Tue, 30 Sep 2003 00:33:47 +0000 Subject: [PATCH] Use #ifdef instead of #if for all feature tests. Check that _MSC_VER is defined before using it. --- dlls/gdi/bidi.c | 2 +- dlls/iphlpapi/ipstats.c | 8 ++++---- dlls/kernel/pthread.c | 2 +- dlls/msvcrt/process.c | 4 ++-- dlls/winsock/async.c | 4 ++-- dlls/winsock/socket.c | 2 +- include/pshpack1.h | 2 +- include/pshpack2.h | 2 +- include/pshpack4.h | 2 +- include/pshpack8.h | 2 +- include/winnt.h | 20 ++++++++++---------- scheduler/pthread.c | 2 +- tools/winapi/winapi_test | 4 ++-- 13 files changed, 28 insertions(+), 28 deletions(-) diff --git a/dlls/gdi/bidi.c b/dlls/gdi/bidi.c index 13e2d59a4c7..33d44dec46d 100644 --- a/dlls/gdi/bidi.c +++ b/dlls/gdi/bidi.c @@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(bidi); -#if HAVE_ICU +#ifdef HAVE_ICU BOOL BidiAvail = TRUE; #else BOOL BidiAvail = FALSE; diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c index 6fec73c4867..4de13a419f6 100644 --- a/dlls/iphlpapi/ipstats.c +++ b/dlls/iphlpapi/ipstats.c @@ -34,16 +34,16 @@ #ifdef HAVE_ARPA_INET_H #include #endif -#if HAVE_NET_IF_H +#ifdef HAVE_NET_IF_H #include #endif -#if HAVE_NET_IF_ARP_H +#ifdef HAVE_NET_IF_ARP_H #include #endif -#if HAVE_NETINET_TCP_H +#ifdef HAVE_NETINET_TCP_H #include #endif -#if HAVE_NETINET_TCP_FSM_H +#ifdef HAVE_NETINET_TCP_FSM_H #include #endif diff --git a/dlls/kernel/pthread.c b/dlls/kernel/pthread.c index ea6759c574b..7fd4754cc11 100644 --- a/dlls/kernel/pthread.c +++ b/dlls/kernel/pthread.c @@ -34,7 +34,7 @@ #endif #include #include -#if HAVE_SYS_SOCKET_H +#ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_MMAN_H diff --git a/dlls/msvcrt/process.c b/dlls/msvcrt/process.c index e592b9ecf73..e18ba74a3dd 100644 --- a/dlls/msvcrt/process.c +++ b/dlls/msvcrt/process.c @@ -153,10 +153,10 @@ static char* msvcrt_valisttos(const char* arg0, va_list alist, char delim) 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; diff --git a/dlls/winsock/async.c b/dlls/winsock/async.c index b58e2cc14f6..dc87e155828 100644 --- a/dlls/winsock/async.c +++ b/dlls/winsock/async.c @@ -400,7 +400,7 @@ static DWORD WINAPI _async_queryfun(LPVOID arg) { 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 @@ static DWORD WINAPI _async_queryfun(LPVOID arg) { size = -size; } } -#if HAVE_LINUX_GETHOSTBYNAME_R_6 +#ifdef HAVE_LINUX_GETHOSTBYNAME_R_6 HeapFree(GetProcessHeap(),0,extrabuf); #else LeaveCriticalSection( &csWSgetXXXbyYYY ); diff --git a/dlls/winsock/socket.c b/dlls/winsock/socket.c index e59bd735b7a..f708d01cb46 100644 --- a/dlls/winsock/socket.c +++ b/dlls/winsock/socket.c @@ -2838,7 +2838,7 @@ static WIN_hostent* __ws_gethostbyaddr(const char *addr, int len, int type, int 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; diff --git a/include/pshpack1.h b/include/pshpack1.h index 60fcfb07349..8fbcf9d5678 100644 --- a/include/pshpack1.h +++ b/include/pshpack1.h @@ -38,7 +38,7 @@ # include # endif -# if _MSC_VER >= 800 +# if defined(_MSC_VER) && (_MSC_VER >= 800) # pragma warning(disable:4103) # endif diff --git a/include/pshpack2.h b/include/pshpack2.h index 9a32ac4a5de..03ff21707f4 100644 --- a/include/pshpack2.h +++ b/include/pshpack2.h @@ -38,7 +38,7 @@ # include # endif -# if _MSC_VER >= 800 +# if defined(_MSC_VER) && (_MSC_VER >= 800) # pragma warning(disable:4103) # endif diff --git a/include/pshpack4.h b/include/pshpack4.h index 10443b189f9..e8b0bd1b6d4 100644 --- a/include/pshpack4.h +++ b/include/pshpack4.h @@ -38,7 +38,7 @@ # include # endif -# if _MSC_VER >= 800 +# if defined(_MSC_VER) && (_MSC_VER >= 800) # pragma warning(disable:4103) # endif diff --git a/include/pshpack8.h b/include/pshpack8.h index f7bb7b2fd4d..443808d6ddf 100644 --- a/include/pshpack8.h +++ b/include/pshpack8.h @@ -38,7 +38,7 @@ # include # endif -# if _MSC_VER >= 800 +# if defined(_MSC_VER) && (_MSC_VER >= 800) # pragma warning(disable:4103) # endif diff --git a/include/winnt.h b/include/winnt.h index 7915d0bf27f..c8da36e8c14 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -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) diff --git a/scheduler/pthread.c b/scheduler/pthread.c index 81c0c0af8d3..72126c09682 100644 --- a/scheduler/pthread.c +++ b/scheduler/pthread.c @@ -39,7 +39,7 @@ struct _pthread_cleanup_buffer; #endif #include #include -#if HAVE_SYS_SOCKET_H +#ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_MMAN_H diff --git a/tools/winapi/winapi_test b/tools/winapi/winapi_test index 6012ef9221d..66938b80bff 100755 --- a/tools/winapi/winapi_test +++ b/tools/winapi/winapi_test @@ -483,7 +483,7 @@ sub output_header { 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 @@ sub output_header { 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"; -- 2.11.4.GIT