Mac compat ..

This was SVN commit r4287.
This commit is contained in:
dave 2006-09-02 17:21:49 +00:00
parent 3ea971b87f
commit 0ffabbc5dc
5 changed files with 15 additions and 16 deletions

View File

@ -34,8 +34,7 @@
#else
// unix/linux/glibc/gcc says that this macro has to be defined when including
// stdint.h from C++ for stdint.h to define SIZE_MAX and friends
# ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
# endif
# include <stdint.h>
#ifndef SIZE_MAX
#define SIZE_MAX ((size_t)-1)
#endif
#endif // #if OS_WIN

View File

@ -307,7 +307,7 @@ void stats_dump()
"Accessed files: %u (%g MB) -- %u%% of data set\n"
"Max. concurrent: %u; leaked: %u.\n",
unique_names, unique_name_len_total/1000,
opened_files.size(), opened_file_size_total/MB, percent(opened_files.size(), vfs_files),
opened_files.size(), opened_file_size_total/MB, percent(opened_files.size(), (size_t)vfs_files),
open_files_max, open_files_cur
);

View File

@ -256,7 +256,7 @@ static LibError alc_init()
// ignore
}
#else
alc_dev = alcOpenDevice((ALubyte*)alc_dev_name);
alc_dev = alcOpenDevice((ALCchar*)alc_dev_name);
#endif
if(alc_dev)
@ -677,7 +677,7 @@ static const char * devs;
*/
LibError snd_dev_prepare_enum()
{
if(alcIsExtensionPresent(0, (ALubyte*)"ALC_ENUMERATION_EXT") != AL_TRUE)
if(alcIsExtensionPresent(0, (ALCchar*)"ALC_ENUMERATION_EXT") != AL_TRUE)
WARN_RETURN(ERR_NO_SYS);
devs = (const char*)alcGetString(0, ALC_DEVICE_SPECIFIER);
@ -1822,10 +1822,10 @@ static void vsrc_latch(VSrc * vs)
#ifndef NDEBUG
// paranoid value checking; helps determine which parameter is
// the problem when the below AL_CHECK fails.
debug_assert(!isnan(vs->pos[0]) && !isnan(vs->pos[1]) && !isnan(vs->pos[2]));
debug_assert(!std::isnan(vs->pos[0]) && !std::isnan(vs->pos[1]) && !std::isnan(vs->pos[2]));
debug_assert(vs->relative == AL_TRUE || vs->relative == AL_FALSE);
debug_assert(!isnan(vs->gain));
debug_assert(!isnan(vs->pitch) && vs->pitch > 0.0f);
debug_assert(!std::isnan(vs->gain));
debug_assert(!std::isnan(vs->pitch) && vs->pitch > 0.0f);
debug_assert(vs->loop == AL_TRUE || vs->loop == AL_FALSE);
#endif

View File

@ -25,7 +25,7 @@
#include <string.h>
#include "lib.h"
#include "posix.h" // SIZE_MAX
#include "posix_types.h" // SIZE_MAX
// written against http://std.dkuug.dk/jtc1/sc22/wg14/www/docs/n1031.pdf .

View File

@ -48,10 +48,10 @@ typedef unsigned int PS_uint;
// the standard only guarantees 16 bits.
// we use this for memory offsets and ranges, so it better be big enough.
#ifdef SIZE_MAX
# if SIZE_MAX < 0xFFFFFFFF
# error "check size_t and SIZE_MAX - too small?"
# endif
#endif
//#ifdef SIZE_MAX
//# if SIZE_MAX < 0xFFFFFFFF
//# error "check size_t and SIZE_MAX - too small?"
//# endif
//#endif
#endif // #ifndef __TYPES_H__