Rename C interface for getting last exception
continuous-integration/drone/push Build is passing

This commit is contained in:
Deukhoofd committed 2020-04-14 15:43:30 +02:00
1 parent e35f860b84
commit cb942c4e89
2 files changed
+4 -2

No files matched your search

+1 -1
View File
@@ -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(); }
+3 -1
View File
@@ -6,6 +6,8 @@
#include <string>
#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