From 26f1a337495c1b434defc7f7d144824c46450941 Mon Sep 17 00:00:00 2001 From: Steven Chamberlain Date: Tue, 5 Apr 2016 01:34:34 +0100 Subject: [PATCH] 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). --- Sources/CMakeLists.txt | 2 +- Sources/Engine/Network/CommunicationInterface.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt index 9c3e655..6f6727d 100644 --- a/Sources/CMakeLists.txt +++ b/Sources/CMakeLists.txt @@ -8,7 +8,7 @@ project(SeriousEngine) find_package(SDL REQUIRED) # 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) endif() if(APPLE) diff --git a/Sources/Engine/Network/CommunicationInterface.cpp b/Sources/Engine/Network/CommunicationInterface.cpp index bb7b6e5..6f35a92 100644 --- a/Sources/Engine/Network/CommunicationInterface.cpp +++ b/Sources/Engine/Network/CommunicationInterface.cpp @@ -134,8 +134,10 @@ static struct ErrorCode ErrorCodes[] = { ERRORCODE(ENODEV , "ENODEV"), ERRORCODE(ECONNRESET , "ECONNRESET"), ERRORCODE(ENOTCONN , "ENOTCONN"), - #if !PLATFORM_MACOSX + #ifdef ENOSR ERRORCODE(ENOSR , "ENOSR"), + #endif + #ifdef ENOPKG ERRORCODE(ENOPKG , "ENOPKG"), #endif #endif