Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use -D__USE_MINGW_ANSI_STDIO=0 to opt out of C99 printf emulation on MinGW-W64 10.0+ #333

Merged
merged 1 commit into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
Entries may not always be in chronological/commit order.
See license at the end of file. */

2023-11-11 19:42 UTC+0100 Phil Krylov (phil a t krylov.eu)
* config/win/mingw.mk
* utils/hbmk2/hbmk2.prg
! Use -D__USE_MINGW_ANSI_STDIO=0 to opt out of C99 printf emulation on
MinGW-W64 10.0+.

2023-11-11 18:38 UTC+0100 Phil Krylov (phil a t krylov.eu)
* include/hbwinuni.h
* src/vm/maindllp/dllpcode.c
Expand Down
7 changes: 7 additions & 0 deletions config/win/mingw.mk
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ ifeq ($(HB_BUILD_DEBUG),yes)
CFLAGS += -g
endif

ifeq ($(HB_COMPILER),mingw64)
# Newer MinGW-W64 versions (10+, IIRC) need this to opt out of C99 format
# string emulation and keep our format strings compatible among the
# different Windows compilers
CFLAGS += -D__USE_MINGW_ANSI_STDIO=0
endif

RC := $(HB_CCPATH)$(HB_CCPREFIX)windres
RC_OUT := -o$(subst x,x, )
RCFLAGS += -I. -I$(HB_HOST_INC) -O coff
Expand Down
8 changes: 8 additions & 0 deletions utils/hbmk2/hbmk2.prg
Original file line number Diff line number Diff line change
Expand Up @@ -4385,6 +4385,14 @@ STATIC FUNCTION __hbmk( aArgs, nArgTarget, nLevel, /* @ */ lPause, /* @ */ lExit
EXIT
CASE _WARN_NO ; AAdd( hbmk[ _HBMK_aOPTC ], "-w" ) ; EXIT
ENDSWITCH

IF hbmk[ _HBMK_cCOMP ] == "mingw64"
// Newer MinGW-W64 versions (10+, IIRC) need this to opt out of C99 format
// string emulation and keep our format strings compatible among the
// different Windows compilers
cOpt_CompC += " -D__USE_MINGW_ANSI_STDIO=0"
ENDIF

IF hbmk[ _HBMK_lHARDEN ]
IF hbmk[ _HBMK_cPLAT ] == "win"
/* It is also supported by official mingw 4.4.x and mingw64 4.4.x,
Expand Down
Loading