Commit 2737f6a8 authored by Josh Coalson's avatar Josh Coalson
Browse files

win64 fixes

parent 3b938ac1
...@@ -151,11 +151,14 @@ struct FLAC__BitReader { ...@@ -151,11 +151,14 @@ struct FLAC__BitReader {
#ifdef _MSC_VER #ifdef _MSC_VER
/* OPT: an MSVC built-in would be better */ /* OPT: an MSVC built-in would be better */
/* OPT: use _byteswap_ulong intrinsic? */
static _inline FLAC__uint32 local_swap32_(FLAC__uint32 x) static _inline FLAC__uint32 local_swap32_(FLAC__uint32 x)
{ {
x = ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); x = ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
return (x>>16) | (x<<16); return (x>>16) | (x<<16);
} }
#ifdef _WIN64
#else
static void local_swap32_block_(FLAC__uint32 *start, FLAC__uint32 len) static void local_swap32_block_(FLAC__uint32 *start, FLAC__uint32 len)
{ {
__asm { __asm {
...@@ -263,7 +266,7 @@ FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br) ...@@ -263,7 +266,7 @@ FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br)
#if WORDS_BIGENDIAN #if WORDS_BIGENDIAN
#else #else
end = (br->words*FLAC__BYTES_PER_WORD + br->bytes + bytes + (FLAC__BYTES_PER_WORD-1)) / FLAC__BYTES_PER_WORD; 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) { if(br->cpu_info.type == FLAC__CPUINFO_TYPE_IA32 && br->cpu_info.data.ia32.bswap) {
start = br->words; start = br->words;
local_swap32_block_(br->buffer + start, end - start); local_swap32_block_(br->buffer + start, end - start);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment