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 @@
WINE_DEFAULT_DEBUG_CHANNEL(bidi);
#if HAVE_ICU
#ifdef HAVE_ICU
BOOL BidiAvail = TRUE;
#else
BOOL BidiAvail = FALSE;
......
......@@ -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
......
......@@ -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
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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;
......
......@@ -38,7 +38,7 @@
# include <poppack.h>
# endif
# if _MSC_VER >= 800
# if defined(_MSC_VER) && (_MSC_VER >= 800)
# pragma warning(disable:4103)
# endif
......
......@@ -38,7 +38,7 @@
# include <poppack.h>
# endif
# if _MSC_VER >= 800
# if defined(_MSC_VER) && (_MSC_VER >= 800)
# pragma warning(disable:4103)
# endif
......
......@@ -38,7 +38,7 @@
# include <poppack.h>
# endif
# if _MSC_VER >= 800
# if defined(_MSC_VER) && (_MSC_VER >= 800)
# pragma warning(disable:4103)
# endif
......
......@@ -38,7 +38,7 @@
# include <poppack.h>
# endif
# if _MSC_VER >= 800
# if defined(_MSC_VER) && (_MSC_VER >= 800)
# pragma warning(disable:4103)
# endif
......
......@@ -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)
......
......@@ -39,7 +39,7 @@ struct _pthread_cleanup_buffer;
#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
......
......@@ -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";
......
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