Rework of C Interface exception handler.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
a4bb8864a0
commit
418d811d18
|
@ -1,4 +1,4 @@
|
||||||
#include "Core.hpp"
|
#include "Core.hpp"
|
||||||
|
|
||||||
std::string ExceptionHandler::_lastException = "";
|
char* ExceptionHandler::_lastException = 0;
|
||||||
export const char* CreatureLib_C_GetLastException() { return ExceptionHandler::GetLastException(); }
|
export const char* CreatureLib_C_GetLastException() { return ExceptionHandler::GetLastException(); }
|
||||||
|
|
|
@ -9,11 +9,11 @@
|
||||||
#define CreatureLibException 1;
|
#define CreatureLibException 1;
|
||||||
|
|
||||||
class ExceptionHandler {
|
class ExceptionHandler {
|
||||||
static std::string _lastException;
|
static char* _lastException;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void SetLastException(const std::exception& e) { _lastException = std::string(e.what()); }
|
static void SetLastException(const std::exception& e) { _lastException = strcpy(_lastException, e.what()); }
|
||||||
static const char* GetLastException() { return _lastException.c_str(); }
|
static const char* GetLastException() { return _lastException; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#define Try(data) \
|
#define Try(data) \
|
||||||
|
|
Loading…
Reference in New Issue