mirror of
https://github.com/azahar-emu/soundtouch
synced 2025-11-07 07:30:02 +01:00
x64bit compilation support
This commit is contained in:
parent
684e772e46
commit
8f20fed87c
@ -250,7 +250,7 @@ int WavInFile::read(char *buffer, int maxElems)
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert(buffer);
|
assert(buffer);
|
||||||
numBytes = fread(buffer, 1, numBytes, fptr);
|
numBytes = (int)fread(buffer, 1, numBytes, fptr);
|
||||||
dataRead += numBytes;
|
dataRead += numBytes;
|
||||||
|
|
||||||
return numBytes;
|
return numBytes;
|
||||||
@ -300,7 +300,7 @@ int WavInFile::read(short *buffer, int maxElems)
|
|||||||
assert(numBytes >= 0);
|
assert(numBytes >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
numBytes = fread(buffer, 1, numBytes, fptr);
|
numBytes = (int)fread(buffer, 1, numBytes, fptr);
|
||||||
dataRead += numBytes;
|
dataRead += numBytes;
|
||||||
numElems = numBytes / 2;
|
numElems = numBytes / 2;
|
||||||
|
|
||||||
@ -652,7 +652,7 @@ void WavOutFile::writeHeader()
|
|||||||
|
|
||||||
// write the supplemented header in the beginning of the file
|
// write the supplemented header in the beginning of the file
|
||||||
fseek(fptr, 0, SEEK_SET);
|
fseek(fptr, 0, SEEK_SET);
|
||||||
res = fwrite(&hdrTemp, sizeof(hdrTemp), 1, fptr);
|
res = (int)fwrite(&hdrTemp, sizeof(hdrTemp), 1, fptr);
|
||||||
if (res != 1)
|
if (res != 1)
|
||||||
{
|
{
|
||||||
throw runtime_error("Error while writing to a wav file.");
|
throw runtime_error("Error while writing to a wav file.");
|
||||||
@ -674,7 +674,7 @@ void WavOutFile::write(const char *buffer, int numElems)
|
|||||||
}
|
}
|
||||||
assert(sizeof(char) == 1);
|
assert(sizeof(char) == 1);
|
||||||
|
|
||||||
res = fwrite(buffer, 1, numElems, fptr);
|
res = (int)fwrite(buffer, 1, numElems, fptr);
|
||||||
if (res != numElems)
|
if (res != numElems)
|
||||||
{
|
{
|
||||||
throw runtime_error("Error while writing to a wav file.");
|
throw runtime_error("Error while writing to a wav file.");
|
||||||
@ -721,7 +721,7 @@ void WavOutFile::write(const short *buffer, int numElems)
|
|||||||
memcpy(pTemp, buffer, numElems * 2);
|
memcpy(pTemp, buffer, numElems * 2);
|
||||||
_swap16Buffer(pTemp, numElems);
|
_swap16Buffer(pTemp, numElems);
|
||||||
|
|
||||||
res = fwrite(pTemp, 2, numElems, fptr);
|
res = (int)fwrite(pTemp, 2, numElems, fptr);
|
||||||
|
|
||||||
delete[] pTemp;
|
delete[] pTemp;
|
||||||
|
|
||||||
|
|||||||
@ -71,7 +71,9 @@ uint detectCPUextensions(void)
|
|||||||
|
|
||||||
if (_dwDisabledISA == 0xffffffff) return 0;
|
if (_dwDisabledISA == 0xffffffff) return 0;
|
||||||
|
|
||||||
_asm
|
#ifndef _M_X64
|
||||||
|
// 32bit compilation, detect CPU capabilities with inline assembler.
|
||||||
|
__asm
|
||||||
{
|
{
|
||||||
; check if 'cpuid' instructions is available by toggling eflags bit 21
|
; check if 'cpuid' instructions is available by toggling eflags bit 21
|
||||||
;
|
;
|
||||||
@ -125,5 +127,13 @@ uint detectCPUextensions(void)
|
|||||||
mov res, esi
|
mov res, esi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
// Visual C++ 64bit compilation doesn't support inline assembler. However,
|
||||||
|
// all x64 compatible CPUs support MMX & SSE extensions.
|
||||||
|
res = SUPPORT_MMX | SUPPORT_SSE | SUPPORT_SSE2;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
return res & ~_dwDisabledISA;
|
return res & ~_dwDisabledISA;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user