9 #ifndef QUILL_BEGIN_NAMESPACE 10 #define QUILL_BEGIN_NAMESPACE \ 13 inline namespace v11 \ 15 #define QUILL_END_NAMESPACE \ 21 #define QUILL_CPLUSPLUS _MSVC_LANG 23 #define QUILL_CPLUSPLUS __cplusplus 29 #ifndef QUILL_HAS_INCLUDE 31 #define QUILL_HAS_INCLUDE(x) __has_include(x) 33 #define QUILL_HAS_INCLUDE(x) 0 40 #ifndef QUILL_HAS_FEATURE 42 #define QUILL_HAS_FEATURE(x) __has_feature(x) 44 #define QUILL_HAS_FEATURE(x) 0 51 #ifndef QUILL_HAS_ATTRIBUTE 52 #ifdef __has_attribute 53 #define QUILL_HAS_ATTRIBUTE(x) __has_attribute(x) 55 #define QUILL_HAS_ATTRIBUTE(x) 0 62 #ifndef QUILL_HAS_CPP_ATTRIBUTE 63 #if defined(__cplusplus) && defined(__has_cpp_attribute) 64 #define QUILL_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x) 66 #define QUILL_HAS_CPP_ATTRIBUTE(x) 0 73 #ifndef QUILL_NODISCARD 74 #if QUILL_HAS_CPP_ATTRIBUTE(nodiscard) 75 #define QUILL_NODISCARD [[nodiscard]] 76 #elif QUILL_HAS_CPP_ATTRIBUTE(gnu::warn_unused_result) 77 #define QUILL_NODISCARD [[gnu::warn_unused_result]] 79 #define QUILL_NODISCARD 86 #ifndef QUILL_MAYBE_UNUSED 87 #if QUILL_HAS_CPP_ATTRIBUTE(maybe_unused) && (__cplusplus >= 201703L) 88 #define QUILL_MAYBE_UNUSED [[maybe_unused]] 89 #elif QUILL_HAS_ATTRIBUTE(__unused__) 90 #define QUILL_MAYBE_UNUSED __attribute__((__unused__)) 91 #elif defined(_MSC_VER) 92 #define QUILL_MAYBE_UNUSED __pragma(warning(suppress : 4100)) 94 #define QUILL_MAYBE_UNUSED 104 #ifndef QUILL_ATTRIBUTE_HOT 105 #if QUILL_HAS_ATTRIBUTE(hot) 106 #define QUILL_ATTRIBUTE_HOT __attribute__((hot)) 108 #define QUILL_ATTRIBUTE_HOT 112 #ifndef QUILL_ATTRIBUTE_COLD 113 #if QUILL_HAS_ATTRIBUTE(cold) 114 #define QUILL_ATTRIBUTE_COLD __attribute__((cold)) 116 #define QUILL_ATTRIBUTE_COLD 123 #ifndef QUILL_ATTRIBUTE_USED 124 #if QUILL_HAS_ATTRIBUTE(used) 125 #define QUILL_ATTRIBUTE_USED __attribute__((used)) 127 #define QUILL_ATTRIBUTE_USED 135 #if defined(__GNUC__) 136 #define QUILL_LIKELY(x) (__builtin_expect((x), 1)) 138 #define QUILL_LIKELY(x) (x) 142 #ifndef QUILL_UNLIKELY 143 #if defined(__GNUC__) 144 #define QUILL_UNLIKELY(x) (__builtin_expect((x), 0)) 146 #define QUILL_UNLIKELY(x) (x) 154 #if defined(_WIN32) && defined(_MSC_VER) 155 #if defined(QUILL_DLL_EXPORT) 156 #define QUILL_EXPORT __declspec(dllexport) // Exporting symbols when building the library 157 #elif defined(QUILL_DLL_IMPORT) 158 #define QUILL_EXPORT __declspec(dllimport) // Importing symbols when using the library 160 #define QUILL_EXPORT // No special attribute needed for static or other builds 162 #elif defined(__GNUC__) || defined(__clang__) 163 #define QUILL_EXPORT \ 164 __attribute__((visibility("default"))) // Using GCC/Clang visibility attribute 166 #define QUILL_EXPORT // Default for other compilers 173 #ifndef QUILL_USE_RTTI 175 #if defined(__GXX_RTTI) || QUILL_HAS_FEATURE(cxx_rtti) || defined(_CPPRTTI) || \ 176 defined(__INTEL_RTTI__) || defined(__RTTI) 177 #define QUILL_USE_RTTI 1 179 #define QUILL_USE_RTTI 0