From cb942c4e89a133628106c7488ff6802120db864a Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Tue, 14 Apr 2020 15:43:30 +0200 Subject: [PATCH] Rename C interface for getting last exception --- CInterface/Core.cpp | 2 +- CInterface/Core.hpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CInterface/Core.cpp b/CInterface/Core.cpp index c097023..beca1ae 100644 --- a/CInterface/Core.cpp +++ b/CInterface/Core.cpp @@ -1,4 +1,4 @@ #include "Core.hpp" std::string ExceptionHandler::_lastException = ""; -export const char* GetLastException() { return ExceptionHandler::GetLastException(); } +export const char* CreatureLib_C_GetLastException() { return ExceptionHandler::GetLastException(); } diff --git a/CInterface/Core.hpp b/CInterface/Core.hpp index 966e3ed..76e5995 100644 --- a/CInterface/Core.hpp +++ b/CInterface/Core.hpp @@ -6,6 +6,8 @@ #include #define export extern "C" +#define CreatureLibException 1; + class ExceptionHandler { static std::string _lastException; @@ -20,7 +22,7 @@ public: return 0; \ } catch (const std::exception& e) { \ ExceptionHandler::SetLastException(e); \ - return 1; \ + return CreatureLibException; \ } #endif // CREATURELIB_CORE_HPP