6#include "ll/api/base/StdInt.h"
7#include "ll/api/reflection/TypeName.h"
10#if defined(_MSC_VER) || defined(__clang__)
11#define LL_CC_V __vectorcall
18#if defined(_MSC_VER) && (defined(_M_IX86) || defined(__i386__))
19#define LL_CC_S __stdcall
26#if defined(_MSC_VER) && (defined(_M_IX86) || defined(__i386__))
27#define LL_CC_F __fastcall
35#define LL_CC_R __regcall
41namespace ll::internal {
46template <
class T, T v1, T v2,
class = std::
integral_constant<
bool, true>>
49template <
class T, T v1, T v2>
50struct CanCompare<T, v1, v2,
std::integral_constant<bool, v1 == v2>> : std::true_type {};
52template <MemFuncPtrT T, T f>
53consteval bool virtualDetector() noexcept {
54#if defined(_MSC_VER) && !defined(__clang__)
55 return reflection::getRawName<f>().find(
"::`vcall'{") != std::string_view::npos;
76#ifndef LL_SHARED_EXPORT
77#define LL_SHARED_EXPORT __declspec(dllexport)
79#ifndef LL_SHARED_IMPORT
80#define LL_SHARED_IMPORT __declspec(dllimport)
84#define LL_EBO __declspec(empty_bases)
88#define LL_ALLOCATOR _Ret_notnull_ _Post_writable_byte_size_(size) _VCRT_ALLOCATOR
91#ifndef LL_NOTHROW_ALLOCATOR
92#define LL_NOTHROW_ALLOCATOR _Ret_maybenull_ _Success_(return != NULL) _Post_writable_byte_size_(size) _VCRT_ALLOCATOR
96#define LL_FORCEINLINE __forceinline
100#define LL_NOINLINE __declspec(noinline)
103#ifndef LL_NO_UNIQUE_ADDRESS
104#define LL_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
107#ifndef LL_CONSTEXPR23
108#define LL_CONSTEXPR23 _CONSTEXPR23
111#ifndef LL_UNREACHABLE
112#define LL_UNREACHABLE _STL_UNREACHABLE
115#ifndef LL_RETURN_ADDRESS
116#define LL_RETURN_ADDRESS _ReturnAddress()
119#ifndef LL_CURRENT_LINE
120#define LL_CURRENT_LINE __builtin_LINE()
123#ifndef LL_CURRENT_COLUMN
124#define LL_CURRENT_COLUMN __builtin_COLUMN()
127#ifndef LL_CURRENT_FILE
128#define LL_CURRENT_FILE __builtin_FILE()
131#ifndef LL_CURRENT_FUNCTION
132#define LL_CURRENT_FUNCTION __builtin_FUNCTION()
135#ifndef LL_CURRENT_FUNCSIG
136#define LL_CURRENT_FUNCSIG __builtin_FUNCSIG()
139#ifndef LL_MACHINE_PAUSE
140#define LL_MACHINE_PAUSE _mm_pause()
145#if defined(__INTELLISENSE__) || defined(__clang__) || defined(__clangd__)
147#pragma pack(push, ehdata, 4)
155typedef void (*_PMFN)(void);
157#pragma warning(disable : 4200)
158#pragma pack(push, _TypeDescriptor, 8)
159typedef struct _TypeDescriptor {
160 void const* pVFTable;
164#pragma pack(pop, _TypeDescriptor)
165#pragma warning(default : 4200)
167typedef const struct _s__CatchableType {
168 unsigned int properties;
169 _TypeDescriptor* pType;
170 _PMD thisDisplacement;
175#pragma warning(disable : 4200)
176typedef const struct _s__CatchableTypeArray {
178 _CatchableType* arrayOfCatchableTypes[];
179} _CatchableTypeArray;
180#pragma warning(default : 4200)
182typedef const struct _s__ThrowInfo {
183 unsigned int attributes;
185 int(__cdecl* pForwardCompat)(...);
186 _CatchableTypeArray* pCatchableTypeArray;
195__declspec(noreturn)
extern "C" void __stdcall _CxxThrowException(
void* pExceptionObject, _ThrowInfo* pThrowInfo);
196extern "C" int __cdecl __CxxExceptionFilter(
void*,
void*,
int,
void*);
201extern "C" int __cdecl __CxxRegisterExceptionObject(
void* exception,
void* storage);
205extern "C" int __cdecl __CxxDetectRethrow(
void* exception);
208extern "C" int __cdecl __CxxQueryExceptionSize(
void);
212extern "C" void __cdecl __CxxUnregisterExceptionObject(
void* storage,
int rethrow);
214#pragma pack(pop, ehdata)
216#pragma pack(push, rttidata, 4)
218typedef const struct _s__RTTIBaseClassDescriptor {
219 _TypeDescriptor* pTypeDescriptor;
220 uint numContainedBases;
223} __RTTIBaseClassDescriptor;
225#pragma warning(disable : 4200)
226typedef const struct _s__RTTIBaseClassArray {
227 __RTTIBaseClassDescriptor* arrayOfBaseClassDescriptors[];
228} __RTTIBaseClassArray;
229#pragma warning(default : 4200)
231typedef const struct _s__RTTIClassHierarchyDescriptor {
235 __RTTIBaseClassArray* pBaseClassArray;
236} __RTTIClassHierarchyDescriptor;
238typedef const struct _s__RTTICompleteObjectLocator {
242 _TypeDescriptor* pTypeDescriptor;
243 __RTTIClassHierarchyDescriptor* pClassDescriptor;
244} __RTTICompleteObjectLocator;
246typedef class type_info const& __RTtypeidReturnType;
248extern "C" void* __cdecl __RTDynamicCast(
251 _TypeDescriptor
const* fromType,
252 _TypeDescriptor
const* toType,
255extern "C" void* __cdecl __RTtypeid(
void*);
256extern "C" void* __cdecl __RTCastToVoid(
void*);
258#pragma pack(pop, rttidata)
261struct _IMAGE_DOS_HEADER;
264namespace ll::internal {
265#if !(defined(__INTELLISENSE__) || defined(__clangd__))
267struct CatchableType {
270 _PMD thisDisplacement;
278 uint pCatchableTypeArray;
282using CatchableType = ::_CatchableType;
283using ThrowInfo = ::_ThrowInfo;
286extern "C" ::_IMAGE_DOS_HEADER __ImageBase;
288[[nodiscard]] LL_FORCEINLINE
void* getCurrentModuleHandle() noexcept {
return &__ImageBase; }
290using FileHandleT =
void*;
297#if _LIBCPP_STD_VER >= 23
298#define LL_HAS_CXX23 1
300#define LL_HAS_CXX23 0
304#ifndef LL_SHARED_EXPORT
305#define LL_SHARED_EXPORT __attribute__((visibility("default")))
308#ifndef LL_SHARED_IMPORT
309#define LL_SHARED_IMPORT
320#ifndef LL_FORCEINLINE
321#define LL_FORCEINLINE inline __attribute__((always_inline))
325#define LL_NOINLINE __attribute__((noinline))
328#ifndef LL_NO_UNIQUE_ADDRESS
329#define LL_NO_UNIQUE_ADDRESS [[no_unique_address]]
332#ifndef LL_CONSTEXPR23
333#if defined(__cpp_constexpr) && __cpp_constexpr >= 202211L
334#define LL_CONSTEXPR23 constexpr
336#define LL_CONSTEXPR23 inline
340#ifndef LL_UNREACHABLE
341#define LL_UNREACHABLE __builtin_unreachable()
344#ifndef LL_RETURN_ADDRESS
345#define LL_RETURN_ADDRESS __builtin_return_address(0)
348#ifndef LL_CURRENT_LINE
349#define LL_CURRENT_LINE __builtin_LINE()
352#ifndef LL_CURRENT_COLUMN
353#define LL_CURRENT_COLUMN (0)
356#ifndef LL_CURRENT_FILE
357#define LL_CURRENT_FILE __builtin_FILE()
360#ifndef LL_CURRENT_FUNCTION
361#define LL_CURRENT_FUNCTION __builtin_FUNCTION()
364#ifndef LL_CURRENT_FUNCSIG
365#define LL_CURRENT_FUNCSIG __builtin_FUNCTION()
368namespace ll::internal {
370[[nodiscard]]
void* getCurrentModuleHandle() noexcept;
372using FileHandleT =
int;
Definition CompilerPredefine.h:44
Definition CompilerPredefine.h:47