/*
- 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.
*/
#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
{
memset( &p3d, 0, sizeof( p3d ) );
- p3d.len = filelength( fileno( fp ) );
+ p3d.len = filelength( fp );
p3d.curpos = p3d.buffer = malloc( p3d.len );