MSVC2005 buildfix

This commit is contained in:
twinaphex 2021-09-23 22:50:13 +02:00
parent 3d0c7a12df
commit 13d213f36f
5 changed files with 31 additions and 24 deletions

View File

@ -542,7 +542,9 @@ INCLUDE := $(shell IFS=$$'\n'; cygpath -w "$(VS80COMNTOOLS)../../VC/include")
LIB := $(shell IFS=$$'\n'; cygpath -w "$(VS80COMNTOOLS)../../VC/lib")
BIN := $(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../../VC/bin")
WindowsSdkDir := $(shell reg query "HKLM\SOFTWARE\Microsoft\MicrosoftSDK\InstalledSDKs\8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3" -v "Install Dir" | grep -o '[A-Z]:\\.*')
#WindowsSdkDir := $(shell reg query "HKLM\SOFTWARE\Microsoft\MicrosoftSDK\InstalledSDKs\8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3" -v "Install Dir" | grep -o '[A-Z]:\\.*')
WindowsSdkDir := $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')
HAVE_CDROM = 1
@ -553,6 +555,7 @@ WindowsSDKGlIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\gl")
WindowsSDKMfcIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\mfc")
WindowsSDKLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib")
INCFLAGS_PLATFORM = -I"$(WindowsSDKIncludeDir)"
export INCLUDE := $(INCLUDE);$(WindowsSDKIncludeDir);$(WindowsSDKAtlIncludeDir);$(WindowsSDKCrtIncludeDir);$(WindowsSDKGlIncludeDir);$(WindowsSDKMfcIncludeDir);libretro-common/include/compat/msvc
export LIB := $(LIB);$(WindowsSDKLibDir)
TARGET := $(TARGET_NAME)_libretro.dll

View File

@ -72,12 +72,12 @@ void ecc_clear(uint8_t *sector);
INLINE FUNCTIONS
***************************************************************************/
static inline uint32_t msf_to_lba(uint32_t msf)
static INLINE uint32_t msf_to_lba(uint32_t msf)
{
return ( ((msf&0x00ff0000)>>16) * 60 * 75) + (((msf&0x0000ff00)>>8) * 75) + ((msf&0x000000ff)>>0);
}
static inline uint32_t lba_to_msf(uint32_t lba)
static INLINE uint32_t lba_to_msf(uint32_t lba)
{
uint8_t m, s, f;
@ -96,7 +96,7 @@ static inline uint32_t lba_to_msf(uint32_t lba)
* Angelo also says PCE tracks often start playing at the
* wrong address.. related?
**/
static inline uint32_t lba_to_msf_alt(int lba)
static INLINE uint32_t lba_to_msf_alt(int lba)
{
uint32_t ret = 0;

View File

@ -304,7 +304,7 @@ static const uint16_t qoffsets[ECC_Q_NUM_BYTES][ECC_Q_COMP] =
*-------------------------------------------------
*/
static inline uint8_t ecc_source_byte(const uint8_t *sector, uint32_t offset)
static INLINE uint8_t ecc_source_byte(const uint8_t *sector, uint32_t offset)
{
/* in mode 2 always treat these as 0 bytes */
return (sector[MODE_OFFSET] == 2 && offset < 4) ? 0x00 : sector[SYNC_OFFSET + SYNC_NUM_BYTES + offset];

View File

@ -944,7 +944,7 @@ static const codec_interface codec_interfaces[] =
the data stream in bigendian order
-------------------------------------------------*/
static inline UINT64 get_bigendian_uint64(const UINT8 *base)
static INLINE UINT64 get_bigendian_uint64(const UINT8 *base)
{
return ((UINT64)base[0] << 56) | ((UINT64)base[1] << 48) | ((UINT64)base[2] << 40) | ((UINT64)base[3] << 32) |
((UINT64)base[4] << 24) | ((UINT64)base[5] << 16) | ((UINT64)base[6] << 8) | (UINT64)base[7];
@ -955,7 +955,7 @@ static inline UINT64 get_bigendian_uint64(const UINT8 *base)
the data stream in bigendian order
-------------------------------------------------*/
static inline void put_bigendian_uint64(UINT8 *base, UINT64 value)
static INLINE void put_bigendian_uint64(UINT8 *base, UINT64 value)
{
base[0] = value >> 56;
base[1] = value >> 48;
@ -972,7 +972,7 @@ static inline void put_bigendian_uint64(UINT8 *base, UINT64 value)
the data stream in bigendian order
-------------------------------------------------*/
static inline UINT64 get_bigendian_uint48(const UINT8 *base)
static INLINE UINT64 get_bigendian_uint48(const UINT8 *base)
{
return ((UINT64)base[0] << 40) | ((UINT64)base[1] << 32) |
((UINT64)base[2] << 24) | ((UINT64)base[3] << 16) | ((UINT64)base[4] << 8) | (UINT64)base[5];
@ -983,7 +983,7 @@ static inline UINT64 get_bigendian_uint48(const UINT8 *base)
the data stream in bigendian order
-------------------------------------------------*/
static inline void put_bigendian_uint48(UINT8 *base, UINT64 value)
static INLINE void put_bigendian_uint48(UINT8 *base, UINT64 value)
{
value &= 0xffffffffffff;
base[0] = value >> 40;
@ -998,7 +998,7 @@ static inline void put_bigendian_uint48(UINT8 *base, UINT64 value)
the data stream in bigendian order
-------------------------------------------------*/
static inline UINT32 get_bigendian_uint32(const UINT8 *base)
static INLINE UINT32 get_bigendian_uint32(const UINT8 *base)
{
return (base[0] << 24) | (base[1] << 16) | (base[2] << 8) | base[3];
}
@ -1008,7 +1008,7 @@ static inline UINT32 get_bigendian_uint32(const UINT8 *base)
the data stream in bigendian order
-------------------------------------------------*/
static inline void put_bigendian_uint32(UINT8 *base, UINT32 value)
static INLINE void put_bigendian_uint32(UINT8 *base, UINT32 value)
{
base[0] = value >> 24;
base[1] = value >> 16;
@ -1021,7 +1021,7 @@ static inline void put_bigendian_uint32(UINT8 *base, UINT32 value)
the data stream in bigendian order
-------------------------------------------------*/
static inline void put_bigendian_uint24(UINT8 *base, UINT32 value)
static INLINE void put_bigendian_uint24(UINT8 *base, UINT32 value)
{
value &= 0xffffff;
base[0] = value >> 16;
@ -1034,7 +1034,7 @@ static inline void put_bigendian_uint24(UINT8 *base, UINT32 value)
the data stream in bigendian order
-------------------------------------------------*/
static inline UINT32 get_bigendian_uint24(const UINT8 *base)
static INLINE UINT32 get_bigendian_uint24(const UINT8 *base)
{
return (base[0] << 16) | (base[1] << 8) | base[2];
}
@ -1044,7 +1044,7 @@ static inline UINT32 get_bigendian_uint24(const UINT8 *base)
the data stream in bigendian order
-------------------------------------------------*/
static inline UINT16 get_bigendian_uint16(const UINT8 *base)
static INLINE UINT16 get_bigendian_uint16(const UINT8 *base)
{
return (base[0] << 8) | base[1];
}
@ -1054,7 +1054,7 @@ static inline UINT16 get_bigendian_uint16(const UINT8 *base)
the data stream in bigendian order
-------------------------------------------------*/
static inline void put_bigendian_uint16(UINT8 *base, UINT16 value)
static INLINE void put_bigendian_uint16(UINT8 *base, UINT16 value)
{
base[0] = value >> 8;
base[1] = value;
@ -1065,7 +1065,7 @@ static inline void put_bigendian_uint16(UINT8 *base, UINT16 value)
entry from the datastream
-------------------------------------------------*/
static inline void map_extract(const UINT8 *base, map_entry *entry)
static INLINE void map_extract(const UINT8 *base, map_entry *entry)
{
entry->offset = get_bigendian_uint64(&base[0]);
entry->crc = get_bigendian_uint32(&base[8]);
@ -1078,7 +1078,7 @@ static inline void map_extract(const UINT8 *base, map_entry *entry)
entry to the datastream
-------------------------------------------------*/
static inline void map_assemble(UINT8 *base, map_entry *entry)
static INLINE void map_assemble(UINT8 *base, map_entry *entry)
{
put_bigendian_uint64(&base[0], entry->offset);
put_bigendian_uint32(&base[8], entry->crc);
@ -1090,7 +1090,7 @@ static inline void map_assemble(UINT8 *base, map_entry *entry)
/*-------------------------------------------------
map_size_v5 - calculate CHDv5 map size
-------------------------------------------------*/
static inline int map_size_v5(chd_header* header)
static INLINE int map_size_v5(chd_header* header)
{
return header->hunkcount * header->mapentrybytes;
}
@ -1149,7 +1149,7 @@ uint16_t crc16(const void *data, uint32_t length)
/*-------------------------------------------------
compressed - test if CHD file is compressed
+-------------------------------------------------*/
static inline int chd_compressed(chd_header* header) {
static INLINE int chd_compressed(chd_header* header) {
return header->compression[0] != CHD_CODEC_NONE;
}
@ -1319,7 +1319,7 @@ static chd_error decompress_v5_map(chd_file* chd, chd_header* header)
entry in old format from the datastream
-------------------------------------------------*/
static inline void map_extract_old(const UINT8 *base, map_entry *entry, UINT32 hunkbytes)
static INLINE void map_extract_old(const UINT8 *base, map_entry *entry, UINT32 hunkbytes)
{
entry->offset = get_bigendian_uint64(&base[0]);
entry->crc = 0;
@ -2268,8 +2268,9 @@ static chd_error hunk_read_into_memory(chd_file *chd, UINT32 hunknum, UINT8 *des
{
blockoffs = (uint64_t)get_bigendian_uint32(rawmap) * (uint64_t)chd->header.hunkbytes;
if (blockoffs != 0) {
int result;
core_fseek(chd->file, blockoffs, SEEK_SET);
int result = core_fread(chd->file, dest, chd->header.hunkbytes);
result = core_fread(chd->file, dest, chd->header.hunkbytes);
/* TODO
else if (m_parent_missing)
throw CHDERR_REQUIRES_PARENT; */

View File

@ -126,9 +126,13 @@ int flac_decoder_reset(flac_decoder* decoder, uint32_t sample_rate, uint8_t num_
* sound stream
*-------------------------------------------------
*/
#define BUFFER 2352 /* bytes per CD audio sector */
int flac_decoder_decode_interleaved(flac_decoder* decoder, int16_t *samples, uint32_t num_samples, int swap_endian)
{
int16_t buffer[BUFFER];
uint32_t buf_samples = 0;
/* configure the uncompressed buffer */
memset(decoder->uncompressed_start, 0, sizeof(decoder->uncompressed_start));
decoder->uncompressed_start[0] = samples;
@ -136,9 +140,8 @@ int flac_decoder_decode_interleaved(flac_decoder* decoder, int16_t *samples, uin
decoder->uncompressed_length = num_samples;
decoder->uncompressed_swap = swap_endian;
#define BUFFER 2352 /* bytes per CD audio sector */
int16_t buffer[BUFFER];
uint32_t buf_samples = BUFFER / channels(decoder);
buf_samples = BUFFER / channels(decoder);
/* loop until we get everything we want */
while (decoder->uncompressed_offset < decoder->uncompressed_length) {
uint32_t frames = (num_samples < buf_samples ? num_samples : buf_samples);