Skip to content

Commit

Permalink
Merge pull request #1340 from Exiv2/fix_1335_winsock2_0.27
Browse files Browse the repository at this point in the history
Second effort to unexpose winsock2.h from include <exiv2/exiv2.hpp>
  • Loading branch information
clanmills authored Oct 2, 2020
2 parents fcdf009 + 604a268 commit 632684f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ 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 )
Expand Down
7 changes: 7 additions & 0 deletions include/exiv2/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ typedef int pid_t;
# endif
#endif
//////////////////////////////////////
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW__)
#ifdef EXIV2_BUILDING_EXIV2
#define __USE_W32_SOCKETS
#include <winsock2.h>
#endif
#endif


// https://softwareengineering.stackexchange.com/questions/291141/how-to-handle-design-changes-for-auto-ptr-deprecation-in-c11
#if __cplusplus >= 201103L
Expand Down
5 changes: 0 additions & 5 deletions src/http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@

////////////////////////////////////////
// platform specific code
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW__)
#define __USE_W32_SOCKETS
#include <winsock2.h>
#endif

#if defined(WIN32) || defined(_MSC_VER) || defined(__MINGW__)
#include <string.h>
#include <io.h>
Expand Down

0 comments on commit 632684f

Please sign in to comment.