From dd07a525a6caa0d2849688c7dcafa18d2a7de3fe Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Wed, 12 Oct 2011 04:47:23 +0000 Subject: [PATCH] Added support for stdint.h being available in DevStudio 2010 (Thanks to Ketil Wright for bringing this to our attention) --- msvc/include/exv_msvc.h | 5 +++++ msvc64/include/exv_msvc.h | 5 +++++ src/types.hpp | 17 ++++++++--------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/msvc/include/exv_msvc.h b/msvc/include/exv_msvc.h index 9ca2abcb..224bdd69 100644 --- a/msvc/include/exv_msvc.h +++ b/msvc/include/exv_msvc.h @@ -13,6 +13,11 @@ #ifdef _MSC_VER +#if _MSC_VER >= 1400 +// stdint.h was introduced with DevStudio 2010 +#define EXV_HAVE_STDINT_H 1 +#endif + /* Define to 1 if you have the header file. */ #define EXV_HAVE_PROCESS_H 1 diff --git a/msvc64/include/exv_msvc.h b/msvc64/include/exv_msvc.h index ef0897e6..f7bf72ea 100644 --- a/msvc64/include/exv_msvc.h +++ b/msvc64/include/exv_msvc.h @@ -13,6 +13,11 @@ #ifdef _MSC_VER +#if _MSC_VER >= 1400 +// stdint.h was introduced with DevStudio 2010 +#define EXV_HAVE_STDINT_H 1 +#endif + /* Define to 1 if you have the header file. */ #define EXV_HAVE_PROCESS_H 1 diff --git a/src/types.hpp b/src/types.hpp index 0ed6ca5e..9e2d1695 100644 --- a/src/types.hpp +++ b/src/types.hpp @@ -48,17 +48,11 @@ #include #include #include + #ifdef EXV_HAVE_STDINT_H # include -#endif - -// MSVC macro to convert a string to a wide string -#ifdef EXV_UNICODE_PATH -# define EXV_WIDEN(t) L ## t -#endif - -// MSVC doesn't provide C99 types, but it has MS specific variants -#ifdef _MSC_VER +#elif defined(_MSC_VER) +// MSVC (before 2010) doesn't provide C99 types, but it has MS specific variants typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; @@ -69,6 +63,11 @@ typedef __int32 int32_t; typedef __int64 int64_t; #endif +// MSVC macro to convert a string to a wide string +#ifdef EXV_UNICODE_PATH +# define EXV_WIDEN(t) L ## t +#endif + /*! @brief Macro to make calls to member functions through a pointer more readable. See the C++ FAQ LITE, item