aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2023-09-24 16:32:32 +0300
committerJia Tan <jiat0218@gmail.com>2023-10-31 18:44:59 +0800
commit4ae13cfe0dedb8ddc3cf9ded8cd1ac09361b3bd1 (patch)
tree3007a0101f4cc8d8374fa8b3b370a99cae4720a0 /src/common
parentxz: Windows: Don't (de)compress to special files like "con" or "nul". (diff)
downloadxz-4ae13cfe0dedb8ddc3cf9ded8cd1ac09361b3bd1.tar.xz
sysdefs.h: Update the comment about __USE_MINGW_ANSI_STDIO.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/sysdefs.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/common/sysdefs.h b/src/common/sysdefs.h
index 97be4ee3..f04e45dd 100644
--- a/src/common/sysdefs.h
+++ b/src/common/sysdefs.h
@@ -24,7 +24,15 @@
# include <config.h>
#endif
-// Get standard-compliant stdio functions under MinGW and MinGW-w64.
+// This #define ensures that C99 and POSIX compliant stdio functions are
+// available with MinGW-w64 (both 32-bit and 64-bit). Modern MinGW-w64 adds
+// this automatically, for example, when the compiler is in C99 (or later)
+// mode when building against msvcrt.dll. It still doesn't hurt to be explicit
+// that we always want this and #define this unconditionally.
+//
+// With Universal CRT (UCRT) this is less important because UCRT contains
+// C99-compatible stdio functions. It's still nice to #define this as UCRT
+// doesn't support the POSIX thousand separator flag in printf (like "%'u").
#ifdef __MINGW32__
# define __USE_MINGW_ANSI_STDIO 1
#endif