Skip to content

Commit 32acd4b

Browse files
committed
windows: Fix compilation with mingw-w64 so it uses correct printf implementations
Without this flag, mingw-w64 uses the MS implementations of snpintf and the likes. This is not really a problem since they work with the the fixes provided for msvc, but due to the way mingw-w64's stdio.h is structured we cannot get it to use the fixes.
1 parent 44a949d commit 32acd4b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

windows/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ INC += -I$(BUILD)
1717
# compiler settings
1818
CFLAGS = $(INC) -Wall -Werror -ansi -std=gnu99 -DUNIX $(CFLAGS_MOD) $(COPT)
1919
LDFLAGS = $(LDFLAGS_MOD) -lm
20+
ifeq ($(CROSS_COMPILE),i686-w64-mingw32-)
21+
CFLAGS += -D__USE_MINGW_ANSI_STDIO=1
22+
endif
2023

2124
# Debugging/Optimization
2225
ifdef DEBUG

0 commit comments

Comments
 (0)