Skip to content

Commit

Permalink
rtlib: printf format specifier
Browse files Browse the repository at this point in the history
- use 'll' instead of 'I64' if building for ucrt or
  mingw-w64's stdio implementation (for newer gcc
  versions and c std)
  • Loading branch information
jayrm committed Jul 21, 2023
1 parent b9da161 commit 9352b6e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.txt
@@ -1,6 +1,7 @@
Version 1.10.1

[changed]
- rtlib: printf format specifier, use 'll' instead of 'I64' if building for ucrt or mingw-w64's stdio implementation (for newer gcc versions and c std)

[added]

Expand Down
11 changes: 9 additions & 2 deletions src/rtlib/win32/fb_win32.h
Expand Up @@ -37,9 +37,16 @@
#define FB_BINARY_NEWLINE_WSTR _LC("\r\n")

#ifdef HOST_CYGWIN
#define FB_LL_FMTMOD "ll"
#define FB_LL_FMTMOD "ll"
#else
#define FB_LL_FMTMOD "I64"
/* ucrt and mingw-w64's implementation of printf format specifers
require that long long use the 'll' specifier instead of 'I64'
*/
#if defined(_UCRT) || __USE_MINGW_ANSI_STDIO
#define FB_LL_FMTMOD "ll"
#else
#define FB_LL_FMTMOD "I64"
#endif
#endif

#define FB_CONSOLE_MAXPAGES 4
Expand Down

0 comments on commit 9352b6e

Please sign in to comment.