addflags("-Wno-unused-parameter")
addflags("-Wno-missing-field-initializers")
-addflags_c("-Wno-int-conversion")
addflags_c("-Wno-pointer-to-int-cast")
addflags_c("-Wno-incompatible-pointer-types")
#include "md3lib.h"
#if defined ( __linux__ ) || defined ( __APPLE__ )
-#define filelength Q_filelength
+#define filelength(f) Q_filelength(f)
+#else
+#define filelength(f) filelength(fileno(f))
#endif
/*
Error( "Unable to open '%s'\n", filename );
}
- fileSize = filelength( fileno( fp ) );
- _buffer = malloc( filelength( fileno( fp ) ) );
+ fileSize = filelength( fp );
+ _buffer = malloc( fileSize );
fread( _buffer, fileSize, 1, fp );
fclose( fp );
#if defined ( __linux__ ) || defined ( __APPLE__ )
#include "cmdlib.h"
#define _strcmpi Q_stricmp
- #define filelength Q_filelength
#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 );