From bdf01c368ddf4cc85f54da2b68f5902a9ee6118c Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 22 Sep 2005 10:58:04 +0000 Subject: [PATCH] Define data types to the correct size on 64-bit platforms. --- include/basetsd.h | 10 +++++++++- include/windef.h | 14 ++++++++++++-- include/winnt.h | 4 ++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/include/basetsd.h b/include/basetsd.h index d9db9b8a8f1..26b4436748e 100644 --- a/include/basetsd.h +++ b/include/basetsd.h @@ -38,6 +38,10 @@ extern "C" { * type model where int and long are 32 bit and pointer is 64-bit. */ +#ifdef __x86_64__ +#define _WIN64 +#endif + /* Type model independent typedefs */ /* The __intXX types are native types defined by the MS C compiler. * Apps that make use of them before they get defined here, can @@ -55,7 +59,11 @@ extern "C" { # define __int32 int # endif # ifndef __int64 -# define __int64 long long +# ifdef _WIN64 +# define __int64 long +# else +# define __int64 long long +# endif # endif #endif /* !defined(_MSC_VER) */ diff --git a/include/windef.h b/include/windef.h index ef6e7ef19ba..5a8fa100c37 100644 --- a/include/windef.h +++ b/include/windef.h @@ -41,6 +41,10 @@ extern "C" { # define _X86_ #endif +#ifdef __x86_64__ +#define _WIN64 +#endif + #ifndef __stdcall # ifdef __i386__ # ifdef __GNUC__ @@ -174,11 +178,17 @@ typedef unsigned short WORD, *PWORD, *LPWORD; typedef unsigned short USHORT, *PUSHORT; typedef int INT, *PINT, *LPINT; typedef unsigned int UINT, *PUINT; +typedef float FLOAT, *PFLOAT; +typedef char *PSZ; +#if defined(_WIN64) && !defined(_MSC_VER) +typedef int *LPLONG; +typedef unsigned int DWORD, *PDWORD, *LPDWORD; +typedef unsigned int ULONG, *PULONG; +#else typedef long *LPLONG; typedef unsigned long DWORD, *PDWORD, *LPDWORD; typedef unsigned long ULONG, *PULONG; -typedef float FLOAT, *PFLOAT; -typedef char *PSZ; +#endif /* Macros to map Winelib names to the correct implementation name */ /* Note that Winelib is purely Win32. */ diff --git a/include/winnt.h b/include/winnt.h index 183486953be..f59cb884de6 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -300,7 +300,11 @@ typedef VOID *PVOID64; typedef BYTE BOOLEAN, *PBOOLEAN; typedef char CHAR, *PCHAR; typedef short SHORT, *PSHORT; +#if defined(_WIN64) && !defined(_MSC_VER) +typedef int LONG, *PLONG; +#else typedef long LONG, *PLONG; +#endif /* Some systems might have wchar_t, but we really need 16 bit characters */ #ifdef WINE_UNICODE_NATIVE