]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake2/qdata_heretic2/common/path_init.c
rework GDEF_OS macros
[xonotic/netradiant.git] / tools / quake2 / qdata_heretic2 / common / path_init.c
index 1447037759aec6699c8b3d3516156c17c38b0a3d..254977bca43accb580cbb8f8cb9ab2887d2b16c0 100644 (file)
 
 #include "globaldefs.h"
 
-#if GDEF_OS_LINUX || GDEF_OS_MACOS
-       #define Q_UNIX
-#endif
-
-#ifdef Q_UNIX
+#if !GDEF_OS_WINDOWS
        #include <unistd.h>
        #include <pwd.h>
        #include <limits.h>
-#endif
-
+#endif // !GDEF_OS_WINDOWS
 
 /* dependencies */
 #include "cmdlib.h"
 #include "inout.h"
 
-
-
 /* path support */
 #define MAX_BASE_PATHS  10
 #define MAX_GAME_PATHS  10
@@ -66,9 +59,9 @@ char                    *gamePaths[ MAX_GAME_PATHS ];
  */
 
 char *LokiGetHomeDir( void ){
-       #ifndef Q_UNIX
+       #if GDEF_OS_WINDOWS
        return NULL;
-       #else
+       #else // !GDEF_OS_WINDOWS
        char            *home;
        uid_t id;
        struct passwd   *pwd;
@@ -92,7 +85,7 @@ char *LokiGetHomeDir( void ){
 
        /* return it */
        return home;
-       #endif
+       #endif // !GDEF_OS_WINDOWS
 }
 
 
@@ -103,10 +96,10 @@ char *LokiGetHomeDir( void ){
  */
 
 void LokiInitPaths( char *argv0 ){
-       #ifndef Q_UNIX
+       #if GDEF_OS_WINDOWS
        /* this is kinda crap, but hey */
        strcpy( installPath, "../" );
-       #else
+       #else // !GDEF_OS_WINDOWS
        char temp[ MAX_OS_PATH ];
        char        *home;
        char        *path;
@@ -178,7 +171,7 @@ void LokiInitPaths( char *argv0 ){
 
        /* set home path */
        homePath = home;
-       #endif
+       #endif // !GDEF_OS_WINDOWS
 }
 
 
@@ -224,7 +217,7 @@ void AddBasePath( char *path ){
  */
 
 void AddHomeBasePath( char *path ){
-       #ifdef Q_UNIX
+       #if !GDEF_OS_WINDOWS
        int i;
        char temp[ MAX_OS_PATH ];
 
@@ -246,7 +239,7 @@ void AddHomeBasePath( char *path ){
        strcpy( basePaths[ 0 ], temp );
        CleanPath( basePaths[ 0 ] );
        numBasePaths++;
-       #endif
+       #endif // !GDEF_OS_WINDOWS
 }