mingw console

This commit is contained in:
WuHuan 2014-01-09 17:48:37 +08:00
parent 1cd68accc1
commit 4dbb0ee1e8
2 changed files with 12 additions and 4 deletions

View File

@ -102,9 +102,7 @@ static const char* inet_ntop(int af, const void* src, char* dst, int cnt)
srcaddr.sin_family = af; srcaddr.sin_family = af;
if (WSAAddressToString((struct sockaddr*) &srcaddr, sizeof(struct sockaddr_in), 0, dst, (LPDWORD) &cnt) != 0) if (WSAAddressToString((struct sockaddr*) &srcaddr, sizeof(struct sockaddr_in), 0, dst, (LPDWORD) &cnt) != 0)
{ {
DWORD rv = WSAGetLastError(); return nullptr;
printf("WSAAddressToString() : %d\n",rv);
return NULL;
} }
return dst; return dst;
} }

View File

@ -1,5 +1,15 @@
set(APP_NAME testcpp) 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 set(SAMPLE_SRC
Classes/AccelerometerTest/AccelerometerTest.cpp Classes/AccelerometerTest/AccelerometerTest.cpp
Classes/ActionManagerTest/ActionManagerTest.cpp Classes/ActionManagerTest/ActionManagerTest.cpp
@ -136,7 +146,7 @@ set(SAMPLE_SRC
Classes/AppDelegate.cpp Classes/AppDelegate.cpp
Classes/BaseTest.cpp Classes/BaseTest.cpp
Classes/VisibleRect.cpp Classes/VisibleRect.cpp
proj.linux/main.cpp ${PLATFORM_SRC}
) )
include_directories( include_directories(