From 88b882ed0b432c6aff2063213e2f793a36dd25f7 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 6 Jun 2019 00:11:18 +0800 Subject: *misc --- source/modules/asura-base/config.h | 69 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 source/modules/asura-base/config.h (limited to 'source/modules/asura-base/config.h') diff --git a/source/modules/asura-base/config.h b/source/modules/asura-base/config.h new file mode 100644 index 0000000..024ac79 --- /dev/null +++ b/source/modules/asura-base/config.h @@ -0,0 +1,69 @@ +#ifndef __ASURA_BASE_CONFIG_H__ +#define __ASURA_BASE_CONFIG_H__ + +// 在编辑器下会编译的代码 +#define ASURA_EDITOR 1 + +// 在运行时中的代码 +#define ASURA_RUNTIME 1 + +//--------------------------------------------------------------------------------// + +#ifndef ASSERT +#ifdef NDEBUG +#define ASSERT(x) { false ? (void)(x) : (void)0; } +#else +#ifdef _WIN32 +#define ASURA_DEBUG_BREAK() __debugbreak() +#else +#define ASURA_DEBUG_BREAK() raise(SIGTRAP) +#endif +#define ASSERT(x) do { const volatile bool asura_assert_b____ = !(x); if(asura_assert_b____) ASURA_DEBUG_BREAK(); } while (false) +#endif +#endif + +//--------------------------------------------------------------------------------// + +#ifdef _WIN32 + #define ASURA_FINAL final + #define ASURA_EXPORT __declspec(dllexport) + #define ASURA_IMPORT __declspec(dllimport) + #define ASURA_FORCE_INLINE __forceinline + #define ASURA_RESTRICT __restrict + #define ASURA_API ASURA_EXPORT + #define ASURA_ATTRIBUTE_USED + #define ASURA_ABSTRACT + #define ASURA_WINDOWS 1 +#else + #define ASURA_FINAL final + #define ASURA_EXPORT __attribute__((visibility("default"))) + #define ASURA_IMPORT + #define ASURA_FORCE_INLINE __attribute__((always_inline)) inline + #define ASURA_RESTRICT __restrict__ + #define ASURA_ATTRIBUTE_USED __attribute__((used)) + #define ASURA_ABSTRACT + #define ASURA_API ASURA_EXPORT +#endif + +/// +/// 表明移动指针所有权 +/// +#define ASURA_MOVE + +#define ASURA_DEBUG 0 + +//--------------------------------------------------------------------------------// + +#define ASURA_SDL_HOST 1 + +#define ASURA_LITTLE_ENDIAN 1 + +//--------------------------------------------------------------------------------// +// 扩展关键字 + +#define ASURA_THROW(ex) throw(ex) // 暗示抛出异常 + +#define ASURA_OUT +#define ASURA_REF + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0