]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - contrib/bobtoolz/misc.cpp
cmake: do not look for graphical libs when not building radiant
[xonotic/netradiant.git] / contrib / bobtoolz / misc.cpp
index aa22640a1cccb5b46d65dd2094465c3020a6414a..f73c9787a0267a0fe49236bac473542e91f1c986 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include "misc.h"
+#include "globaldefs.h"
 
 #include <list>
 #include "str.h"
@@ -31,7 +32,7 @@
 
 #include "funchandlers.h"
 
-#ifdef __linux__
+#if GDEF_OS_POSIX
 #include <sys/types.h>
 #include <unistd.h>
 #endif
@@ -129,7 +130,7 @@ char* TranslateString( char *buf ){
 
        std::size_t l = strlen( buf );
        char* out = buf2;
-       for ( int i = 0 ; i < l ; i++ )
+       for ( std::size_t i = 0 ; i < l ; i++ )
        {
                if ( buf[i] == '\n' ) {
                        *out++ = '\r';
@@ -146,7 +147,7 @@ char* TranslateString( char *buf ){
 
 
 char* UnixToDosPath( char* path ){
-#ifndef WIN32
+#if !GDEF_OS_WINDOWS
        return path;
 #else
        for ( char* p = path; *p; p++ )
@@ -182,7 +183,7 @@ extern char* PLUGIN_NAME;
     return buffer;
    }*/
 
-#if defined ( POSIX )
+#if GDEF_OS_POSIX
 // the bCreateConsole parameter is ignored on linux ..
 bool Q_Exec( const char *pCmd, bool bCreateConsole ){
        switch ( fork() )
@@ -192,7 +193,7 @@ bool Q_Exec( const char *pCmd, bool bCreateConsole ){
 //      Error ("CreateProcess failed");
                break;
        case 0:
-#ifdef _DEBUG
+#if GDEF_DEBUG
                printf( "Running system...\n" );
                printf( "Command: %s\n", pCmd );
 #endif
@@ -208,7 +209,7 @@ bool Q_Exec( const char *pCmd, bool bCreateConsole ){
 }
 #endif
 
-#ifdef WIN32
+#if GDEF_OS_WINDOWS
 
 #include <windows.h>