From a7f965ccb8e3683f6bae18049f9f05f8f07863a3 Mon Sep 17 00:00:00 2001 From: kgv Date: Fri, 16 Feb 2018 17:29:17 +0300 Subject: [PATCH] Compatibility with obsolete MSVC compilers - added PRId64 macros --- src/Standard/Standard_TypeDef.hxx | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/Standard/Standard_TypeDef.hxx b/src/Standard/Standard_TypeDef.hxx index d8fbdf73c8..6216e25fd6 100755 --- a/src/Standard/Standard_TypeDef.hxx +++ b/src/Standard/Standard_TypeDef.hxx @@ -17,11 +17,30 @@ #include #include -#include + +// VC9 does not have stdint.h +#if(defined(_MSC_VER) && (_MSC_VER < 1600)) + // old MSVC - hasn't stdint header + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int64 uint64_t; + + typedef __int8 int8_t; + typedef __int16 int16_t; + typedef __int32 int32_t; + typedef __int64 int64_t; +#else + #include +#endif #if(defined(_MSC_VER) && (_MSC_VER < 1800)) // only Visual Studio 2013 (vc12) provides header // we do not defined all macros here - only used by OCCT framework + #define PRId64 "I64d" + #define PRIu64 "I64u" + #define SCNd64 "I64d" + #define SCNu64 "I64u" #ifdef _WIN64 #define PRIdPTR "I64d" #define PRIuPTR "I64u" @@ -60,8 +79,8 @@ typedef std::time_t Standard_Time; // Unicode primitives, char16_t, char32_t typedef char Standard_Utf8Char; //!< signed UTF-8 char typedef unsigned char Standard_Utf8UChar; //!< unsigned UTF-8 char -#if (defined(__GNUC__) && !defined(__clang__) && ((__GNUC__ == 4 && __GNUC_MINOR__ <= 3) || __GNUC__ < 4)) -// compatibility with old GCC compilers +#if ((defined(__GNUC__) && !defined(__clang__) && ((__GNUC__ == 4 && __GNUC_MINOR__ <= 3) || __GNUC__ < 4)) || (defined(_MSC_VER) && (_MSC_VER < 1600))) +// compatibility with old GCC and MSVC compilers typedef uint16_t Standard_ExtCharacter; typedef uint16_t Standard_Utf16Char; typedef uint32_t Standard_Utf32Char; -- 2.39.5