al_print doesn't need to be inline
This commit is contained in:
parent
505f61ff43
commit
f22b02a762
24
Alc/ALc.c
24
Alc/ALc.c
@ -443,6 +443,30 @@ DECL_APPEND_LIST_FUNC(AllDevice)
|
||||
DECL_APPEND_LIST_FUNC(CaptureDevice)
|
||||
|
||||
|
||||
void al_print(const char *fname, unsigned int line, const char *fmt, ...)
|
||||
{
|
||||
const char *fn;
|
||||
char str[256];
|
||||
int i;
|
||||
|
||||
fn = strrchr(fname, '/');
|
||||
if(!fn) fn = strrchr(fname, '\\');;
|
||||
if(!fn) fn = fname;
|
||||
else fn += 1;
|
||||
|
||||
i = snprintf(str, sizeof(str), "AL lib: %s:%d: ", fn, line);
|
||||
if(i < (int)sizeof(str) && i > 0)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
vsnprintf(str+i, sizeof(str)-i, fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
str[sizeof(str)-1] = 0;
|
||||
|
||||
fprintf(stderr, "%s", str);
|
||||
}
|
||||
|
||||
void EnableRTPrio(ALint level)
|
||||
{
|
||||
ALboolean failed;
|
||||
|
@ -151,31 +151,6 @@ static inline void Sleep(ALuint t)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static __inline PRINTF_STYLE(3,4) void al_print(const char *fname, unsigned int line, const char *fmt, ...)
|
||||
{
|
||||
const char *fn;
|
||||
char str[256];
|
||||
int i;
|
||||
|
||||
fn = strrchr(fname, '/');
|
||||
if(!fn) fn = strrchr(fname, '\\');;
|
||||
if(!fn) fn = fname;
|
||||
else fn += 1;
|
||||
|
||||
i = snprintf(str, sizeof(str), "AL lib: %s:%d: ", fn, line);
|
||||
if(i < (int)sizeof(str) && i > 0)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
vsnprintf(str+i, sizeof(str)-i, fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
str[sizeof(str)-1] = 0;
|
||||
|
||||
fprintf(stderr, "%s", str);
|
||||
}
|
||||
#define AL_PRINT(...) al_print(__FILE__, __LINE__, __VA_ARGS__)
|
||||
|
||||
|
||||
#define SWMIXER_OUTPUT_RATE 44100
|
||||
|
||||
@ -397,6 +372,10 @@ void EnableRTPrio(ALint level);
|
||||
void SetDefaultChannelOrder(ALCdevice *device);
|
||||
void SetDefaultWFXChannelOrder(ALCdevice *device);
|
||||
|
||||
void al_print(const char *fname, unsigned int line, const char *fmt, ...)
|
||||
PRINTF_STYLE(3,4);
|
||||
#define AL_PRINT(...) al_print(__FILE__, __LINE__, __VA_ARGS__)
|
||||
|
||||
ALCboolean ALCAPIENTRY alcMakeCurrent(ALCcontext *context);
|
||||
ALCcontext* ALCAPIENTRY alcGetThreadContext(void);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user