Skip to content

Commit

Permalink
Demo: amend/fix for MinGW
Browse files Browse the repository at this point in the history
Amend 4d6fbaf.
  • Loading branch information
ocornut committed Aug 7, 2023
1 parent 4d6fbaf commit edebb90
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions imgui_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,8 @@ Index of this file:
#include <stdio.h> // vsnprintf, sscanf, printf
#include <stdlib.h> // NULL, malloc, free, atoi
#include <stdint.h> // intptr_t

// Format specifiers for 64-bit values (hasn't been decently standardized since VS2013)
#if !defined(_MSC_VER) || _MSC_VER >= 1800
#include <inttypes.h>
#elif !defined(PRId64)
#define PRId64 "I64d"
#define PRIu64 "I64u"
#define PRIX64 "I64X"
#include <inttypes.h> // PRId64/PRIu64, not avail in some MinGW headers.
#endif

// Visual Studio warnings
Expand Down Expand Up @@ -151,6 +145,15 @@ Index of this file:
#define vsnprintf _vsnprintf
#endif

// Format specifiers for 64-bit values (hasn't been decently standardized before VS2013)
#if !defined(PRId64) && defined(_MSC_VER)
#define PRId64 "I64d"
#define PRIu64 "I64u"
#elif !defined(PRId64)
#define PRId64 "lld"
#define PRIu64 "llu"
#endif

// Helpers macros
// We normally try to not use many helpers in imgui_demo.cpp in order to make code easier to copy and paste,
// but making an exception here as those are largely simplifying code...
Expand Down

0 comments on commit edebb90

Please sign in to comment.