--- portab.h 2006/05/28 07:52:45 1.56 +++ portab.h 2008/11/30 16:38:31 1.58.2.1 @@ -21,7 +21,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: portab.h,v 1.56 2006/05/28 07:52:45 suxen_drol Exp $ + * $Id: portab.h,v 1.58.2.1 2008/11/30 16:38:31 Isibaar Exp $ * ****************************************************************************/ @@ -132,7 +132,7 @@ va_start(args, fmt); vsprintf(buf, fmt, args); va_end(args); - OutputDebugString(buf); + OutputDebugStringA(buf); fprintf(stderr, "%s", buf); } } @@ -153,7 +153,7 @@ /*---------------------------------------------------------------------------- | msvc x86 specific macros/functions *---------------------------------------------------------------------------*/ -# if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64) +# if defined(ARCH_IS_IA32) # define BSWAP(a) __asm mov eax,a __asm bswap eax __asm mov a, eax static __inline int64_t read_counter(void) @@ -169,6 +169,14 @@ return ts; } +# elif defined(ARCH_IS_X86_64) + +# include + +# define BSWAP(a) ((a) = _byteswap_ulong(a)) + +static __inline int64_t read_counter(void) { return __rdtsc(); } + /*---------------------------------------------------------------------------- | msvc GENERIC (plain C only) - Probably alpha or some embedded device *---------------------------------------------------------------------------*/ @@ -360,7 +368,7 @@ /*---------------------------------------------------------------------------- | watcom ia32 specific macros/functions *---------------------------------------------------------------------------*/ -# if defined(ARCH_IS_IA32) +# if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64) # define BSWAP(a) __asm mov eax,a __asm bswap eax __asm mov a, eax