win64 fixes
authorJosh Coalson <jcoalson@users.sourceforce.net>
Tue, 3 Jun 2008 06:35:09 +0000 (06:35 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Tue, 3 Jun 2008 06:35:09 +0000 (06:35 +0000)
src/libFLAC/bitreader.c

index d371049..b73609f 100644 (file)
@@ -151,11 +151,14 @@ struct FLAC__BitReader {
 
 #ifdef _MSC_VER
 /* OPT: an MSVC built-in would be better */
+/* OPT: use _byteswap_ulong intrinsic? */
 static _inline FLAC__uint32 local_swap32_(FLAC__uint32 x)
 {
        x = ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
        return (x>>16) | (x<<16);
 }
+#ifdef _WIN64
+#else
 static void local_swap32_block_(FLAC__uint32 *start, FLAC__uint32 len)
 {
        __asm {
@@ -263,7 +266,7 @@ FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br)
 #if WORDS_BIGENDIAN
 #else
        end = (br->words*FLAC__BYTES_PER_WORD + br->bytes + bytes + (FLAC__BYTES_PER_WORD-1)) / FLAC__BYTES_PER_WORD;
-# if defined(_MSC_VER) && (FLAC__BYTES_PER_WORD == 4)
+# if defined(_MSC_VER) && !defined(_WIN64) && (FLAC__BYTES_PER_WORD == 4)
        if(br->cpu_info.type == FLAC__CPUINFO_TYPE_IA32 && br->cpu_info.data.ia32.bswap) {
                start = br->words;
                local_swap32_block_(br->buffer + start, end - start);