This commit is contained in:
2 files changed
+4
-4
No files matched your search
+1
-1
@@ -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(); }
|
||||||
+3
-3
@@ -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) \
|
||||||
|
|||||||
Reference in new issue
Block a user