Files
OpenEngine/open_engine/include/open_engine/core.hpp
2026-02-17 00:50:43 +01:00

21 lines
681 B
C++

#ifndef CORE_HPP
#define CORE_HPP
#include "open_engine/instrumentor.hpp"
#ifdef OE_ENABLE_ASSERTS
#include <signal.h>
#define OE_ASSERT(x, ...) { if (!(x)) { OE_ERROR("Assertion Failed: {0}", __VA_ARGS__); raise(SIGTRAP); } }
#define OE_CORE_ASSERT(x, ...) { if (!(x)) { OE_CORE_ERROR("Assertion Failed: {0}", __VA_ARGS__); raise(SIGTRAP); } }
#else
#define OE_ASSERT(x, ...)
#define OE_CORE_ASSERT(x, ...)
#endif
#define BIT(x) (1 << x)
//#define BIND_EVENT_FN(function) std::bind(&function, this, std::placeholders::_1)
#define BIND_EVENT_FN(fn) [this](auto&&...args) -> decltype(auto) { return this->fn(std::forward<decltype(args)>(args)...); }
#endif // CORE_HPP