diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index f876b4ad48..6eb9256a67 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -102,9 +102,7 @@ static const char* inet_ntop(int af, const void* src, char* dst, int cnt) srcaddr.sin_family = af; if (WSAAddressToString((struct sockaddr*) &srcaddr, sizeof(struct sockaddr_in), 0, dst, (LPDWORD) &cnt) != 0) { - DWORD rv = WSAGetLastError(); - printf("WSAAddressToString() : %d\n",rv); - return NULL; + return nullptr; } return dst; } diff --git a/samples/Cpp/TestCpp/CMakeLists.txt b/samples/Cpp/TestCpp/CMakeLists.txt index 2c3fc4033e..155ad7a2ae 100644 --- a/samples/Cpp/TestCpp/CMakeLists.txt +++ b/samples/Cpp/TestCpp/CMakeLists.txt @@ -1,5 +1,15 @@ set(APP_NAME testcpp) +if(WIN32) + set(PLATFORM_SRC + proj.win32/main.cpp + ) +else() + set(PLATFORM_SRC + proj.linux/main.cpp + ) +endif() + set(SAMPLE_SRC Classes/AccelerometerTest/AccelerometerTest.cpp Classes/ActionManagerTest/ActionManagerTest.cpp @@ -136,7 +146,7 @@ set(SAMPLE_SRC Classes/AppDelegate.cpp Classes/BaseTest.cpp Classes/VisibleRect.cpp - proj.linux/main.cpp + ${PLATFORM_SRC} ) include_directories(