diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2013-06-10 12:38:52 +0200 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2013-06-10 14:03:33 +0200 |
commit | 9a33bfdacd9f74aefad545141c896a8bc23c1ffc (patch) | |
tree | 252e3738f7ceb975a7867eeeee99cb48e91f9a35 /include/sal/types.h | |
parent | f8df80b489971021c49e85d66f110304bec4dd88 (diff) |
mingw64: force C99 formating strings for consistency
Change-Id: I1399596a3edc3324ae4aa04e3866ae2f5e673985
Diffstat (limited to 'include/sal/types.h')
-rw-r--r-- | include/sal/types.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/include/sal/types.h b/include/sal/types.h index 55f2e729ac8b..070a3f29474a 100644 --- a/include/sal/types.h +++ b/include/sal/types.h @@ -29,6 +29,15 @@ extern "C" { #endif +#if defined ( __MINGW32__ ) && !defined ( __USE_MINGW_ANSI_STDIO ) +/* Define to use the C99 formating string for coherence reasons. + * In mingw-w64 some functions are ported to the ms formating string + * some are not yet. This is the only way to make the formatting + * strings work all the time + */ +#define __USE_MINGW_ANSI_STDIO 1 +#endif + /********************************************************************************/ /* Data types */ @@ -101,17 +110,10 @@ typedef unsigned char sal_uInt8; #define SAL_CONST_INT64(x) x##ll #define SAL_CONST_UINT64(x) x##ull - #ifdef __MINGW32__ - #define SAL_PRIdINT64 "I64d" - #define SAL_PRIuUINT64 "I64u" - #define SAL_PRIxUINT64 "I64x" - #define SAL_PRIXUINT64 "I64X" - #else #define SAL_PRIdINT64 "lld" #define SAL_PRIuUINT64 "llu" #define SAL_PRIxUINT64 "llx" #define SAL_PRIXUINT64 "llX" - #endif #else #error "Could not find 64-bit type, add support for your architecture" #endif @@ -158,7 +160,7 @@ typedef void * sal_Handle; /* printf-style conversion specification length modifiers for size_t and ptrdiff_t (most platforms support C99, MSC has its own extension) */ -#if defined(_MSC_VER) || defined(__MINGW32__) +#if defined(_MSC_VER) #define SAL_PRI_SIZET "I" #define SAL_PRI_PTRDIFFT "I" #else |