Loading...
Searching...
No Matches
Go to the documentation of this file.
3#if defined(_WIN32) || defined(_WIN64)
4# define LEIA_OS_WINDOWS
5#elif defined(__ANDROID__)
6# define LEIA_OS_ANDROID
8# error "Unsupported platform"
12# define LEIA_COMPILER_MSVC
13#elif defined(__clang__)
14# define LEIA_COMPILER_CLANG
16# error "Unsupported compiler"
19#if defined(LEIA_OS_WINDOWS)
20# if defined(LEIA_COMPILER_MSVC)
21# define LEIA_EXPORT __declspec(dllexport)
22# define LEIA_IMPORT __declspec(dllimport)
25# define LEIA_EXPORT __attribute__((dllexport))
26# define LEIA_IMPORT __attribute__((dllimport))
30# define LEIA_EXPORT __attribute__((visibility("default")))
32# define LEIA_HIDDEN __attribute__((visibility("hidden")))
35#if defined(LEIA_OS_ANDROID)
36# define LEIA_CLASS_EXPORT LEIA_EXPORT
37# define LEIA_CLASS_IMPORT LEIA_IMPORT
39# define LEIA_CLASS_EXPORT
40# define LEIA_CLASS_IMPORT
43#if defined(LEIA_COMPILER_MSVC)
44# define LEIA_DEPRECATED __declspec(deprecated)
45#elif defined(LEIA_COMPILER_CLANG)
46# define LEIA_DEPRECATED __attribute__((__deprecated__))
48# define LEIA_DEPRECATED
51#if defined(LEIA_COMPILER_MSVC)
52# define LEIA_FORCE_INLINE __forceinline
53#elif defined(LEIA_COMPILER_CLANG)
54# define LEIA_FORCE_INLINE inline __attribute__((always_inline))
56# define LEIA_FORCE_INLINE inline
59#if !defined(LEIA_FUNCTION)
60# if defined(LEIA_COMPILER_CLANG)
61# define LEIA_FUNCTION __PRETTY_FUNCTION__
62# elif defined(LEIA_COMPILER_MSVC)
63# define LEIA_FUNCTION __FUNCSIG__
65# define LEIA_FUNCTION __FUNCTION__
70# define BEGIN_CAPI_DECL extern "C" {
71# define END_CAPI_DECL }
73# define BEGIN_CAPI_DECL
77#if defined(__has_cpp_attribute)
78# if __has_cpp_attribute(nodiscard)
79# define LEIA_NODISCARD [[nodiscard]]
83# if defined(_MSC_VER) && _MSC_VER >= 1700
84# define LEIA_NODISCARD _Check_return_
86# define LEIA_NODISCARD __attribute__((warn_unused_result))
90#define _LEIA_STRINGIZE(x) #x
91#define LEIA_STRINGIZE(x) _LEIA_STRINGIZE(x)
93#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || defined(_M_X64) || defined(__ia64) || defined(_M_IA64) || \
94 defined(__aarch64__) || defined(__powerpc64__)
105#define OWNING(ptr) ptr
110#define NONOWNING(ptr) ptr
112#define LEIA_USE_OPENGL
115# define LEIA_USE_VULKAN
118#ifdef LEIA_OS_WINDOWS
119# define LEIA_USE_DIRECTX