make the build possible on OpenBSD.

modified version of the pk download script.
isnan belongs to std namespace in C++11 standard.
This commit is contained in:
David Carlier 2016-12-04 20:01:37 +00:00
parent 0d99d30da7
commit 1d970ec34d
5 changed files with 22 additions and 12 deletions

View File

@ -10,9 +10,17 @@
#
# 2. kv6 files from the original AoS 0.75.
OS_BASE="`uname`"
SRC_DIR="`dirname "$0"`"
PAK_URL=$(grep --max-count=1 --no-filename --context=0 --color=never \
"DevPaks" "$SRC_DIR/PakLocation.txt")
# no color, not -m flag for OpenBSD
if [[ "$OS_BASE" != 'OpenBSD' ]]; then
PAK_URL=$(grep --max-count=1 --no-filename --context=0 --color=never \
"DevPaks" "$SRC_DIR/PakLocation.txt")
else
PAK_URL=$(grep --no-filename \
"DevPaks" "$SRC_DIR/PakLocation.txt" | head -n1)
fi
echo "BASEURL ************ $PAK_URL"
PAK_NAME=$(basename "$PAK_URL")
OUTPUT_DIR="."

View File

@ -97,7 +97,9 @@ else()
endif()
if(UNIX)
target_link_libraries(OpenSpades rt)
if(NOT CMAKE_SYSTEM_NAME MATCHES "BSD")
target_link_libraries(OpenSpades rt)
endif()
endif()
#install(TARGETS OpenSpades DESTINATION bin)

View File

@ -726,12 +726,12 @@ namespace spades {
if (pos.x != 0.f || pos.y != 0.f || pos.z != 0.f || front.x != 0.f ||
front.y != 0.f || front.z != 0.f) {
Player *p;
SPAssert(!isnan(pos.x));
SPAssert(!isnan(pos.y));
SPAssert(!isnan(pos.z));
SPAssert(!isnan(front.x));
SPAssert(!isnan(front.y));
SPAssert(!isnan(front.z));
SPAssert(!std::isnan(pos.x));
SPAssert(!std::isnan(pos.y));
SPAssert(!std::isnan(pos.z));
SPAssert(!std::isnan(front.x));
SPAssert(!std::isnan(front.y));
SPAssert(!std::isnan(front.z));
SPAssert(front.GetLength() < 40.f);
if (GetWorld()) {
p = GetWorld()->GetPlayer(idx);

View File

@ -361,9 +361,9 @@ namespace spades {
height[i] += velocity[i] * dt;
#ifndef NDEBUG
for (int i = 0; i < samples; i++)
SPAssert(!isnan(height[i]));
SPAssert(!std::isnan(height[i]));
for (int i = 0; i < samples; i++)
SPAssert(!isnan(velocity[i]));
SPAssert(!std::isnan(velocity[i]));
#endif
// solve ddz/dtt = c^2 (ddz/dxx + ddz/dyy)

View File

@ -21,7 +21,7 @@
#include <algorithm> //std::sort
#include <memory>
#if !defined(__APPLE__) && __unix
#if !defined(__APPLE__) && (__unix || __unix__)
#include <sys/stat.h>
#include <sys/types.h>
#endif