diff --git a/CMakeLists.txt b/CMakeLists.txt index fdb07445..c3b4642b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,11 @@ PROJECT(Descent3) IF (UNIX) SET (D3_GAMEDIR "~/Descent3/") + SET(CMAKE_CXX_STANDARD 17) + SET(CMAKE_CXX_STANDARD_REQUIRED ON) + SET(CMAKE_CXX_EXTENSIONS OFF) + SET(CMAKE_POSITION_INDEPENDENT_CODE ON) + IF (APPLE) SET(EXTRA_CXX_FLAGS "-Wno-address-of-temporary") ELSE() diff --git a/Descent3/cinematics.h b/Descent3/cinematics.h index a78d8ba1..bc4297ea 100644 --- a/Descent3/cinematics.h +++ b/Descent3/cinematics.h @@ -36,6 +36,8 @@ #include "renderer.h" #include "bitmap.h" +#include + // Movie Cinematic typedef struct tCinematic { intptr_t mvehandle; diff --git a/lib/findintersection.h b/lib/findintersection.h index 3efc7b95..8cb16ef0 100644 --- a/lib/findintersection.h +++ b/lib/findintersection.h @@ -234,7 +234,7 @@ extern bool FVI_always_check_ceiling; inline bool FastVectorBBox(const float *min, const float *max, const float *origin, const float *dir) { bool f_inside = true; char quad[3]; - register int i; + int i; float max_t[3]; float can_plane[3]; int which_plane; diff --git a/lib/movie.h b/lib/movie.h index d5fd66f0..e169275a 100644 --- a/lib/movie.h +++ b/lib/movie.h @@ -3,6 +3,8 @@ #include "renderer.h" +#include + #define MVELIB_NOERROR 0 #define MVELIB_FILE_ERROR -1 #define MVELIB_NOTINIT_ERROR -2 diff --git a/md5/md5.cpp b/md5/md5.cpp index 25a6e19b..68eccef7 100644 --- a/md5/md5.cpp +++ b/md5/md5.cpp @@ -261,7 +261,7 @@ void MD5::MD5Final(unsigned char digest[16]) { * the data and converts bytes into longwords for this routine. */ void MD5::MD5Transform(uint32_t buf[4], uint32_t const in[16]) { - register uint32_t a, b, c, d; + uint32_t a, b, c, d; a = buf[0]; b = buf[1]; diff --git a/misc/psglob.cpp b/misc/psglob.cpp index e12cf935..1caf03c8 100644 --- a/misc/psglob.cpp +++ b/misc/psglob.cpp @@ -27,8 +27,8 @@ // Returns 1 if string contains globbing characters in it int PSGlobHasPattern(char *string) { - register char *p = string; - register char c; + char *p = string; + char c; int open = 0; while ((c = *p++) != '\0') { @@ -70,8 +70,8 @@ int PSGlobHasPattern(char *string) { // 8) If dot_special is not zero, '*' and '?' do not match '.' at the beginning of text // 9) If case_sensitive is 0, than case does not matter for the non-pattern characters int PSGlobMatch(char *pattern, char *text, int case_sensitive, int dot_special) { - register char *p = pattern, *t = text; - register char c; + char *p = pattern, *t = text; + char c; while ((c = *p++) != '\0') { switch (c) { @@ -90,7 +90,7 @@ int PSGlobMatch(char *pattern, char *text, int case_sensitive, int dot_special) return 0; return PSGlobMatchAfterStar(p, case_sensitive, t); case '[': { - register char c1 = *t++; + char c1 = *t++; int invert; if (!c1) @@ -102,7 +102,7 @@ int PSGlobMatch(char *pattern, char *text, int case_sensitive, int dot_special) c = *p++; while (1) { - register char cstart = c, cend = c; + char cstart = c, cend = c; if (c == '\\') { cstart = *p++; cend = cstart; @@ -162,8 +162,8 @@ int PSGlobMatch(char *pattern, char *text, int case_sensitive, int dot_special) // Like PSGlobMatch, but match pattern against any final segment of text int PSGlobMatchAfterStar(char *pattern, int case_sensitive, char *text) { - register char *p = pattern, *t = text; - register char c, c1; + char *p = pattern, *t = text; + char c, c1; while ((c = *p++) == '?' || c == '*') { if (c == '?' && *t++ == '\0') diff --git a/scripts/osiris_import.h b/scripts/osiris_import.h index 8515acac..0491d86f 100644 --- a/scripts/osiris_import.h +++ b/scripts/osiris_import.h @@ -8,7 +8,7 @@ #ifdef __LINUX__ #ifndef MACOSX -typedef unsigned int size_t; +// typedef unsigned int size_t; #endif #include void _splitpath(const char *path, char *drive, char *dir, char *fname, char *ext);