6#include "ll/api/base/StdInt.h"
7#include "ll/api/reflection/TypeName.h"
22#ifndef LL_SHARED_EXPORT
23#define LL_SHARED_EXPORT __declspec(dllexport)
25#ifndef LL_SHARED_IMPORT
26#define LL_SHARED_IMPORT __declspec(dllimport)
30#define LL_EBO __declspec(empty_bases)
34#define LL_ALLOCATOR _Ret_notnull_ _Post_writable_byte_size_(size) _VCRT_ALLOCATOR
37#ifndef LL_NOTHROW_ALLOCATOR
38#define LL_NOTHROW_ALLOCATOR _Ret_maybenull_ _Success_(return != NULL) _Post_writable_byte_size_(size) _VCRT_ALLOCATOR
42#define LL_FORCEINLINE __forceinline
46#define LL_NOINLINE __declspec(noinline)
49#ifndef LL_NO_UNIQUE_ADDRESS
50#define LL_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
54#define LL_CONSTEXPR23 _CONSTEXPR23
58#define LL_UNREACHABLE _STL_UNREACHABLE
61#ifndef LL_RETURN_ADDRESS
62#define LL_RETURN_ADDRESS _ReturnAddress()
65#ifndef LL_CURRENT_LINE
66#define LL_CURRENT_LINE __builtin_LINE()
69#ifndef LL_CURRENT_COLUMN
70#define LL_CURRENT_COLUMN __builtin_COLUMN()
73#ifndef LL_CURRENT_FILE
74#define LL_CURRENT_FILE __builtin_FILE()
77#ifndef LL_CURRENT_FUNCTION
78#define LL_CURRENT_FUNCTION __builtin_FUNCTION()
81#ifndef LL_CURRENT_FUNCSIG
82#define LL_CURRENT_FUNCSIG __builtin_FUNCSIG()
85#ifndef LL_MACHINE_PAUSE
86#define LL_MACHINE_PAUSE _mm_pause()
91#if defined(__INTELLISENSE__) || defined(__clang__) || defined(__clangd__)
93#pragma pack(push, ehdata, 4)
101typedef void (*_PMFN)(void);
103#pragma warning(disable : 4200)
104#pragma pack(push, _TypeDescriptor, 8)
105typedef struct _TypeDescriptor {
106 void const* pVFTable;
110#pragma pack(pop, _TypeDescriptor)
111#pragma warning(default : 4200)
113typedef const struct _s__CatchableType {
114 unsigned int properties;
115 _TypeDescriptor* pType;
116 _PMD thisDisplacement;
121#pragma warning(disable : 4200)
122typedef const struct _s__CatchableTypeArray {
124 _CatchableType* arrayOfCatchableTypes[];
125} _CatchableTypeArray;
126#pragma warning(default : 4200)
128typedef const struct _s__ThrowInfo {
129 unsigned int attributes;
131 int(__cdecl* pForwardCompat)(...);
132 _CatchableTypeArray* pCatchableTypeArray;
141__declspec(noreturn)
extern "C" void __stdcall _CxxThrowException(
void* pExceptionObject, _ThrowInfo* pThrowInfo);
142extern "C" int __cdecl __CxxExceptionFilter(
void*,
void*,
int,
void*);
147extern "C" int __cdecl __CxxRegisterExceptionObject(
void* exception,
void* storage);
151extern "C" int __cdecl __CxxDetectRethrow(
void* exception);
154extern "C" int __cdecl __CxxQueryExceptionSize(
void);
158extern "C" void __cdecl __CxxUnregisterExceptionObject(
void* storage,
int rethrow);
160#pragma pack(pop, ehdata)
162#pragma pack(push, rttidata, 4)
164typedef const struct _s__RTTIBaseClassDescriptor {
165 _TypeDescriptor* pTypeDescriptor;
166 uint numContainedBases;
169} __RTTIBaseClassDescriptor;
171#pragma warning(disable : 4200)
172typedef const struct _s__RTTIBaseClassArray {
173 __RTTIBaseClassDescriptor* arrayOfBaseClassDescriptors[];
174} __RTTIBaseClassArray;
175#pragma warning(default : 4200)
177typedef const struct _s__RTTIClassHierarchyDescriptor {
181 __RTTIBaseClassArray* pBaseClassArray;
182} __RTTIClassHierarchyDescriptor;
184typedef const struct _s__RTTICompleteObjectLocator {
188 _TypeDescriptor* pTypeDescriptor;
189 __RTTIClassHierarchyDescriptor* pClassDescriptor;
190} __RTTICompleteObjectLocator;
192typedef class type_info const& __RTtypeidReturnType;
194extern "C" void* __cdecl __RTDynamicCast(
197 _TypeDescriptor
const* fromType,
198 _TypeDescriptor
const* toType,
201extern "C" void* __cdecl __RTtypeid(
void*);
202extern "C" void* __cdecl __RTCastToVoid(
void*);
204#pragma pack(pop, rttidata)
207struct _IMAGE_DOS_HEADER;
210namespace ll::internal {
211#if !(defined(__INTELLISENSE__) || defined(__clangd__))
213struct CatchableType {
216 _PMD thisDisplacement;
224 uint pCatchableTypeArray;
228using CatchableType = ::_CatchableType;
229using ThrowInfo = ::_ThrowInfo;
232extern "C" ::_IMAGE_DOS_HEADER __ImageBase;
234[[nodiscard]] LL_FORCEINLINE
void* getCurrentModuleHandle() noexcept {
return &__ImageBase; }
237concept MemFuncPtrT = std::is_member_function_pointer_v<T>;
239template <MemFuncPtrT T, T f>
240consteval bool virtualDetector() noexcept {
241 return reflection::getRawName<f>().find(
"::`vcall'{") != std::string_view::npos;
244using FileHandleT =
void*;
251#if _LIBCPP_STD_VER >= 23
252#define LL_HAS_CXX23 1
254#define LL_HAS_CXX23 0
258#ifndef LL_SHARED_EXPORT
259#define LL_SHARED_EXPORT __attribute__((visibility("default")))
262#ifndef LL_SHARED_IMPORT
263#define LL_SHARED_IMPORT
274#ifndef LL_FORCEINLINE
275#define LL_FORCEINLINE inline __attribute__((always_inline))
279#define LL_NOINLINE __attribute__((noinline))
282#ifndef LL_NO_UNIQUE_ADDRESS
283#define LL_NO_UNIQUE_ADDRESS [[no_unique_address]]
286#ifndef LL_CONSTEXPR23
287#if defined(__cpp_constexpr) && __cpp_constexpr >= 202211L
288#define LL_CONSTEXPR23 constexpr
290#define LL_CONSTEXPR23 inline
294#ifndef LL_UNREACHABLE
295#define LL_UNREACHABLE __builtin_unreachable()
298#ifndef LL_RETURN_ADDRESS
299#define LL_RETURN_ADDRESS __builtin_return_address(0)
302#ifndef LL_CURRENT_LINE
303#define LL_CURRENT_LINE __builtin_LINE()
306#ifndef LL_CURRENT_COLUMN
307#define LL_CURRENT_COLUMN (0)
310#ifndef LL_CURRENT_FILE
311#define LL_CURRENT_FILE __builtin_FILE()
314#ifndef LL_CURRENT_FUNCTION
315#define LL_CURRENT_FUNCTION __builtin_FUNCTION()
318#ifndef LL_CURRENT_FUNCSIG
319#define LL_CURRENT_FUNCSIG __builtin_FUNCTION()
322namespace ll::internal {
324[[nodiscard]]
void* getCurrentModuleHandle() noexcept;
326using FileHandleT =
int;
328template <class T, T v1, T v2, class =
std::integral_constant<
bool, true>>
331template <
class T, T v1, T v2>
332struct CanCompare<T, v1, v2,
std::integral_constant<bool, v1 == v2>> : std::true_type {};
337template <MemFuncPtrT T, T f>
338consteval bool virtualDetector() noexcept {
339 return !CanCompare<T, f, f>::value;
Definition CompilerPredefine.h:335
Definition CompilerPredefine.h:329