From 13bab7a7e57331aadd29e752e2c56944f73c9811 Mon Sep 17 00:00:00 2001 From: spiral Date: Fri, 23 Dec 2011 00:45:28 +0000 Subject: [PATCH] Remove MWERKS stuff --- neo/d3xp/Game_local.cpp | 6 -- neo/framework/FileSystem.cpp | 11 +--- neo/game/Game_local.cpp | 6 -- neo/idlib/math/Simd.cpp | 106 +---------------------------------- neo/sound/snd_local.h | 6 -- neo/sys/platform.h | 5 -- 6 files changed, 3 insertions(+), 137 deletions(-) diff --git a/neo/d3xp/Game_local.cpp b/neo/d3xp/Game_local.cpp index 091d128e..077ddb25 100644 --- a/neo/d3xp/Game_local.cpp +++ b/neo/d3xp/Game_local.cpp @@ -134,16 +134,10 @@ static const char* fastEntityList[] = { GetGameAPI ============ */ -#if __MWERKS__ -#pragma export on -#endif #if __GNUC__ >= 4 #pragma GCC visibility push(default) #endif extern "C" gameExport_t *GetGameAPI( gameImport_t *import ) { -#if __MWERKS__ -#pragma export off -#endif if ( import->version == GAME_API_VERSION ) { diff --git a/neo/framework/FileSystem.cpp b/neo/framework/FileSystem.cpp index 92ab064d..6d010c73 100644 --- a/neo/framework/FileSystem.cpp +++ b/neo/framework/FileSystem.cpp @@ -29,13 +29,8 @@ If you have questions concerning this license or the applicable additional terms #ifdef WIN32 #include // for _read #else - #if !__MACH__ && __MWERKS__ - #include - #include - #else - #include - #include - #endif + #include + #include #include #endif @@ -602,14 +597,12 @@ FILE *idFileSystemLocal::OpenOSFile( const char *fileName, const char *mode, idS idStr fpath, entry; idStrList list; -#ifndef __MWERKS__ #ifndef WIN32 // some systems will let you fopen a directory struct stat buf; if ( stat( fileName, &buf ) != -1 && !S_ISREG(buf.st_mode) ) { return NULL; } -#endif #endif fp = fopen( fileName, mode ); if ( !fp && fs_caseSensitiveOS.GetBool() ) { diff --git a/neo/game/Game_local.cpp b/neo/game/Game_local.cpp index 2a67abc5..20fddb73 100644 --- a/neo/game/Game_local.cpp +++ b/neo/game/Game_local.cpp @@ -98,16 +98,10 @@ const char *idGameLocal::sufaceTypeNames[ MAX_SURFACE_TYPES ] = { GetGameAPI ============ */ -#if __MWERKS__ -#pragma export on -#endif #if __GNUC__ >= 4 #pragma GCC visibility push(default) #endif extern "C" gameExport_t *GetGameAPI( gameImport_t *import ) { -#if __MWERKS__ -#pragma export off -#endif if ( import->version == GAME_API_VERSION ) { diff --git a/neo/idlib/math/Simd.cpp b/neo/idlib/math/Simd.cpp index e0482bd1..c1b0fb1b 100644 --- a/neo/idlib/math/Simd.cpp +++ b/neo/idlib/math/Simd.cpp @@ -181,116 +181,12 @@ double ticksPerNanosecond; #define TIME_TYPE uint64_t -#ifdef __MWERKS__ //time_in_millisec is missing -/* - - .text - .align 2 - .globl _GetTB -_GetTB: - -loop: - mftbu r4 ; load from TBU - mftb r5 ; load from TBL - mftbu r6 ; load from TBU - cmpw r6, r4 ; see if old == new - bne loop ; if not, carry occured, therefore loop - - stw r4, 0(r3) - stw r5, 4(r3) - -done: - blr ; return - -*/ -typedef struct { - unsigned int hi; - unsigned int lo; -} U64; - - -asm void GetTB(U64 *in) -{ - nofralloc // suppress prolog - machine 603 // allows the use of mftb & mftbu functions - -loop: - mftbu r5 // grab the upper time base register (TBU) - mftb r4 // grab the lower time base register (TBL) - mftbu r6 // grab the upper time base register (TBU) again - - cmpw r6,r5 // see if old TBU == new TBU - bne- loop // loop if carry occurred (predict branch not taken) - - stw r4,4(r3) // store TBL in the low 32 bits of the return value - stw r5,0(r3) // store TBU in the high 32 bits of the return value - - blr -} - - - - -double TBToDoubleNano( U64 startTime, U64 stopTime, double ticksPerNanosecond ); - -#if __MWERKS__ -asm void GetTB( U64 * ); -#else -void GetTB( U64 * ); -#endif - -double TBToDoubleNano( U64 startTime, U64 stopTime, double ticksPerNanosecond ) { - #define K_2POWER32 4294967296.0 - #define TICKS_PER_NANOSECOND 0.025 - double nanoTime; - U64 diffTime; - - // calc the difference in TB ticks - diffTime.hi = stopTime.hi - startTime.hi; - diffTime.lo = stopTime.lo - startTime.lo; - - // convert TB ticks into time - nanoTime = (double)(diffTime.hi)*((double)K_2POWER32) + (double)(diffTime.lo); - nanoTime = nanoTime/ticksPerNanosecond; - return (nanoTime); -} - -TIME_TYPE time_in_millisec( void ) { - #define K_2POWER32 4294967296.0 - #define TICKS_PER_NANOSECOND 0.025 - - U64 the_time; - double nanoTime, milliTime; - - GetTB( &the_time ); - - // convert TB ticks into time - nanoTime = (double)(the_time.hi)*((double)K_2POWER32) + (double)(the_time.lo); - nanoTime = nanoTime/ticksPerNanosecond; - - // nanoseconds are 1 billionth of a second. I want milliseconds - milliTime = nanoTime * 1000000.0; - - printf( "ticks per nanosec -- %lf\n", ticksPerNanosecond ); - printf( "nanoTime is %lf -- milliTime is %lf -- as int is %i\n", nanoTime, milliTime, (int)milliTime ); - - return (int)milliTime; -} - -#define StartRecordTime( start ) \ - start = time_in_millisec(); - -#define StopRecordTime( end ) \ - end = time_in_millisec(); - - -#else #define StartRecordTime( start ) \ start = mach_absolute_time(); #define StopRecordTime( end ) \ end = mach_absolute_time(); -#endif + #else #define TIME_TYPE int diff --git a/neo/sound/snd_local.h b/neo/sound/snd_local.h index 8e8605eb..34b00ebf 100644 --- a/neo/sound/snd_local.h +++ b/neo/sound/snd_local.h @@ -91,9 +91,6 @@ class idSoundWorldLocal; #ifdef WIN32 #pragma pack(1) #endif -#ifdef __MWERKS__ -#pragma pack (push, 1) -#endif struct waveformatex_s { word wFormatTag; /* format type */ word nChannels; /* number of channels (i.e. mono, stereo...) */ @@ -169,9 +166,6 @@ typedef mminfo_s mminfo_t; #ifdef WIN32 #pragma pack() #endif -#ifdef __MWERKS__ -#pragma pack (pop) -#endif /* =================================================================================== diff --git a/neo/sys/platform.h b/neo/sys/platform.h index 3ec88513..6bab71b4 100644 --- a/neo/sys/platform.h +++ b/neo/sys/platform.h @@ -84,12 +84,7 @@ If you have questions concerning this license or the applicable additional terms #define ALIGN16( x ) x __attribute__ ((aligned (16))) -#ifdef __MWERKS__ -#define PACKED -#include -#else #define PACKED __attribute__((packed)) -#endif #define _alloca alloca #define _alloca16( x ) ((void *)((((uintptr_t)alloca( (x)+15 )) + 15) & ~15))