diff options
author | Chris Robinson <[email protected]> | 2023-07-02 13:21:48 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-07-02 13:21:48 -0700 |
commit | 65d0196db6f09292c3eb3c106d6ca543ad937e82 (patch) | |
tree | 042aa7c0c10a2a0bbdd6a067b2778278c90fefc6 /alc | |
parent | 548f7ad80abc253a38171b7e4eb1c84a6b179a41 (diff) |
Add a function to set a callback for log messages
Diffstat (limited to 'alc')
-rw-r--r-- | alc/alc.cpp | 5 | ||||
-rw-r--r-- | alc/export_list.h | 2 | ||||
-rw-r--r-- | alc/inprogext.h | 4 |
3 files changed, 10 insertions, 1 deletions
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, |