Skip to content

Commit 34706c3

Browse files
zhiguangwangrparolin
authored andcommitted
Fix C99 inttypes.h macro redefinition warnings with VS2013 and above (#81)
* Fix C99 inttypes.h macro redefinition warnings when compiling with VS2013 and above. * Restrict the compiler version checks to MSVC, as requested.
1 parent 9dfa6a2 commit 34706c3

File tree

1 file changed

+3
-3
lines changed
  • test/packages/EABase/include/Common/EABase

1 file changed

+3
-3
lines changed

test/packages/EABase/include/Common/EABase/eabase.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@
114114
#define __STDC_FORMAT_MACROS
115115
#endif
116116
// The GCC PSP compiler defines standard int types (e.g. uint32_t) but not PRId8, etc.
117-
// MSVC doesn't include an inttypes.h header.
118-
#if !defined(EA_COMPILER_MSVC)
117+
// MSVC added support for inttypes.h header in VS2013.
118+
#if !defined(EA_COMPILER_MSVC) || (defined(EA_COMPILER_MSVC) && EA_COMPILER_VERSION >= 1800)
119119
#include <inttypes.h> // PRId8, SCNd8, etc.
120120
#endif
121121
#if defined(_MSC_VER)
@@ -355,7 +355,7 @@
355355
typedef double double_t;
356356
#endif
357357

358-
#if defined(EA_COMPILER_HAS_INTTYPES) && !defined(EA_COMPILER_MSVC)
358+
#if defined(EA_COMPILER_HAS_INTTYPES) && (!defined(EA_COMPILER_MSVC) || (defined(EA_COMPILER_MSVC) && EA_COMPILER_VERSION >= 1800))
359359
#define EA_COMPILER_HAS_C99_FORMAT_MACROS
360360
#endif
361361

0 commit comments

Comments
 (0)