* x86 OS X support

This commit is contained in:
Tim Angus 2006-01-15 15:22:13 +00:00
parent b06643f41d
commit e74947be2c
5 changed files with 21 additions and 19 deletions

View file

@ -170,7 +170,7 @@ _asm {
#else //!_MSC_VER #else //!_MSC_VER
#ifdef __MINGW32__ // _ is prepended to compiled symbols #if defined(__MINGW32__) || defined(MACOS_X) // _ is prepended to compiled symbols
#define CMANG(sym) "_"#sym #define CMANG(sym) "_"#sym
#else #else
#define CMANG(sym) #sym #define CMANG(sym) #sym
@ -1174,13 +1174,13 @@ int VM_CallCompiled( vm_t *vm, int *args ) {
memOpStack = opStack; memOpStack = opStack;
memEntryPoint = entryPoint; memEntryPoint = entryPoint;
__asm__(" pushal \r\n" \ __asm__(" pushal \n" \
" movl %0,%%esi \r\n" \ " movl %0,%%esi \n" \
" movl %1,%%edi \r\n" \ " movl %1,%%edi \n" \
" call *%2 \r\n" \ " call *%2 \n" \
" movl %%esi,%0 \r\n" \ " movl %%esi,%0 \n" \
" movl %%edi,%1 \r\n" \ " movl %%edi,%1 \n" \
" popal \r\n" \ " popal \n" \
: "=m" (memProgramStack), "=m" (memOpStack) \ : "=m" (memProgramStack), "=m" (memOpStack) \
: "m" (memEntryPoint), "m" (memProgramStack), "m" (memOpStack) \ : "m" (memEntryPoint), "m" (memProgramStack), "m" (memOpStack) \
: "si", "di" \ : "si", "di" \

View file

@ -93,6 +93,7 @@ char *basepath( char *fname )
/* memmove is defined here because some vendors don't provide it at /* memmove is defined here because some vendors don't provide it at
all and others do a terrible job (like calling malloc) */ all and others do a terrible job (like calling malloc) */
// -- ouch, that hurts -- ln // -- ouch, that hurts -- ln
#ifndef MACOS_X /* always use the system memmove() on Mac OS X. --ryan. */
#ifdef memmove #ifdef memmove
#undef memmove #undef memmove
#endif #endif
@ -118,3 +119,4 @@ memmove(void *dp, const void *sp, size_t n)
} }
return 0; return 0;
} }
#endif

View file

@ -33,7 +33,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
.data .data
temp: .float 0.0 temp: .single 0.0
fpucw: .long 0 fpucw: .long 0
// Precision Control Field , 2 bits / 0x0300 // Precision Control Field , 2 bits / 0x0300
@ -63,7 +63,7 @@ cw0F7F: .long 0x0F7F
// int qftol( void ) - default control word // int qftol( void ) - default control word
// //
.global C(qftol) .globl C(qftol)
C(qftol): C(qftol):
fistpl temp fistpl temp
@ -75,7 +75,7 @@ C(qftol):
// int qftol027F( void ) - DirectX FPU // int qftol027F( void ) - DirectX FPU
// //
.global C(qftol027F) .globl C(qftol027F)
C(qftol027F): C(qftol027F):
fnstcw fpucw fnstcw fpucw
@ -89,7 +89,7 @@ C(qftol027F):
// int qftol037F( void ) - Linux FPU // int qftol037F( void ) - Linux FPU
// //
.global C(qftol037F) .globl C(qftol037F)
C(qftol037F): C(qftol037F):
fnstcw fpucw fnstcw fpucw
@ -104,7 +104,7 @@ C(qftol037F):
// int qftol0F7F( void ) - ANSI // int qftol0F7F( void ) - ANSI
// //
.global C(qftol0F7F) .globl C(qftol0F7F)
C(qftol0F7F): C(qftol0F7F):
fnstcw fpucw fnstcw fpucw
@ -118,7 +118,7 @@ C(qftol0F7F):
// int qftol0E7F( void ) // int qftol0E7F( void )
// //
.global C(qftol0E7F) .globl C(qftol0E7F)
C(qftol0E7F): C(qftol0E7F):
fnstcw fpucw fnstcw fpucw
@ -134,7 +134,7 @@ C(qftol0E7F):
// long Q_ftol( float q ) // long Q_ftol( float q )
// //
.global C(Q_ftol) .globl C(Q_ftol)
C(Q_ftol): C(Q_ftol):
flds 4(%esp) flds 4(%esp)
@ -147,7 +147,7 @@ C(Q_ftol):
// long qftol0F7F( float q ) - Linux FPU // long qftol0F7F( float q ) - Linux FPU
// //
.global C(Q_ftol0F7F) .globl C(Q_ftol0F7F)
C(Q_ftol0F7F): C(Q_ftol0F7F):
fnstcw fpucw fnstcw fpucw

View file

@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "../qcommon/q_platform.h" #include "../qcommon/q_platform.h"
#ifdef __MINGW32__ #if defined(__MINGW32__) || defined(MACOS_X)
#undef ELF #undef ELF
#endif #endif

View file

@ -46,7 +46,7 @@ cw037F: .long 0x037F
.text .text
// void Sys_SnapVector( float *v ) // void Sys_SnapVector( float *v )
.global C(Sys_SnapVector) .globl C(Sys_SnapVector)
C(Sys_SnapVector): C(Sys_SnapVector):
pushl %eax pushl %eax
pushl %ebp pushl %ebp
@ -74,7 +74,7 @@ C(Sys_SnapVector):
ret ret
// void Sys_SnapVectorCW( float *v, unsigned short int cw ) // void Sys_SnapVectorCW( float *v, unsigned short int cw )
.global C(Sys_SnapVectorCW) .globl C(Sys_SnapVectorCW)
C(Sys_SnapVectorCW): C(Sys_SnapVectorCW):
pushl %eax pushl %eax
pushl %ebp pushl %ebp