]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3data/p3dlib.c
reduce more diff noise
[xonotic/netradiant.git] / tools / quake3 / q3data / p3dlib.c
index 2da1ae9b6aed31e5b3a64791d518cb2f5709c667..97cc3f6a229510eda76ba7932e1773e94575113f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+   Copyright (C) 1999-2007 id Software, Inc. and contributors.
    For a list of contributors, see the accompanying CONTRIBUTORS file.
 
    This file is part of GtkRadiant.
@@ -20,8 +20,9 @@
  */
 
 #include "p3dlib.h"
+#include "globaldefs.h"
 
-#ifdef WIN32
+#if GDEF_OS_WINDOWS
 #include <io.h>
 #endif
 #include <stdlib.h>
 
 #define MAX_POLYSETS 64
 
-#if defined ( __linux__ ) || defined ( __APPLE__ )
-#define _strcmpi Q_stricmp
-#define filelength Q_filelength
-#define strlwr strlower
+#if GDEF_OS_LINUX || GDEF_OS_MACOS
+       #include "cmdlib.h"
+       #define _strcmpi Q_stricmp
+       #define strlwr strlower
+       #define filelength(f) Q_filelength(f)
+#else
+       #define filelength(f) filelength(fileno(f))
 #endif
 typedef struct
 {
@@ -67,7 +71,7 @@ int P3DLoad( const char *filename ){
 
        memset( &p3d, 0, sizeof( p3d ) );
 
-       p3d.len = filelength( fileno( fp ) );
+       p3d.len = filelength( fp );
 
        p3d.curpos = p3d.buffer = malloc( p3d.len );