Alexandre Julliard : configure: Always define _WIN32 for msvcrt builds.
Alexandre Julliard
julliard at winehq.org
Thu Oct 14 15:09:33 CDT 2021
Module: wine
Branch: master
Commit: f7e1b0f9b76778d535ada846474a5638e15a6f3e
URL: https://source.winehq.org/git/wine.git/?a=commit;h=f7e1b0f9b76778d535ada846474a5638e15a6f3e
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu Oct 14 11:08:54 2021 +0200
configure: Always define _WIN32 for msvcrt builds.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
configure | 3 ++-
configure.ac | 3 ++-
include/msvcrt/corecrt.h | 12 ++++++++++--
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/configure b/configure
index 56c78fc6295..d1edbdc684a 100755
--- a/configure
+++ b/configure
@@ -17613,7 +17613,8 @@ if test "x$ac_cv_cflags__Wl__delayload_autoconftest_dll" = xyes; then :
DELAYLOADFLAG="-Wl,-delayload,"
fi ;;
- *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-builtin" >&5
+ *) MSVCRTFLAGS="-D_WIN32"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-builtin" >&5
$as_echo_n "checking whether the compiler supports -fno-builtin... " >&6; }
if ${ac_cv_cflags__fno_builtin+:} false; then :
$as_echo_n "(cached) " >&6
diff --git a/configure.ac b/configure.ac
index af1cf7303ba..da6ecf5a7a8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2045,7 +2045,8 @@ char*f(const char *h,char n) {return strchr(h,n);}]])],[ac_cv_c_logicalop_noisy=
case $host_os in
mingw32*) dnl Check for delayload linker support
WINE_TRY_CFLAGS([-Wl,-delayload,autoconftest.dll],[AC_SUBST(DELAYLOADFLAG,["-Wl,-delayload,"])]) ;;
- *) WINE_TRY_CFLAGS([-fno-builtin],[MSVCRTFLAGS="$MSVCRTFLAGS -fno-builtin"])
+ *) MSVCRTFLAGS="-D_WIN32"
+ WINE_TRY_CFLAGS([-fno-builtin],[MSVCRTFLAGS="$MSVCRTFLAGS -fno-builtin"])
WINE_TRY_CFLAGS([-fshort-wchar],[MSVCRTFLAGS="$MSVCRTFLAGS -fshort-wchar"]) ;;
esac
diff --git a/include/msvcrt/corecrt.h b/include/msvcrt/corecrt.h
index a02feb509e8..8f407bdb20c 100644
--- a/include/msvcrt/corecrt.h
+++ b/include/msvcrt/corecrt.h
@@ -25,8 +25,16 @@
#define __WINE_USE_MSVCRT
#endif
-#ifdef __WINE_WINE_PORT_H
-# error You cannot use both wine/port.h and msvcrt headers
+#ifdef __WINE_CONFIG_H
+# error You cannot use config.h with msvcrt
+#endif
+
+#ifndef _WIN32
+# define _WIN32
+#endif
+
+#ifndef WIN32
+# define WIN32
#endif
#if (defined(__x86_64__) || defined(__powerpc64__) || defined(__aarch64__)) && !defined(_WIN64)
More information about the wine-cvs
mailing list