30 lines
823 B
C++
30 lines
823 B
C++
|
#ifndef wg_COMMONS_HPP
|
||
|
#define wg_COMMONS_HPP
|
||
|
|
||
|
#define WG_GEN_ENUM(X) X
|
||
|
#define WG_GEN_STRING(X) #X
|
||
|
|
||
|
#define WG_ENUM(PREFIX, TYPES) \
|
||
|
enum PREFIX { TYPES(WG_GEN_ENUM) }; \
|
||
|
constexpr char const* PREFIX ## Str [] = { TYPES(WG_GEN_STRING) }
|
||
|
|
||
|
#define WG_ERROR(NAME) \
|
||
|
struct NAME : public std::runtime_error { \
|
||
|
NAME (std::string const& what) : std::runtime_error { what } {} \
|
||
|
}
|
||
|
|
||
|
#define WG_ASSERT(COND, MSG) \
|
||
|
if ( ! (COND) ) { std::cerr << MSG << std::endl; abort(); }
|
||
|
|
||
|
#include <string>
|
||
|
#include <filesystem>
|
||
|
#include <memory>
|
||
|
#include <vector>
|
||
|
#include <sstream>
|
||
|
#include <iostream>
|
||
|
#include <cstring>
|
||
|
#include <functional>
|
||
|
#include <optional>
|
||
|
|
||
|
#endif
|