Building on GNU/kFreeBSD and possibly Hurd

* Only use ENOSR and ENOPKG if defined

ENOSR and ENOPKG are part of the POSIX optional STREAMS extension, and
are not available on most other platforms than GNU/Linux.

* Support building on other GNU platforms than Linux

Build for other GNU platforms the same way as Linux:  this includes
CMAKE_SYSTEM_NAME "GNU" (GNU/Hurd) and "GNU/kFreeBSD" (GNU/kFreeBSD).
This commit is contained in:
Steven Chamberlain 2016-04-05 01:34:34 +01:00 committed by Ryan C. Gordon
parent 5ba4bccabd
commit 26f1a33749
2 changed files with 4 additions and 2 deletions

View File

@ -8,7 +8,7 @@ project(SeriousEngine)
find_package(SDL REQUIRED) find_package(SDL REQUIRED)
# Set up some sanity stuff... # Set up some sanity stuff...
if(CMAKE_SYSTEM_NAME STREQUAL "Linux") if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME MATCHES "GNU|kFreeBSD")
SET(LINUX TRUE) SET(LINUX TRUE)
endif() endif()
if(APPLE) if(APPLE)

View File

@ -134,8 +134,10 @@ static struct ErrorCode ErrorCodes[] = {
ERRORCODE(ENODEV , "ENODEV"), ERRORCODE(ENODEV , "ENODEV"),
ERRORCODE(ECONNRESET , "ECONNRESET"), ERRORCODE(ECONNRESET , "ECONNRESET"),
ERRORCODE(ENOTCONN , "ENOTCONN"), ERRORCODE(ENOTCONN , "ENOTCONN"),
#if !PLATFORM_MACOSX #ifdef ENOSR
ERRORCODE(ENOSR , "ENOSR"), ERRORCODE(ENOSR , "ENOSR"),
#endif
#ifdef ENOPKG
ERRORCODE(ENOPKG , "ENOPKG"), ERRORCODE(ENOPKG , "ENOPKG"),
#endif #endif
#endif #endif