Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "globaldefs.h"
#include <assert.h>
-#ifdef WIN32
+#if GDEF_OS_WINDOWS
#include <io.h>
#endif
#include "md3lib.h"
-#if defined ( __linux__ ) || defined ( __APPLE__ )
-#define filelength Q_filelength
+#if GDEF_OS_LINUX || GDEF_OS_MACOS
+#define filelength(f) Q_filelength(f)
+#else
+#define filelength(f) filelength(fileno(f))
#endif
/*
** MD3_ComputeTagFromTri
*/
-void MD3_ComputeTagFromTri( md3Tag_t *pTag, const float pTri[3][3] ){
+void MD3_ComputeTagFromTri( md3Tag_t *pTag, float pTri[3][3] ){
float len[3];
vec3_t axes[3], sides[3];
int longestSide, shortestSide, hypotSide;
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 );