mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-06 01:07:49 +08:00
Fix build for Windows
* winsock2.h is case sensitive, lower case is required for cross build. * ws2tcpip.h is required for addrinfo. * FreeAddrInfo conflicts with existing freeaddrinfo, so rename it. Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
cd2ff22784
commit
c1f70e27c9
@ -35,7 +35,8 @@
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#pragma comment(lib, "Ws2_32.lib")
|
#pragma comment(lib, "Ws2_32.lib")
|
||||||
# include <WinSock2.h> // for fd_set, send, ..
|
# include <winsock2.h> // for fd_set, send, ..
|
||||||
|
# include <ws2tcpip.h> // for addrinfo
|
||||||
#else
|
#else
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
@ -316,7 +317,7 @@ static std::string ScrollViewCommand(std::string scrollview_path) {
|
|||||||
|
|
||||||
|
|
||||||
// Platform-independent freeaddrinfo()
|
// Platform-independent freeaddrinfo()
|
||||||
static void FreeAddrInfo(struct addrinfo* addr_info) {
|
static void TessFreeAddrInfo(struct addrinfo* addr_info) {
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
freeaddrinfo(addr_info);
|
freeaddrinfo(addr_info);
|
||||||
#else
|
#else
|
||||||
@ -352,7 +353,7 @@ static int GetAddrInfoNonLinux(const char* hostname, int port,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (name == nullptr) {
|
if (name == nullptr) {
|
||||||
FreeAddrInfo(*addr_info);
|
TessFreeAddrInfo(*addr_info);
|
||||||
*addr_info = nullptr;
|
*addr_info = nullptr;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -441,7 +442,7 @@ SVNetwork::SVNetwork(const char* hostname, int port) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FreeAddrInfo(addr_info);
|
TessFreeAddrInfo(addr_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
SVNetwork::~SVNetwork() {
|
SVNetwork::~SVNetwork() {
|
||||||
|
Loading…
Reference in New Issue
Block a user