From 89d13ab7746ec71739ce2afdbca032eac3871931 Mon Sep 17 00:00:00 2001 From: Cliff Gordon Date: Fri, 21 Apr 2017 14:08:54 -0500 Subject: [PATCH 1/3] fix/solaris_math_h: Attempt to work around the version symbol conflict. --- code/globalincs/version.cpp | 2 +- code/globalincs/version.h | 2 +- code/mod_table/mod_table.cpp | 35 ++++++++++++++++------------------- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/code/globalincs/version.cpp b/code/globalincs/version.cpp index 9b2da1f5ca2..6306acf284b 100644 --- a/code/globalincs/version.cpp +++ b/code/globalincs/version.cpp @@ -10,7 +10,7 @@ #include "globalincs/pstypes.h" #include "globalincs/version.h" -namespace version +namespace gameversion { bool check_at_least(int major, int minor, int build, int revision) { diff --git a/code/globalincs/version.h b/code/globalincs/version.h index 1c62ba46ba9..9f28791221f 100644 --- a/code/globalincs/version.h +++ b/code/globalincs/version.h @@ -36,7 +36,7 @@ #include "project.h" -namespace version +namespace gameversion { /** * @brief Checks if the current version is at least the given version diff --git a/code/mod_table/mod_table.cpp b/code/mod_table/mod_table.cpp index a945616aca6..f116d3fdd1e 100644 --- a/code/mod_table/mod_table.cpp +++ b/code/mod_table/mod_table.cpp @@ -53,35 +53,35 @@ void parse_mod_table(const char *filename) // start parsing optional_string("#GAME SETTINGS"); - + if (optional_string("$Minimum version:")) { int major = 0; int minor = 0; int build = 0; int revision = 0; - + required_string("+Major:"); stuff_int(&major); - + required_string("+Minor:"); stuff_int(&minor); - + required_string("+Build:"); stuff_int(&build); - + if (optional_string("+Revision:")) { stuff_int(&revision); } - - mprintf(("Game Settings Table: Parsed minimum version of %s\n", version::format_version(major, minor, build, revision).c_str())); - - if (!version::check_at_least(major, minor, build, revision)) { + + mprintf(("Game Settings Table: Parsed minimum version of %s\n", gameversion::format_version(major, minor, build, revision).c_str())); + + if (!gameversion::check_at_least(major, minor, build, revision)) { Error(LOCATION, "This modification needs at least version %s of FreeSpace Open. However, the current is only %s!", - version::format_version(major, minor, build, revision).c_str(), - version::format_version(FS_VERSION_MAJOR, FS_VERSION_MINOR, FS_VERSION_BUILD, FS_VERSION_REVIS).c_str()); + gameversion::format_version(major, minor, build, revision).c_str(), + gameversion::format_version(FS_VERSION_MAJOR, FS_VERSION_MINOR, FS_VERSION_BUILD, FS_VERSION_REVIS).c_str()); } } - + optional_string("#CAMPAIGN SETTINGS"); if (optional_string("$Default Campaign File Name:")) { @@ -215,19 +215,16 @@ void parse_mod_table(const char *filename) Briefing_window_FOV = fov; } - - if (optional_string("$Generic Pain Flash Factor:")) { + if (optional_string("$Generic Pain Flash Factor:")) { stuff_float(&Generic_pain_flash_factor); if (Generic_pain_flash_factor != 1.0f) mprintf(("Game Settings Table: Setting generic pain flash factor to %.2f\n", Generic_pain_flash_factor)); - } - - if (optional_string("$Shield Pain Flash Factor:")) { + + if (optional_string("$Shield Pain Flash Factor:")) { stuff_float(&Shield_pain_flash_factor); if (Shield_pain_flash_factor != 0.0f) mprintf(("Game Settings Table: Setting shield pain flash factor to %.2f\n", Shield_pain_flash_factor)); - } optional_string("#NETWORK SETTINGS"); @@ -343,7 +340,7 @@ void parse_mod_table(const char *filename) } void mod_table_init() -{ +{ // first parse the default table parse_mod_table(NULL); From 8acff8e02c5be1a8eeb90a4d362a4e41f767bb76 Mon Sep 17 00:00:00 2001 From: Cliff Gordon Date: Fri, 21 Apr 2017 14:26:13 -0500 Subject: [PATCH 2/3] Add the INTEL_LONG define that was added to the other two blocks last year but not to Solaris. --- code/globalincs/pstypes.h | 1 + 1 file changed, 1 insertion(+) diff --git a/code/globalincs/pstypes.h b/code/globalincs/pstypes.h index 50e2cc5ef07..cbc39ebcc83 100644 --- a/code/globalincs/pstypes.h +++ b/code/globalincs/pstypes.h @@ -318,6 +318,7 @@ const size_t INVALID_SIZE = static_cast(-1); #ifdef SCP_SOLARIS // Solaris #define INTEL_INT(x) x +#define INTEL_LONG(x) x #define INTEL_SHORT(x) x #define INTEL_FLOAT(x) (*x) #elif BYTE_ORDER == BIG_ENDIAN From accbc1d25d32d30b874911a43ce59ca5363e39fc Mon Sep 17 00:00:00 2001 From: Cliff Gordon Date: Fri, 21 Apr 2017 15:12:15 -0500 Subject: [PATCH 3/3] See if this helps with the linking errors for libsocket and libnsl symbols. --- cmake/platform-solaris.cmake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cmake/platform-solaris.cmake b/cmake/platform-solaris.cmake index 65c2cd1d250..ba6b3ded318 100644 --- a/cmake/platform-solaris.cmake +++ b/cmake/platform-solaris.cmake @@ -1,2 +1,18 @@ target_compile_definitions(platform INTERFACE SCP_SOLARIS) + +find_library(SOCKET_LIB socket) + +if (NOT SOCKET_LIB) + message(FATAL_ERROR "Couldn't find libsocket! Please install it and rerun the configuration.") +else() + target_link_libraries(platform INTERFACE "${SOCKET_LIB}") +endif() + +find_library(NSL_LIB nsl) + +if (NOT NSL_LIB) + message(FATAL_ERROR "Couldn't find libnsl! Please install it and rerun the configuration.") +else() + target_link_libraries(platform INTERFACE "${NSL_LIB}") +endif()