|
From: Terry T. <ter...@us...> - 2005-01-03 00:45:46
|
Update of /cvsroot/frontierkernel/Frontier/Common/headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15014/Frontier/Common/headers Modified Files: macconv.h Log Message: GNU by default uses the AT&T assembly code syntax; MSC/MWERKS uses the Intel assembly code syntax; some versions of 'gcc' accept -masm=att|intel to specify which syntax to use; but for those that don't... Index: macconv.h =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/headers/macconv.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** macconv.h 23 Oct 2004 21:54:09 -0000 1.2 --- macconv.h 3 Jan 2005 00:45:37 -0000 1.3 *************** *** 88,92 **** static long dolongswap(long foo) { ! //#ifndef __MWERKS__ _asm { --- 88,103 ---- static long dolongswap(long foo) { ! #if defined(__i386__) && defined(__GNUC__) ! /* ! 10.0a5 - TRT - 29 Dec 2004 ! GNU by default uses the AT&T assembly code syntax; ! MSC/MWERKS uses the Intel assembly code syntax; ! some versions of 'gcc' accept -masm=att|intel to ! specify which syntax to use; but for those that don't... ! */ ! __asm__("mov foo,%eax\nbswap %eax\nmov %eax,foo\n"); ! #elif defined(__powerpc__) && defined(__GNUC__) ! foo = Endian32_Swap(foo); ! #else _asm { *************** *** 95,99 **** mov foo,eax } ! //#endif return (foo); } --- 106,110 ---- mov foo,eax } ! #endif return (foo); } *************** *** 101,104 **** --- 112,127 ---- static short doshortswap(short foo) { + #if defined(__i386__) && defined(__GNUC__) + /* + 10.0a5 - TRT - 29 Dec 2004 + GNU by default uses the AT&T assembly code syntax; + MSC/MWERKS uses the Intel assembly code syntax; + some versions of 'gcc' accept -masm=att|intel to + specify which syntax to use; but for those that don't... + */ + __asm__("mov foo,%ax\n mov %al,%bh\nmov %ah,%bl\nmov %bx,foo"); + #elif defined(__powerpc__) && defined(__GNUC__) + foo = Endian16_Swap(foo); + #else _asm { *************** *** 108,111 **** --- 131,135 ---- mov foo,bx } + #endif return (foo); } |