From 65d0196db6f09292c3eb3c106d6ca543ad937e82 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 2 Jul 2023 13:21:48 -0700 Subject: Add a function to set a callback for log messages --- alc/alc.cpp | 5 +++++ alc/export_list.h | 2 ++ alc/inprogext.h | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'alc') diff --git a/alc/alc.cpp b/alc/alc.cpp index 0e1dc637..d36f1891 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -1846,6 +1846,11 @@ ContextRef VerifyContext(ALCcontext *context) } // namespace +FORCE_ALIGN void ALC_APIENTRY alsoft_set_log_callback(LPALSOFTLOGCALLBACK callback, void *userptr) noexcept +{ + al_set_log_callback(callback, userptr); +} + /** Returns a new reference to the currently active context for this thread. */ ContextRef GetContextRef(void) { diff --git a/alc/export_list.h b/alc/export_list.h index 7b347e76..8bedd850 100644 --- a/alc/export_list.h +++ b/alc/export_list.h @@ -367,6 +367,8 @@ inline const FuncExport alcFunctions[]{ DECL(alcEventControlSOFT), DECL(alcEventCallbackSOFT), + + DECL(alsoft_set_log_callback), #ifdef ALSOFT_EAX }, eaxFunctions[]{ DECL(EAXGet), diff --git a/alc/inprogext.h b/alc/inprogext.h index 65e34ea4..60c97536 100644 --- a/alc/inprogext.h +++ b/alc/inprogext.h @@ -460,9 +460,11 @@ void ALC_APIENTRY alcEventCallbackSOFT(ALCEVENTPROCTYPESOFT callback, void *user #endif #endif -/* Non-standard export. Not part of any extension. */ +/* Non-standard exports. Not part of any extension. */ AL_API const ALchar* AL_APIENTRY alsoft_get_version(void) noexcept; +typedef void (ALC_APIENTRY*LPALSOFTLOGCALLBACK)(void *userptr, char level, const char *message, int length) noexcept; +void ALC_APIENTRY alsoft_set_log_callback(LPALSOFTLOGCALLBACK callback, void *userptr) noexcept; /* Functions from abandoned extensions. Only here for binary compatibility. */ AL_API void AL_APIENTRY alSourceQueueBufferLayersSOFT(ALuint src, ALsizei nb, -- cgit v1.2.3