Changes PkmnLibException.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-07-30 20:06:41 +02:00
parent 90c33bfef0
commit 770d3be466
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
2 changed files with 5 additions and 6 deletions

View File

@ -1,4 +1,4 @@
#include "Core.hpp"
std::string ExceptionHandler::_lastException = "";
std::string ExceptionHandler::_pkmnLibLastException = "";
export const char* PkmnLib_C_GetLastException() { return ExceptionHandler::GetLastException(); }

View File

@ -6,15 +6,14 @@
#include <string>
#define export extern "C"
// CreatureLibException is 1, so use 2.
#define PkmnLibException 2
#define PkmnLibException 4
class ExceptionHandler {
static std::string _lastException;
static std::string _pkmnLibLastException;
public:
static void SetLastException(const std::exception& e) { _lastException = std::string(e.what()); }
static const char* GetLastException() { return _lastException.c_str(); }
static void SetLastException(const std::exception& e) { _pkmnLibLastException = std::string(e.what()); }
static const char* GetLastException() { return _pkmnLibLastException.c_str(); }
};
#define Try(data) \