diff --git a/include/basetsd.h b/include/basetsd.h index 8f853a41e8d..409f95816f6 100644 --- a/include/basetsd.h +++ b/include/basetsd.h @@ -59,7 +59,7 @@ extern "C" { # define __int32 int # endif # ifndef __int64 -# ifdef _WIN64 +# if defined(_WIN64) && !defined(__MINGW64__) # define __int64 long # else # define __int64 long long diff --git a/include/msvcrt/direct.h b/include/msvcrt/direct.h index b0c4af816ca..d71aee0b632 100644 --- a/include/msvcrt/direct.h +++ b/include/msvcrt/direct.h @@ -29,7 +29,7 @@ typedef unsigned short wchar_t; #endif #if !defined(_MSC_VER) && !defined(__int64) -# ifdef _WIN64 +# if defined(_WIN64) && !defined(__MINGW64__) # define __int64 long # else # define __int64 long long diff --git a/include/msvcrt/io.h b/include/msvcrt/io.h index 6009fe9d8a9..ef4a312d271 100644 --- a/include/msvcrt/io.h +++ b/include/msvcrt/io.h @@ -25,7 +25,7 @@ typedef unsigned short wchar_t; #endif #if !defined(_MSC_VER) && !defined(__int64) -# ifdef _WIN64 +# if defined(_WIN64) && !defined(__MINGW64__) # define __int64 long # else # define __int64 long long diff --git a/include/msvcrt/malloc.h b/include/msvcrt/malloc.h index bee2173eb69..b71c4fd2b80 100644 --- a/include/msvcrt/malloc.h +++ b/include/msvcrt/malloc.h @@ -39,7 +39,7 @@ #endif #if !defined(_MSC_VER) && !defined(__int64) -# ifdef _WIN64 +# if defined(_WIN64) && !defined(__MINGW64__) # define __int64 long # else # define __int64 long long diff --git a/include/msvcrt/mbstring.h b/include/msvcrt/mbstring.h index 124d215c0b0..a9c38cf4f51 100644 --- a/include/msvcrt/mbstring.h +++ b/include/msvcrt/mbstring.h @@ -30,7 +30,7 @@ #endif #if !defined(_MSC_VER) && !defined(__int64) -# ifdef _WIN64 +# if defined(_WIN64) && !defined(__MINGW64__) # define __int64 long # else # define __int64 long long diff --git a/include/msvcrt/memory.h b/include/msvcrt/memory.h index a5217df85ea..e2f5a37bdda 100644 --- a/include/msvcrt/memory.h +++ b/include/msvcrt/memory.h @@ -16,7 +16,7 @@ #endif #if !defined(_MSC_VER) && !defined(__int64) -# ifdef _WIN64 +# if defined(_WIN64) && !defined(__MINGW64__) # define __int64 long # else # define __int64 long long diff --git a/include/msvcrt/search.h b/include/msvcrt/search.h index af648d58ac7..ff5bf80a559 100644 --- a/include/msvcrt/search.h +++ b/include/msvcrt/search.h @@ -28,7 +28,7 @@ #endif #if !defined(_MSC_VER) && !defined(__int64) -# ifdef _WIN64 +# if defined(_WIN64) && !defined(__MINGW64__) # define __int64 long # else # define __int64 long long diff --git a/include/msvcrt/stddef.h b/include/msvcrt/stddef.h index eb45c87da7d..d0fe7de3ef2 100644 --- a/include/msvcrt/stddef.h +++ b/include/msvcrt/stddef.h @@ -28,7 +28,7 @@ #endif #if !defined(_MSC_VER) && !defined(__int64) -# ifdef _WIN64 +# if defined(_WIN64) && !defined(__MINGW64__) # define __int64 long # else # define __int64 long long diff --git a/include/msvcrt/stdio.h b/include/msvcrt/stdio.h index b1776646211..55d944419d1 100644 --- a/include/msvcrt/stdio.h +++ b/include/msvcrt/stdio.h @@ -22,7 +22,7 @@ #endif #if !defined(_MSC_VER) && !defined(__int64) -# ifdef _WIN64 +# if defined(_WIN64) && !defined(__MINGW64__) # define __int64 long # else # define __int64 long long diff --git a/include/msvcrt/stdlib.h b/include/msvcrt/stdlib.h index ddaae617f50..0010c3310fe 100644 --- a/include/msvcrt/stdlib.h +++ b/include/msvcrt/stdlib.h @@ -49,7 +49,7 @@ typedef struct #endif #if !defined(_MSC_VER) && !defined(__int64) -# ifdef _WIN64 +# if defined(_WIN64) && !defined(__MINGW64__) # define __int64 long # else # define __int64 long long diff --git a/include/msvcrt/string.h b/include/msvcrt/string.h index a963553312b..d70cd23947e 100644 --- a/include/msvcrt/string.h +++ b/include/msvcrt/string.h @@ -23,7 +23,7 @@ typedef unsigned short wchar_t; #endif #if !defined(_MSC_VER) && !defined(__int64) -# ifdef _WIN64 +# if defined(_WIN64) && !defined(__MINGW64__) # define __int64 long # else # define __int64 long long diff --git a/include/msvcrt/sys/types.h b/include/msvcrt/sys/types.h index 663ad629b66..dac8d64c984 100644 --- a/include/msvcrt/sys/types.h +++ b/include/msvcrt/sys/types.h @@ -28,7 +28,7 @@ #endif #if !defined(_MSC_VER) && !defined(__int64) -# ifdef _WIN64 +# if defined(_WIN64) && !defined(__MINGW64__) # define __int64 long # else # define __int64 long long diff --git a/include/msvcrt/time.h b/include/msvcrt/time.h index deb17e1439d..9b9a5164f30 100644 --- a/include/msvcrt/time.h +++ b/include/msvcrt/time.h @@ -37,7 +37,7 @@ typedef unsigned short wchar_t; #endif #if !defined(_MSC_VER) && !defined(__int64) -# ifdef _WIN64 +# if defined(_WIN64) && !defined(__MINGW64__) # define __int64 long # else # define __int64 long long diff --git a/include/msvcrt/wchar.h b/include/msvcrt/wchar.h index 611b738d832..4e4892ff1a7 100644 --- a/include/msvcrt/wchar.h +++ b/include/msvcrt/wchar.h @@ -42,7 +42,7 @@ typedef unsigned short wchar_t; #endif #if !defined(_MSC_VER) && !defined(__int64) -# ifdef _WIN64 +# if defined(_WIN64) && !defined(__MINGW64__) # define __int64 long # else # define __int64 long long diff --git a/include/windef.h b/include/windef.h index 8c0a0bb3eab..3c9de7a9137 100644 --- a/include/windef.h +++ b/include/windef.h @@ -37,18 +37,19 @@ extern "C" { /* Calling conventions definitions */ -#if defined(__i386__) && !defined(_X86_) -# define _X86_ -#endif - -#if defined(_X86_) && !defined(__i386__) -# define __i386__ -#endif - #if defined(__x86_64__) && !defined(_WIN64) #define _WIN64 #endif +#ifndef _WIN64 +# if defined(__i386__) && !defined(_X86_) +# define _X86_ +# endif +# if defined(_X86_) && !defined(__i386__) +# define __i386__ +# endif +#endif + #ifndef __stdcall # ifdef __i386__ # ifdef __GNUC__