Add version number to Makefile, Cleanup code

This commit is contained in:
Thraix
2018-06-10 12:15:41 +02:00
parent 464c483445
commit 5283801871
5 changed files with 30 additions and 26 deletions
+36
View File
@@ -0,0 +1,36 @@
#pragma once
#include <iostream>
#define BIT(x) (1<<x)
#define STRINGIFY(x) #x
#define STR(x) STRINGIFY(x)
#define VERSION_MAJOR 1
#define VERSION_UPDATE 0
#define VERSION_MINOR 2
#define VERSION ("v" STR(VERSION_MAJOR) "." STR(VERSION_UPDATE) "." STR(VERSION_MINOR))
const static unsigned int FLAG_HELP = BIT(0);
const static unsigned int FLAG_GEN= BIT(1);
const static unsigned int FLAG_VERSION= BIT(2);
#define LOG_INFO(...) Log(__VA_ARGS__); std::cout << std::endl
#define LOG_WARNING(...) Log(__VA_ARGS__); std::cout << std::endl
#define LOG_ERROR(...) Log(__VA_ARGS__); std::cout << std::endl
template <typename T>
void Log(const T& var)
{
std::cout << var;
}
template <typename T, typename ...Ts>
void Log(const T& var, const Ts& ...vars)
{
Log(var);
Log(vars...);
}