]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/environment.cpp
Centralise compile checks
[xonotic/netradiant.git] / radiant / environment.cpp
index a28524e6d8e10baf17014ba5df4b1e9371cf9baa..1c297f03b353531708a78ab8b5264903d16c5450 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include "environment.h"
+#include "globaldefs.h"
 
 #include "stream/textstream.h"
 #include "string/string.h"
@@ -127,9 +128,9 @@ void gamedetect(){
                        // TODO add more games to this
 
                        // try to detect Nexuiz installs
-#if defined( WIN32 )
+#if GDEF_OS_WINDOWS
                        if ( gamedetect_check_game( "nexuiz.game", "data/common-spog.pk3", "nexuiz.exe", buf, p - buf ) )
-#elif defined( __APPLE__ )
+#elif GDEF_OS_MACOS
                        if ( gamedetect_check_game( "nexuiz.game", "data/common-spog.pk3", "Nexuiz.app/Contents/Info.plist", buf, p - buf ) )
 #else
                        if ( gamedetect_check_game( "nexuiz.game", "data/common-spog.pk3", "nexuiz-linux-glx.sh", buf, p - buf ) )
@@ -179,7 +180,7 @@ bool portable_app_setup(){
        return false;
 }
 
-#if defined( POSIX )
+#if GDEF_OS_POSIX
 
 #include <stdlib.h>
 #include <pwd.h>
@@ -188,7 +189,7 @@ bool portable_app_setup(){
 #include <glib.h>
 
 const char* LINK_NAME =
-#if defined ( __linux__ )
+#if GDEF_OS_LINUX
        "/proc/self/exe"
 #else // FreeBSD and OSX
        "/proc/curproc/file"
@@ -252,11 +253,11 @@ void environment_init( int argc, char const* argv[] ){
        gamedetect();
 }
 
-#elif defined( WIN32 )
+#elif GDEF_OS_WINDOWS
 
 #include <windows.h>
 
-void environment_init( int argc, char* argv[] ){
+void environment_init( int argc, char const* argv[] ){
        args_init( argc, argv );
 
        {