mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-14 00:31:47 +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
|
||||
#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
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
@ -316,7 +317,7 @@ static std::string ScrollViewCommand(std::string scrollview_path) {
|
||||
|
||||
|
||||
// Platform-independent freeaddrinfo()
|
||||
static void FreeAddrInfo(struct addrinfo* addr_info) {
|
||||
static void TessFreeAddrInfo(struct addrinfo* addr_info) {
|
||||
#if defined(__linux__)
|
||||
freeaddrinfo(addr_info);
|
||||
#else
|
||||
@ -352,7 +353,7 @@ static int GetAddrInfoNonLinux(const char* hostname, int port,
|
||||
#endif
|
||||
|
||||
if (name == nullptr) {
|
||||
FreeAddrInfo(*addr_info);
|
||||
TessFreeAddrInfo(*addr_info);
|
||||
*addr_info = nullptr;
|
||||
return -1;
|
||||
}
|
||||
@ -441,7 +442,7 @@ SVNetwork::SVNetwork(const char* hostname, int port) {
|
||||
}
|
||||
}
|
||||
}
|
||||
FreeAddrInfo(addr_info);
|
||||
TessFreeAddrInfo(addr_info);
|
||||
}
|
||||
|
||||
SVNetwork::~SVNetwork() {
|
||||
|
Loading…
Reference in New Issue
Block a user