]> granicus.if.org Git - icu/commitdiff
ICU-22191 writesrc.cpp: enable PRI formatting constants on all compilers
authorMarkus Scherer <markus.icu@gmail.com>
Mon, 7 Nov 2022 18:34:44 +0000 (10:34 -0800)
committerMarkus Scherer <markus.icu@gmail.com>
Wed, 9 Nov 2022 04:38:00 +0000 (04:38 +0000)
icu4c/source/tools/toolutil/writesrc.cpp

index 4675a653b32c1c68ca7732962a2769e551b755d0..20ad74aa8b25501c54c95116896eaa3cb57d04e8 100644 (file)
 
 #include <stdio.h>
 #include <time.h>
+
+// The C99 standard suggested that C++ implementations not define PRId64 etc. constants
+// unless this macro is defined.
+// See the Notes at https://en.cppreference.com/w/cpp/types/integer .
+// Similar to defining __STDC_LIMIT_MACROS in unicode/ptypes.h .
+#ifndef __STDC_FORMAT_MACROS
+#   define __STDC_FORMAT_MACROS
+#endif
 #include <cinttypes>
+
 #include "unicode/utypes.h"
 #include "unicode/putil.h"
 #include "unicode/ucptrie.h"