aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-01-12 09:05:57 -0800
committerChris Robinson <[email protected]>2010-01-12 09:05:57 -0800
commitf22b02a76250a34af351d25f5ebbf924d24e17eb (patch)
treed2a3580ac204584354a2838fec055d27223b662c /Alc
parent505f61ff43f89c1e5fb63cd75c5e607343306ba6 (diff)
al_print doesn't need to be inline
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALc.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index fb771b24..290e9593 100644
--- a/Alc/ALc.c
+++ b/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;