diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a3663eba4..186e23aaa7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,6 +99,7 @@ endif() if(MINGW) add_definitions(-DGLEW_STATIC) + add_definitions(-D__SSIZE_T) endif() diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index 1eaf59e458..d289c6669e 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -194,7 +194,7 @@ static const char* inet_ntop(int af, const void* src, char* dst, int cnt) memcpy(&(srcaddr.sin_addr), src, sizeof(srcaddr.sin_addr)); srcaddr.sin_family = af; - if (WSAAddressToString((struct sockaddr*) &srcaddr, sizeof(struct sockaddr_in), 0, dst, (LPDWORD) &cnt) != 0) + if (WSAAddressToStringA((struct sockaddr*) &srcaddr, sizeof(struct sockaddr_in), 0, dst, (LPDWORD) &cnt) != 0) { return nullptr; }