From b304244766fbe318ae6c7edb94a59b929c582ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Tue, 6 Oct 2020 22:01:01 +0200 Subject: [PATCH] Move winsock2 inclusion to http.cpp --- CMakeLists.txt | 1 - include/exiv2/config.h | 6 ------ src/http.cpp | 5 +++++ 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 85b92ac7..c8f9d088 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,6 @@ project(exiv2 # use TWEAK to categorize the build LANGUAGES CXX ) include(cmake/mainSetup.cmake REQUIRED) -add_compile_options(-DEXIV2_BUILDING_EXIV2) # options and their default values option( BUILD_SHARED_LIBS "Build exiv2lib as a shared library" ON ) diff --git a/include/exiv2/config.h b/include/exiv2/config.h index 1af0b69a..8c35ec21 100644 --- a/include/exiv2/config.h +++ b/include/exiv2/config.h @@ -92,12 +92,6 @@ typedef int pid_t; # endif #endif ////////////////////////////////////// -#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW__) -#ifdef EXIV2_BUILDING_EXIV2 -#define __USE_W32_SOCKETS -#include -#endif -#endif // https://softwareengineering.stackexchange.com/questions/291141/how-to-handle-design-changes-for-auto-ptr-deprecation-in-c11 diff --git a/src/http.cpp b/src/http.cpp index afd79492..104aa5e3 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -40,6 +40,11 @@ //////////////////////////////////////// // platform specific code +#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW__) +#define __USE_W32_SOCKETS +#include +#endif + #if defined(WIN32) || defined(_MSC_VER) || defined(__MINGW__) #include #include