Skip to content

Commit acf6f7c

Browse files
ocornutAjblast
authored andcommitted
Demo: amend/fix for MinGW
Amend 4d6fbaf.
1 parent c8d9afa commit acf6f7c

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

imgui_demo.cpp

+10-7
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,8 @@ Index of this file:
9494
#include <stdio.h> // vsnprintf, sscanf, printf
9595
#include <stdlib.h> // NULL, malloc, free, atoi
9696
#include <stdint.h> // intptr_t
97-
98-
// Format specifiers for 64-bit values (hasn't been decently standardized since VS2013)
9997
#if !defined(_MSC_VER) || _MSC_VER >= 1800
100-
#include <inttypes.h>
101-
#elif !defined(PRId64)
102-
#define PRId64 "I64d"
103-
#define PRIu64 "I64u"
104-
#define PRIX64 "I64X"
98+
#include <inttypes.h> // PRId64/PRIu64, not avail in some MinGW headers.
10599
#endif
106100

107101
// Visual Studio warnings
@@ -151,6 +145,15 @@ Index of this file:
151145
#define vsnprintf _vsnprintf
152146
#endif
153147

148+
// Format specifiers for 64-bit values (hasn't been decently standardized before VS2013)
149+
#if !defined(PRId64) && defined(_MSC_VER)
150+
#define PRId64 "I64d"
151+
#define PRIu64 "I64u"
152+
#elif !defined(PRId64)
153+
#define PRId64 "lld"
154+
#define PRIu64 "llu"
155+
#endif
156+
154157
// Helpers macros
155158
// We normally try to not use many helpers in imgui_demo.cpp in order to make code easier to copy and paste,
156159
// but making an exception here as those are largely simplifying code...

0 commit comments

Comments
 (0)