#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 #include #include #include #include #include #include #include #include #endif