don't use w32 sockets for cygwin

Not needed.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
main
Rosen Penev 3 years ago
parent 350541f22a
commit 9aaeb893ee

@ -218,7 +218,7 @@ if (NOT MSVC)
target_link_libraries( exiv2lib PRIVATE -lprocstat) target_link_libraries( exiv2lib PRIVATE -lprocstat)
endif() endif()
if (CYGWIN OR MINGW OR MSYS) if (MINGW)
target_link_libraries( exiv2lib PRIVATE psapi ws2_32 shell32 ) target_link_libraries( exiv2lib PRIVATE psapi ws2_32 shell32 )
endif() endif()

@ -2,7 +2,7 @@
#include "config.h" #include "config.h"
#if defined(_WIN32) || defined(__CYGWIN__) #if defined(_WIN32)
#define __USE_W32_SOCKETS #define __USE_W32_SOCKETS
#include <winsock2.h> #include <winsock2.h>
#endif #endif
@ -18,8 +18,7 @@
//////////////////////////////////////// ////////////////////////////////////////
// platform specific code // platform specific code
#if defined(_WIN32) || defined(__CYGWIN__) #ifndef _WIN32
#else
//////////////////////////////////////// ////////////////////////////////////////
// Unix or Mac // Unix or Mac
@ -122,7 +121,7 @@ static Exiv2::Dictionary stringToDict(const std::string& s) {
} }
static int makeNonBlocking(int sockfd) { static int makeNonBlocking(int sockfd) {
#if defined(_WIN32) || defined(__CYGWIN__) #if defined(_WIN32)
ULONG ioctl_opt = 1; ULONG ioctl_opt = 1;
return ioctlsocket(sockfd, FIONBIO, &ioctl_opt); return ioctlsocket(sockfd, FIONBIO, &ioctl_opt);
#else #else
@ -147,7 +146,7 @@ int Exiv2::http(Exiv2::Dictionary& request, Exiv2::Dictionary& response, std::st
//////////////////////////////////// ////////////////////////////////////
// Windows specific code // Windows specific code
#if defined(_WIN32) || defined(__CYGWIN__) #if defined(_WIN32)
WSADATA wsaData; WSADATA wsaData;
WSAStartup(MAKEWORD(2, 2), &wsaData); WSAStartup(MAKEWORD(2, 2), &wsaData);
#endif #endif

Loading…
Cancel
Save