diff --git a/include/exiv2/types.hpp b/include/exiv2/types.hpp index e7009f3c..00c225b5 100644 --- a/include/exiv2/types.hpp +++ b/include/exiv2/types.hpp @@ -33,7 +33,6 @@ // included header files #include "config.h" - #include "version.hpp" // + standard includes @@ -45,26 +44,28 @@ #include #ifdef _MSC_VER -// Allow him to use Microsoft's stdint.h for 2015 and up -# if _MSC_VER >= 1900 -# ifdef EXV_HAVE_STDINT_H -# undef EXV_HAVE_STDINT_H -# endif +// Don't assume the value of EXV_HAVE_STDINT_H in exv_msvc.h has been set correctly +# ifdef EXV_HAVE_STDINT_H +# undef EXV_HAVE_STDINT_H +# endif +// Visual Studio 2010 and later has stdint.h +# if _MSC_VER >= _MSC_VER_2010 +# include +# else +// Earlier compilers have MS C99 equivalents such as __int8 + 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; # endif #endif #ifdef EXV_HAVE_STDINT_H # include -#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; -typedef unsigned __int64 uint64_t; -typedef __int8 int8_t; -typedef __int16 int16_t; -typedef __int32 int32_t; -typedef __int64 int64_t; #endif // MSVC macro to convert a string to a wide string diff --git a/xmpsdk/include/MD5.h b/xmpsdk/include/MD5.h index 994d02f8..c0152bc5 100644 --- a/xmpsdk/include/MD5.h +++ b/xmpsdk/include/MD5.h @@ -26,16 +26,17 @@ #include #ifdef _MSC_VER +// _MSC_VER 1600 == Visual Studio 2010 # if _MSC_VER < 1600 # ifdef EXV_HAVE_STDINT_H # undef EXV_HAVE_STDINT_H # endif # endif +#endif #ifdef EXV_HAVE_STDINT_H # include #endif -#endif /* MSVC doesn't provide C99 types, but it has MS specific variants */ #ifdef _MSC_VER