20 lines
560 B
C++
20 lines
560 B
C++
#pragma once
|
|
#include "spdlog/spdlog.h"
|
|
|
|
#define CORE_API
|
|
// #ifdef core_EXPORTS
|
|
// #define CORE_API __declspec(dllexport)
|
|
// #else
|
|
// #define CORE_API __declspec(dllimport)
|
|
// #endif
|
|
|
|
#if defined(_DEBUG) || defined(DEBUG)
|
|
#define checkf(expr, msg, ...) if (!(expr)) { spdlog::error(msg, __VA_ARGS__); throw std::runtime_error(fmt::format(msg, __VA_ARGS__)); }
|
|
#define check(expr) if (!(expr)) { spdlog::error("Check failed: {}", #expr); throw std::runtime_error(fmt::format("Check failed: {}", #expr)); }
|
|
#else
|
|
#define checkf(...)
|
|
#define check(...)
|
|
#endif
|
|
|
|
|