From 0afe5a97a122dd56e40bbbea765d506cb03071f8 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Sat, 4 Jun 2016 05:56:02 +0000 Subject: [PATCH] #1187 and #1041 Fixing CMake/MSVC build breaker --- config/config.h.cmake | 10 +++++++++- include/exiv2/exv_msvc.h | 9 +++++++++ include/exiv2/rwlock.hpp | 9 ++------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/config/config.h.cmake b/config/config.h.cmake index 168c2de2..78b6f608 100644 --- a/config/config.h.cmake +++ b/config/config.h.cmake @@ -37,7 +37,6 @@ #define HAVE_NTOHLL 1 #endif - /* Define to 1 if you want to use `libssh' for SshIO. */ #cmakedefine EXV_USE_SSH 1 @@ -324,6 +323,15 @@ typedef int pid_t; # pragma warning(disable : 4996) #endif +// Constants required by Microsoft SDKs to define SHGetFolderPathA and others +#ifdef _MSC_VER +# ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0501 +# endif +# include +# include +#endif + /* If you're using Solaris and the Solaris Studio compiler you must -library=stdcxx4 along with these inclusions below diff --git a/include/exiv2/exv_msvc.h b/include/exiv2/exv_msvc.h index 7c0fdeb8..07895d4c 100644 --- a/include/exiv2/exv_msvc.h +++ b/include/exiv2/exv_msvc.h @@ -323,6 +323,15 @@ typedef int pid_t; # pragma warning(disable : 4996) #endif +// Constants required by Microsoft SDKs to define SHGetFolderPathA and others +#ifdef _MSC_VER +# ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0400 +# endif +# include +# include +#endif + /* If you're using Solaris and the Solaris Studio compiler you must -library=stdcxx4 along with these inclusions below diff --git a/include/exiv2/rwlock.hpp b/include/exiv2/rwlock.hpp index 245b81de..956c5678 100644 --- a/include/exiv2/rwlock.hpp +++ b/include/exiv2/rwlock.hpp @@ -22,13 +22,8 @@ #ifndef RW_LOCK_HPP #define RW_LOCK_HPP -#ifdef _MSC_VER -# ifndef _WIN32_WINNT -# define _WIN32_WINNT 0x0400 -# endif -# include -#else -# include +#ifndef _MSC_VER +#include #endif namespace Exiv2 {