From d4136c93448bfdd8561af331ea6eebcec14719e3 Mon Sep 17 00:00:00 2001 From: Simon Kallweit <64953474+skallweitNV@users.noreply.github.com> Date: Fri, 6 Dec 2024 00:46:56 +0100 Subject: Add API for getting last internal error message (#5772) * Add API for getting last internal error message * format code (#5773) Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> * make message thread_local --------- Co-authored-by: slangbot Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --- include/slang.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/slang.h b/include/slang.h index ee9fb7650..2dfee6b28 100644 --- a/include/slang.h +++ b/include/slang.h @@ -4415,6 +4415,10 @@ SLANG_API ISlangBlob* slang_getEmbeddedCoreModule(); */ SLANG_EXTERN_C SLANG_API void slang_shutdown(); +/* Return the last signaled internal error message. + */ +SLANG_EXTERN_C SLANG_API const char* slang_getLastInternalErrorMessage(); + namespace slang { inline SlangResult createGlobalSession(slang::IGlobalSession** outGlobalSession) @@ -4425,6 +4429,10 @@ inline void shutdown() { slang_shutdown(); } +inline const char* getLastInternalErrorMessage() +{ + return slang_getLastInternalErrorMessage(); +} } // namespace slang #endif // C++ helpers -- cgit v1.2.3