[PATCH vkd3d] Makefile: Explicitly avoid ANSI stdio modifiers when cross compiling.

Giovanni Mascellani gmascellani at codeweavers.com
Mon Jan 24 05:02:26 CST 2022


Crosstests are compiled with MinGW and linked against msvcrt, which
doesn't necessarily support ANSI stdio format modifiers like "ll".
Still, MinGW headers default to emit "ll" for format macros like
PRIu64, which is wrong and triggers a lot of warnings in recent enough
versions of GCC.

Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
---
I am not completely sure that the explanation is correct and the solution
is the best possible, but, at least in my setup, no warnings are emitted
and I64 is generated (which is probably the most compatible choice when
linking against msvcrt), so I believe the result is correct.

Provided that my explanation is correct, I'd wish to directly solve the
problem in MinGW headers, but at this point I am still too confused by
the GCC/MinGW ecosystem to understand what is to be done.
---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index a3ec6850..4c1911bb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -386,7 +386,7 @@ dummy-vkd3d-version:
 ## Cross-compile tests
 cross_implibs = crosslibs/d3d12
 CROSS_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/include/private -I$(builddir)/include
-CROSS_CFLAGS = -g -O2 -Wall -municode ${CROSS_CPPFLAGS}
+CROSS_CFLAGS = -g -O2 -Wall -municode ${CROSS_CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=0
 EXTRA_DIST += $(cross_implibs:=.cross32.def) $(cross_implibs:=.cross64.def)
 
 if HAVE_CROSSTARGET32
-- 
2.34.1




More information about the wine-devel mailing list