Refactor ConfigFile.cpp to be simpler
This commit is contained in:
+19
-2
@@ -4,6 +4,8 @@
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
#include "AssertException.h"
|
||||
|
||||
#define BIT(x) (1 << x)
|
||||
|
||||
#define STRINGIFY(x) #x
|
||||
@@ -14,7 +16,7 @@
|
||||
// Release, should be backwards compatible with any minor version
|
||||
#define MAKEGEN_VERSION_RELEASE 3
|
||||
// Minor changes, generally bug fixes
|
||||
#define MAKEGEN_VERSION_MINOR 9
|
||||
#define MAKEGEN_VERSION_MINOR 10
|
||||
|
||||
#define MAKEGEN_VERSION ("v" STR(MAKEGEN_VERSION_MAJOR) "." STR(MAKEGEN_VERSION_RELEASE) "." STR(MAKEGEN_VERSION_MINOR))
|
||||
|
||||
@@ -33,7 +35,22 @@ const static unsigned int FLAG_TARGET = BIT(11);
|
||||
|
||||
#define LOG_INFO(...) LogHelper(__VA_ARGS__)
|
||||
#define LOG_WARNING(...) LogHelper(__VA_ARGS__)
|
||||
#define LOG_ERROR(...) LogHelper(__VA_ARGS__)
|
||||
#define LOG_ERROR(...) LogHelper("\033[1;31m[ERROR] ", __VA_ARGS__, "\033[0m")
|
||||
#define ASSERT(expr, ...) \
|
||||
if (!(expr)) \
|
||||
{ \
|
||||
LOG_ERROR(__VA_ARGS__); \
|
||||
throw AssertException{}; \
|
||||
} \
|
||||
{ \
|
||||
} \
|
||||
while (false)
|
||||
#define ABORT(...) \
|
||||
{ \
|
||||
LOG_ERROR(__VA_ARGS__); \
|
||||
throw AssertException{}; \
|
||||
} \
|
||||
while (false)
|
||||
|
||||
template <typename T>
|
||||
void Log(const T& var)
|
||||
|
||||
Reference in New Issue
Block a user