configure: Define _WIN64 when building on a 64-bit platform.
diff --git a/configure b/configure
index ece71b4..6c25767 100755
--- a/configure
+++ b/configure
@@ -24167,6 +24167,37 @@
CFLAGS="$CFLAGS -D__x86_64__"
LINTFLAGS="$LINTFLAGS -D__x86_64__"
fi
+
+ { echo "$as_me:$LINENO: checking whether we need to define _WIN64" >&5
+echo $ECHO_N "checking whether we need to define _WIN64... $ECHO_C" >&6; }
+if test "${ac_cv_cpp_def__WIN64+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifndef _WIN64
+yes
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then
+ ac_cv_cpp_def__WIN64=yes
+else
+ ac_cv_cpp_def__WIN64=no
+fi
+rm -f conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_cpp_def__WIN64" >&5
+echo "${ECHO_T}$ac_cv_cpp_def__WIN64" >&6; }
+if test $ac_cv_cpp_def__WIN64 = yes; then
+ CFLAGS="$CFLAGS -D_WIN64"
+ LINTFLAGS="$LINTFLAGS -D_WIN64"
+fi
;;
*alpha*) { echo "$as_me:$LINENO: checking whether we need to define __ALPHA__" >&5
echo $ECHO_N "checking whether we need to define __ALPHA__... $ECHO_C" >&6; }
diff --git a/configure.ac b/configure.ac
index 3c55d8c..85e3c20 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1502,7 +1502,8 @@
case $host_cpu in
*i[[3456789]]86*) WINE_CHECK_DEFINE([__i386__]) ;;
- *x86_64*) WINE_CHECK_DEFINE([__x86_64__]) ;;
+ *x86_64*) WINE_CHECK_DEFINE([__x86_64__])
+ WINE_CHECK_DEFINE([_WIN64]) ;;
*alpha*) WINE_CHECK_DEFINE([__ALPHA__]) ;;
*sparc*) WINE_CHECK_DEFINE([__sparc__]) ;;
*powerpc*) WINE_CHECK_DEFINE([__powerpc__]) ;;
diff --git a/include/basetsd.h b/include/basetsd.h
index 292483a..444e876 100644
--- a/include/basetsd.h
+++ b/include/basetsd.h
@@ -38,7 +38,7 @@
* type model where int and long are 32 bit and pointer is 64-bit.
*/
-#ifdef __x86_64__
+#if defined(__x86_64__) && !defined(_WIN64)
#define _WIN64
#endif
diff --git a/include/windef.h b/include/windef.h
index 2908cfc..d9c0331 100644
--- a/include/windef.h
+++ b/include/windef.h
@@ -45,7 +45,7 @@
# define __i386__
#endif
-#ifdef __x86_64__
+#if defined(__x86_64__) && !defined(_WIN64)
#define _WIN64
#endif
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index 2cc73ca..07d0ac1 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -269,10 +269,17 @@
strarray_addall(comp_args, strarray_fromstring(DLLFLAGS, " "));
}
+#ifdef _WIN64
+ strarray_add(comp_args, "-DWIN64");
+ strarray_add(comp_args, "-D_WIN64");
+ strarray_add(comp_args, "-D__WIN64");
+ strarray_add(comp_args, "-D__WIN64__");
+#else
strarray_add(comp_args, "-DWIN32");
strarray_add(comp_args, "-D_WIN32");
strarray_add(comp_args, "-D__WIN32");
strarray_add(comp_args, "-D__WIN32__");
+#endif
strarray_add(comp_args, "-D__WINNT");
strarray_add(comp_args, "-D__WINNT__");