Initial commit.

This commit is contained in:
2019-07-01 14:33:21 +02:00
parent 92a04d779e
commit baa2e0279d
1624 changed files with 3204958 additions and 0 deletions
@@ -0,0 +1,33 @@
#pragma once
#include <stddef.h>
#include <stdint.h>
typedef void* (*allocate_func)(size_t size);
#if defined(__cplusplus)
extern "C"
{
#endif
void register_allocator(allocate_func allocator);
#if defined(__cplusplus)
}
#endif
#if defined(__cplusplus)
#include <string>
#include <vector>
class Allocator
{
public:
static void* Allocate(size_t size);
static char* CopyToAllocatedStringBuffer(const std::string& input);
static char* CopyToAllocatedStringBuffer(const char* input);
static void CopyStringVectorToNullTerminatedArray(const std::vector<std::string>& input, void*** output);
static void CopyDataVectorToNullTerminatedArray(const std::vector<void*>& input, void*** output, int32_t elementSize);
};
#endif
@@ -0,0 +1,123 @@
#pragma once
#include "il2cpp-config-platforms.h"
#include <stdint.h>
#if defined(__cplusplus)
extern "C" {
#endif
static inline int32_t UnityPalCompareExchange(volatile int32_t* dest, int32_t exchange, int32_t comparand);
static inline int64_t UnityPalCompareExchange64(volatile int64_t* dest, int64_t exchange, int64_t comparand);
static inline void* UnityPalCompareExchangePointer(void* volatile* dest, void* exchange, void* comparand);
static inline int32_t UnityPalAdd(volatile int32_t* location1, int32_t value);
static inline int64_t UnityPalAdd64(volatile int64_t* location1, int64_t value);
static inline int32_t UnityPalIncrement(volatile int32_t* value);
static inline int64_t UnityPalIncrement64(volatile int64_t* value);
static inline int32_t UnityPalDecrement(volatile int32_t* value);
static inline int64_t UnityPalDecrement64(volatile int64_t* value);
static inline int32_t UnityPalExchange(volatile int32_t* dest, int32_t exchange);
static inline int64_t UnityPalExchange64(volatile int64_t* dest, int64_t exchange);
static inline void* UnityPalExchangePointer(void* volatile* dest, void* exchange);
static inline int64_t UnityPalRead64(volatile int64_t* addr);
#if defined(__cplusplus)
}
#endif
#if !IL2CPP_SUPPORT_THREADS
inline int32_t UnityPalAdd(volatile int32_t* location1, int32_t value)
{
return *location1 += value;
}
inline int64_t UnityPalAdd64(volatile int64_t* location1, int64_t value)
{
return *location1 += value;
}
inline int32_t UnityPalIncrement(volatile int32_t* value)
{
return ++(*value);
}
inline int64_t UnityPalIncrement64(volatile int64_t* value)
{
return ++(*value);
}
inline int32_t UnityPalDecrement(volatile int32_t* value)
{
return --(*value);
}
inline int64_t UnityPalDecrement64(volatile int64_t* value)
{
return --(*value);
}
inline int32_t UnityPalCompareExchange(volatile int32_t* dest, int32_t exchange, int32_t comparand)
{
int32_t orig = *dest;
if (*dest == comparand)
*dest = exchange;
return orig;
}
inline int64_t UnityPalCompareExchange64(volatile int64_t* dest, int64_t exchange, int64_t comparand)
{
int64_t orig = *dest;
if (*dest == comparand)
*dest = exchange;
return orig;
}
inline void* UnityPalCompareExchangePointer(void* volatile* dest, void* exchange, void* comparand)
{
void* orig = *dest;
if (*dest == comparand)
*dest = exchange;
return orig;
}
inline int64_t UnityPalExchange64(volatile int64_t* dest, int64_t exchange)
{
int64_t orig = *dest;
*dest = exchange;
return orig;
}
inline int32_t UnityPalExchange(volatile int32_t* dest, int32_t exchange)
{
int32_t orig = *dest;
*dest = exchange;
return orig;
}
inline void* UnityPalExchangePointer(void* volatile* dest, void* exchange)
{
void* orig = *dest;
*dest = exchange;
return orig;
}
int64_t UnityPalRead64(volatile int64_t* addr)
{
return *addr;
}
#elif IL2CPP_TARGET_WINDOWS
#include "Win32/AtomicImpl-c-api.h"
#elif IL2CPP_TARGET_PS4
#include "PS4/AtomicImpl-c-api.h" // has to come earlier than posix
#elif IL2CPP_TARGET_PSP2
#include "PSP2/AtomicImpl-c-api.h"
#elif IL2CPP_TARGET_POSIX
#include "Posix/AtomicImpl-c-api.h"
#else
#include "AtomicImpl-c-api.h"
#endif
@@ -0,0 +1,45 @@
#pragma once
#if defined(__cplusplus)
#include "os/COM.h"
typedef Il2CppGuid UnityPalIl2CppGuid;
typedef Il2CppIUnknown UnityPalIl2CppIUnknown;
typedef Il2CppVariant UnityPalIl2CppVariant;
typedef Il2CppSafeArray UnityPalIl2CppSafeArray;
typedef Il2CppSafeArrayBound UnityPalIl2CppSafeArrayBound;
#else
typedef struct UnityPalIl2CppGuid UnityPalIl2CppGuid;
typedef struct UnityPalIl2CppIUnknown UnityPalIl2CppIUnknown;
typedef struct UnityPalIl2CppVariant UnityPalIl2CppVariant;
typedef struct UnityPalIl2CppSafeArray UnityPalIl2CppSafeArray;
typedef struct UnityPalIl2CppSafeArrayBound UnityPalIl2CppSafeArrayBound;
#endif
#if defined(__cplusplus)
extern "C"
{
#endif
il2cpp_hresult_t UnityPalCOMCreateInstance(const UnityPalIl2CppGuid& clsid, UnityPalIl2CppIUnknown** object);
il2cpp_hresult_t UnityPalCOMCreateFreeThreadedMarshaler(UnityPalIl2CppIUnknown* outer, UnityPalIl2CppIUnknown** marshal);
void UnityPalCOMVariantInit(UnityPalIl2CppVariant* variant);
il2cpp_hresult_t UnityPalCOMVariantClear(UnityPalIl2CppVariant* variant);
UnityPalIl2CppSafeArray* UnityPalCOMSafeArrayCreate(uint16_t type, uint32_t dimension_count, UnityPalIl2CppSafeArrayBound* bounds);
il2cpp_hresult_t UnityPalCOMSafeArrayDestroy(UnityPalIl2CppSafeArray* safeArray);
il2cpp_hresult_t UnityPalCOMSafeArrayAccessData(UnityPalIl2CppSafeArray* safeArray, void** data);
il2cpp_hresult_t UnityPalCOMSafeArrayUnaccessData(UnityPalIl2CppSafeArray* safeArray);
il2cpp_hresult_t UnityPalCOMSafeArrayGetVartype(UnityPalIl2CppSafeArray* safeArray, uint16_t* type);
uint32_t UnityPalCOMSafeArrayGetDim(UnityPalIl2CppSafeArray* safeArray);
il2cpp_hresult_t UnityPalCOMSafeArrayGetLBound(UnityPalIl2CppSafeArray* safeArray, uint32_t dimention, int32_t* bound);
il2cpp_hresult_t UnityPalCOMSafeArrayGetUBound(UnityPalIl2CppSafeArray* safeArray, uint32_t dimention, int32_t* bound);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,30 @@
#pragma once
#include <stdint.h>
#include "Mutex-c-api.h"
#if defined(__cplusplus)
#if NET_4_0
#include "os/ConditionVariable.h"
typedef il2cpp::os::ConditionVariable UnityPalConditionVariable;
#endif
#else
typedef struct UnityPalConditionVariable UnityPalConditionVariable;
#endif
#if defined(__cplusplus)
extern "C"
{
#endif
UnityPalConditionVariable* UnityPalConditionVariableNew();
void UnityPalConditionVariableDelete(UnityPalConditionVariable* object);
int UnityPalConditionVariableWait(UnityPalConditionVariable* object, UnityPalFastMutex* lock);
int UnityPalConditionVariableTimedWait(UnityPalConditionVariable* object, UnityPalFastMutex* lock, uint32_t timeout_ms);
void UnityPalConditionVariableBroadcast(UnityPalConditionVariable* object);
void UnityPalConditionVariableSignal(UnityPalConditionVariable* object);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,17 @@
#pragma once
#include <stdint.h>
#if defined(__cplusplus)
extern "C"
{
#endif
int32_t UnityPalConsoleInternalKeyAvailable(int32_t ms_timeout);
int32_t UnityPalConsoleSetBreak(int32_t wantBreak);
int32_t UnityPalConsoleSetEcho(int32_t wantEcho);
int32_t UnityPalConsoleTtySetup(const char* keypadXmit, const char* teardown, uint8_t* control_characters, int32_t** size);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,14 @@
#pragma once
#include <stdint.h>
#if defined(__cplusplus)
extern "C"
{
#endif
void* UnityPalCpuInfoCreate();
int32_t UnityPalCpuInfoUsage(void* previous);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,20 @@
#pragma once
#include <stdint.h>
#if defined(__cplusplus)
extern "C"
{
#endif
void* UnityPalGetCryptographyProvider();
int32_t UnityPalOpenCryptographyProvider();
void UnityPalReleaseCryptographyProvider(void* provider);
int32_t UnityPalCryptographyFillBufferWithRandomBytes(void* provider, uint32_t length, unsigned char* data);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,14 @@
#pragma once
#include <stdint.h>
#if defined(__cplusplus)
extern "C"
{
#endif
int32_t UnityPalIsDebuggerPresent();
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,40 @@
#pragma once
#include "Error-c-api.h"
#include <stdint.h>
#if defined(__cplusplus)
#include "os/Directory.h"
typedef il2cpp::os::Directory::FindHandle UnityPalFindHandle;
#else
typedef struct UnityPalFindHandle UnityPalFindHandle;
#endif
#if defined(__cplusplus)
extern "C"
{
#endif
const char* UnityPalDirectoryGetCurrent(int* error);
int32_t UnityPalDirectorySetCurrent(const char* path, int* error);
int32_t UnityPalDirectoryCreate(const char* path, int *error);
int32_t UnityPalDirectoryRemove(const char* path, int *error);
void UnityPalDirectoryGetFileSystemEntries(const char* path, const char* pathWithPattern, int32_t attrs, int32_t mask, int* error, char*** entries, int32_t* numEntries);
UnityPalFindHandle* UnityPalDirectoryFindHandleNew(const char* searchPathWithPattern);
void UnityPalDirectoryFindHandleDelete(UnityPalFindHandle* object);
int32_t UnityPalDirectoryCloseOSHandle(UnityPalFindHandle* object);
void* UnityPalDirectoryGetOSHandle(UnityPalFindHandle* object);
UnityPalErrorCode UnityPalDirectoryFindFirstFile(UnityPalFindHandle* findHandle, const char* searchPathWithPattern, char** resultFileName, int32_t* resultAttributes);
UnityPalErrorCode UnityPalDirectoryFindNextFile(UnityPalFindHandle* findHandle, char** resultFileName, int32_t* resultAttributes);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,19 @@
#pragma once
#include <stdint.h>
#if defined(__cplusplus)
extern "C"
{
#endif
char* UnityPalGetOsUserName();
char* UnityPalGetMachineName();
char* UnityPalGetEnvironmentVariable(const char* name);
void UnityPalSetEnvironmentVariable(const char* name, const char* value);
char* UnityPalGetHomeDirectory();
int32_t UnityPalGetProcessorCount();
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,27 @@
#pragma once
#include <stdint.h>
#if defined(__cplusplus)
#include "os/Error.h"
typedef il2cpp::os::ErrorCode UnityPalErrorCode;
#else
typedef int32_t UnityPalErrorCode;
#endif
#if defined(__cplusplus)
extern "C"
{
#endif
UnityPalErrorCode UnityPalGetLastError();
void UnityPalSetLastError(UnityPalErrorCode code);
int32_t UnityPalSuccess(UnityPalErrorCode code);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,37 @@
#pragma once
#include "Error-c-api.h"
#include "WaitStatus-c-api.h"
#if defined(__cplusplus)
#include "os/Event.h"
typedef il2cpp::os::Event UnityPalEvent;
typedef il2cpp::os::EventHandle UnityPalEventHandle;
#else
typedef struct UnityPalEvent UnityPalEvent;
typedef struct UnityPalEventHandle UnityPalEventHandle;
#endif
#if defined(__cplusplus)
extern "C"
{
#endif
UnityPalEvent* UnityPalEventNew(int32_t manualReset, int32_t signaled);
void UnityPalEventDelete(UnityPalEvent* event);
UnityPalErrorCode UnityPalEventSet(UnityPalEvent* event);
UnityPalErrorCode UnityPalEventReset(UnityPalEvent* event);
UnityPalWaitStatus UnityPalEventWait(UnityPalEvent* event, int32_t interruptible);
UnityPalWaitStatus UnityPalEventWaitMs(UnityPalEvent* event, uint32_t ms, int32_t interruptible);
UnityPalEventHandle* UnityPalEventHandleNew(UnityPalEvent* Event);
void UnityPalEventHandleDelete(UnityPalEventHandle* Event);
int32_t UnityPalEventHandleWait(UnityPalEventHandle* handle);
int32_t UnityPalEventHandleWaitMs(UnityPalEventHandle* handle, uint32_t ms);
void UnityPalEventHandleSignal(UnityPalEventHandle* handle);
UnityPalEvent* UnityPalEventHandleGet(UnityPalEventHandle* handle);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,64 @@
#pragma once
#include "OSGlobalEnums.h"
#if defined(__cplusplus)
#include "os/ErrorCodes.h"
#include "os/File.h"
typedef il2cpp::os::FileHandle UnityPalFileHandle;
#else
typedef struct UnityPalFileHandle UnityPalFileHandle;
#endif //__cplusplus
typedef struct
{
char* name;
int32_t attributes;
int64_t length;
int64_t creation_time;
int64_t last_access_time;
int64_t last_write_time;
} UnityPalFileStat;
#if defined(__cplusplus)
extern "C"
{
#endif
int32_t UnityPalIsatty(UnityPalFileHandle* fileHandle);
UnityPalFileHandle* UnityPalGetStdInput();
UnityPalFileHandle* UnityPalGetStdOutput();
UnityPalFileHandle* UnityPalGetStdError();
int32_t UnityPalCreatePipe(UnityPalFileHandle** read_handle, UnityPalFileHandle** write_handle);
int32_t UnityPalCreatePipe_with_error(UnityPalFileHandle** read_handle, UnityPalFileHandle** write_handle, int* error);
FileType UnityPalGetFileType(UnityPalFileHandle* handle);
UnityPalFileAttributes UnityPalGetFileAttributes(const char* path, int* error);
int32_t UnityPalSetFileAttributes(const char* path, UnityPalFileAttributes attributes, int* error);
int32_t UnityPalGetFileStat(const char* path, UnityPalFileStat * stat, int* error);
int32_t UnityPalCopyFile(const char* src, const char* dest, int32_t overwrite, int* error);
int32_t UnityPalMoveFile(const char* src, const char* dest, int* error);
int32_t UnityPalDeleteFile(const char* path, int *error);
int32_t UnityPalReplaceFile(const char* sourceFileName, const char* destinationFileName, const char* destinationBackupFileName, int32_t ignoreMetadataErrors, int* error);
UnityPalFileHandle* UnityPalOpen(const char* path, int openMode, int accessMode, int shareMode, int options, int *error);
int32_t UnityPalClose(UnityPalFileHandle* handle, int *error);
int32_t UnityPalSetFileTime(UnityPalFileHandle* handle, int64_t creation_time, int64_t last_access_time, int64_t last_write_time, int* error);
int64_t UnityPalGetLength(UnityPalFileHandle* handle, int *error);
int32_t UnityPalSetLength(UnityPalFileHandle* handle, int64_t length, int *error);
int32_t UnityPalTruncate(UnityPalFileHandle* handle, int *error);
int64_t UnityPalSeek(UnityPalFileHandle* handle, int64_t offset, int origin, int *error);
int UnityPalRead(UnityPalFileHandle* handle, char *dest, int count, int *error);
int32_t UnityPalWrite(UnityPalFileHandle* handle, const char* buffer, int count, int *error);
int32_t UnityPalFlush(UnityPalFileHandle* handle, int* error);
void UnityPalLock(UnityPalFileHandle* handle, int64_t position, int64_t length, int* error);
void UnityPalUnlock(UnityPalFileHandle* handle, int64_t position, int64_t length, int* error);
int32_t UnityPalDuplicateHandle(UnityPalFileHandle* source_process_handle, UnityPalFileHandle* source_handle, UnityPalFileHandle* target_process_handle,
UnityPalFileHandle** target_handle, int access, int inherit, int options, int* error);
int32_t UnityPalIsExecutable(const char* filename);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,26 @@
#pragma once
#include "WaitStatus-c-api.h"
#include <stddef.h>
#if defined(__cplusplus)
#include "os/Handle.h"
typedef il2cpp::os::Handle UnityPalHandle;
#else
typedef struct UnityPalHandle UnityPalHandle;
#endif
#if defined(__cplusplus)
extern "C"
{
#endif
void UnityPalHandleDestroy(UnityPalHandle* handle);
UnityPalWaitStatus UnityPalHandleWait(UnityPalHandle* handle, int32_t interruptible);
UnityPalWaitStatus UnityPalHandleWaitMs(UnityPalHandle* handle, uint32_t ms, int32_t interruptible);
UnityPalWaitStatus UnityPalHandleSignalAndWait(UnityPalHandle* toSignal, UnityPalHandle* toWait, uint32_t ms, int32_t interruptible);
UnityPalWaitStatus UnityPalWaitForMultipleHandles(UnityPalHandle** handles, size_t numberOfHandlers, int32_t waitAll, uint32_t ms, int32_t interruptible);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,22 @@
#pragma once
#if defined(__cplusplus)
#include "os/LibraryLoader.h"
typedef Il2CppMethodPointer UnityPalMethodPointer;
#else
typedef void (*UnityPalMethodPointer)();
#endif
#if defined(__cplusplus)
extern "C"
{
#endif
void* UnityPalLibraryLoaderLoadDynamicLibrary(const char* nativeDynamicLibrary, int flags);
void UnityPalLibraryLoaderCleanupLoadedLibraries();
UnityPalMethodPointer UnityPalLibraryLoaderGetFunctionPointer(void* dynamicLibrary, const char* functionName);
int32_t UnityPalLibraryLoaderCloseLoadedLibrary(void** dynamicLibrary);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,14 @@
#pragma once
#if defined(__cplusplus)
extern "C"
{
#endif
void UnityPalLocaleInitialize();
void UnityPalLocaleUnInitialize();
char* UnityPalGetLocale();
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,16 @@
#pragma once
#include <stddef.h>
#if defined(__cplusplus)
extern "C"
{
#endif
void* UnityPalAlignedAlloc(size_t size, size_t alignment);
void* UnityPalAlignedReAlloc(void* memory, size_t newSize, size_t alignment);
void UnityPalAlignedFree(void* memory);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,18 @@
#pragma once
#include "File-c-api.h"
#if defined(__cplusplus)
extern "C"
{
#endif
void* UnityPalMemoryMappedFileMap(UnityPalFileHandle* file);
void UnityPalMemoryMappedFileUnmap(void* address);
void* UnityPalMemoryMappedFileMapWithParams(UnityPalFileHandle* file, int64_t length, int64_t offset);
void UnityPalMemoryMappedFileUnmapWithParams(void* address, int64_t length);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,16 @@
#pragma once
#include "os/c-api/Error-c-api.h"
#include "os/c-api/Messages-c-api.h"
#if defined(__cplusplus)
extern "C"
{
#endif
char* UnityPalMessagesFromCode(UnityPalErrorCode code);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,44 @@
#pragma once
#if defined(__cplusplus)
#include "os/Mutex.h"
#include "os/WaitStatus.h"
typedef il2cpp::os::Mutex UnityPalMutex;
typedef il2cpp::os::MutexHandle UnityPalMutexHandle;
typedef il2cpp::os::FastMutex UnityPalFastMutex;
typedef il2cpp::os::FastMutexImpl UnityPalFastMutexImpl;
#else
typedef struct UnityPalMutex UnityPalMutex;
typedef struct UnityPalMutexHandle UnityPalMutexHandle;
typedef struct UnityPalFastMutex UnityPalFastMutex;
typedef struct UnityPalFastMutexImpl UnityPalFastMutexImpl;
#endif
#if defined(__cplusplus)
extern "C"
{
#endif
UnityPalMutex* UnityPalMutexNew(int32_t initiallyOwned);
void UnityPalMutexDelete(UnityPalMutex* mutex);
void UnityPalMutexLock(UnityPalMutex* mutex, int32_t interruptible);
int32_t UnityPalMutexTryLock(UnityPalMutex* mutex, uint32_t milliseconds, int32_t interruptible);
void UnityPalMutexUnlock(UnityPalMutex* mutex);
UnityPalMutexHandle* UnityPalMutexHandleNew(UnityPalMutex* mutex);
void UnityPalMutexHandleDelete(UnityPalMutexHandle* mutex);
int32_t UnityPalMutexHandleWait(UnityPalMutexHandle* handle);
int32_t UnityPalMutexHandleWaitMs(UnityPalMutexHandle* handle, uint32_t ms);
void UnityPalMutexHandleSignal(UnityPalMutexHandle* handle);
UnityPalMutex* UnityPalMutexHandleGet(UnityPalMutexHandle* handle);
UnityPalFastMutex* UnityPalFastMutexNew();
void UnityPalFastMutexDelete(UnityPalFastMutex* fastMutex);
void UnityPalFastMutexLock(UnityPalFastMutex* fastMutex);
void UnityPalFastMutexUnlock(UnityPalFastMutex* fastMutex);
UnityPalFastMutexImpl* UnityPalFastMutexGetImpl(UnityPalFastMutex* fastMutex);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,18 @@
#pragma once
#include <stdint.h>
#include "os/c-api/Process_c_api.h"
#if defined(__cplusplus)
extern "C"
{
#endif
int32_t UnityPalNativeCloseProcess(UnityPalProcessHandle* handle);
int32_t UnityPalNativeGetExitCodeProcess(UnityPalProcessHandle* handle, int32_t* exitCode);
int32_t UnityPalNativeGetCurrentProcessId();
UnityPalProcessHandle* UnityPalNativeGetCurrentProcess();
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,77 @@
#pragma once
typedef enum
{
kFileTypeUnknown = 0x0000,
kFileTypeDisk = 0x0001,
kFileTypeChar = 0x0002,
kFileTypePipe = 0x0003,
kFileTypeRemote = 0x8000
} FileType;
typedef enum
{
kFileAttributeReadOnly = 0x00000001,
kFileAttributeHidden = 0x00000002,
kFileAttributeSystem = 0x00000004,
kFileAttributeDirectory = 0x00000010,
kFileAttributeArchive = 0x00000020,
kFileAttributeDevice = 0x00000040,
kFileAttributeNormal = 0x00000080,
kFileAttributeTemporary = 0x00000100,
kFileAttributeSparse_file = 0x00000200,
kFileAttributeReparse_point = 0x00000400,
kFileAttributeCompressed = 0x00000800,
kFileAttributeOffline = 0x00001000,
kFileAttributeNot_content_indexed = 0x00002000,
kFileAttributeEncrypted = 0x00004000,
kFileAttributeVirtual = 0x00010000,
kFileAttributeInternalMonoExecutable = 0x80000000 // Only used internally by Mono
} UnityPalFileAttributes;
typedef enum
{
kFileAccessRead = 0x01,
kFileAccessWrite = 0x02,
kFileAccessExecute = 0x04,
kFileAccessReadWrite = kFileAccessRead | kFileAccessWrite,
kFileAccessReadWriteExecute = kFileAccessRead | kFileAccessWrite | kFileAccessExecute
} FileAccess;
typedef enum
{
kFileModeCreateNew = 1,
kFileModeCreate = 2,
kFileModeOpen = 3,
kFileModeOpenOrCreate = 4,
kFileModeTruncate = 5,
kFileModeAppend = 6
} FileMode;
typedef enum
{
kFileShareNone = 0x0,
kFileShareRead = 0x01,
kFileShareWrite = 0x02,
kFileShareReadWrite = kFileShareRead | kFileShareWrite,
kFileShareDelete = 0x04
} FileShare;
typedef enum
{
kFileOptionsNone = 0,
kFileOptionsTemporary = 1, // Internal. See note in System.IO.FileOptions
kFileOptionsEncrypted = 0x4000,
kFileOptionsDeleteOnClose = 0x4000000,
kFileOptionsSequentialScan = 0x8000000,
kFileOptionsRandomAccess = 0x10000000,
kFileOptionsAsynchronous = 0x40000000,
kFileOptionsWriteThrough = 0x80000000
} FileOptions;
typedef enum
{
kFileSeekOriginBegin = 0,
kFileSeekOriginCurrent = 1,
kFileSeekOriginEnd = 2
} SeekOrigin;
@@ -0,0 +1,18 @@
#pragma once
#include <stdint.h>
#if defined(__cplusplus)
extern "C"
{
#endif
char* UnityPalGetExecutablePath();
char* UnityPalGetTempPath();
int32_t UnityPalIsAbsolutePath(const char* path);
char* UnityPalBasename(const char* path);
char* UnityPalDirectoryName(const char* path);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,119 @@
#pragma once
#include <assert.h>
#ifdef __EMSCRIPTEN__
#include <emscripten/threading.h>
#endif
inline int32_t UnityPalAdd(volatile int32_t* location1, int32_t value)
{
ASSERT_ALIGNMENT(location1, 4);
return __sync_add_and_fetch(location1, value);
}
inline int64_t UnityPalAdd64(volatile int64_t* location1, int64_t value)
{
ASSERT_ALIGNMENT(location1, 8);
return __sync_add_and_fetch(location1, value);
}
inline int32_t UnityPalIncrement(volatile int32_t* value)
{
ASSERT_ALIGNMENT(value, 4);
return __sync_add_and_fetch(value, 1);
}
inline int64_t UnityPalIncrement64(volatile int64_t* value)
{
ASSERT_ALIGNMENT(value, 8);
return __sync_add_and_fetch(value, 1);
}
inline int32_t UnityPalDecrement(volatile int32_t* value)
{
ASSERT_ALIGNMENT(value, 4);
return __sync_add_and_fetch(value, -1);
}
inline int64_t UnityPalDecrement64(volatile int64_t* value)
{
ASSERT_ALIGNMENT(value, 8);
return __sync_add_and_fetch(value, -1);
}
inline int32_t UnityPalCompareExchange(volatile int32_t* dest, int32_t exchange, int32_t comparand)
{
ASSERT_ALIGNMENT(dest, 4);
return __sync_val_compare_and_swap(dest, comparand, exchange);
}
inline int64_t UnityPalCompareExchange64(volatile int64_t* dest, int64_t exchange, int64_t comparand)
{
ASSERT_ALIGNMENT(dest, 8);
#ifdef __EMSCRIPTEN__
return emscripten_atomic_cas_u64((void*)dest, comparand, exchange) == comparand ? comparand : *dest;
#else
return __sync_val_compare_and_swap(dest, comparand, exchange);
#endif
}
inline void* UnityPalCompareExchangePointer(void* volatile* dest, void* exchange, void* comparand)
{
ASSERT_ALIGNMENT(dest, IL2CPP_SIZEOF_VOID_P);
return __sync_val_compare_and_swap(dest, comparand, exchange);
}
inline int32_t UnityPalExchange(volatile int32_t* dest, int32_t exchange)
{
ASSERT_ALIGNMENT(dest, 4);
#ifdef __EMSCRIPTEN__
return emscripten_atomic_exchange_u32((void*)dest, exchange);
#else
int32_t prev;
do
{
prev = *dest;
}
while (!__sync_bool_compare_and_swap(dest, prev, exchange));
return prev;
#endif
}
inline int64_t UnityPalExchange64(volatile int64_t* dest, int64_t exchange)
{
ASSERT_ALIGNMENT(dest, 8);
#ifdef __EMSCRIPTEN__
return emscripten_atomic_exchange_u64((void*)dest, exchange);
#else
int64_t prev;
do
{
prev = *dest;
}
while (!__sync_bool_compare_and_swap(dest, prev, exchange));
return prev;
#endif
}
inline void* UnityPalExchangePointer(void* volatile* dest, void* exchange)
{
ASSERT_ALIGNMENT(dest, IL2CPP_SIZEOF_VOID_P);
#ifdef __EMSCRIPTEN__
return (void*)emscripten_atomic_exchange_u32((void*)dest, (uint32_t)exchange);
#else
void* prev;
do
{
prev = *dest;
}
while (!__sync_bool_compare_and_swap(dest, prev, exchange));
return prev;
#endif
}
inline int64_t UnityPalRead64(volatile int64_t* addr)
{
ASSERT_ALIGNMENT(addr, 8);
return __sync_fetch_and_add(addr, 0);
}
@@ -0,0 +1,25 @@
#pragma once
#if defined(__cplusplus)
typedef il2cpp::os::ProcessHandle UnityPalProcessHandle;
#else
typedef struct UnityPalProcessHandle UnityPalProcessHandle;
#endif
#if defined(__cplusplus)
extern "C"
{
#endif
int UnityPalGetCurrentProcessId();
UnityPalProcessHandle* UnityPalGetProcess(int processId);
void UnityPalFreeProcess(UnityPalProcessHandle* handle);
const char* UnityPalGetProcessName(UnityPalProcessHandle* handle);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,35 @@
#pragma once
#include "WaitStatus-c-api.h"
#if defined(__cplusplus)
#include "os/Semaphore.h"
typedef il2cpp::os::Semaphore UnityPalSemaphore;
typedef il2cpp::os::SemaphoreHandle UnityPalSemaphoreHandle;
#else
typedef struct UnityPalSemaphore UnityPalSemaphore;
typedef struct UnityPalSemaphoreHandle UnityPalSemaphoreHandle;
#endif
#if defined(__cplusplus)
extern "C"
{
#endif
UnityPalSemaphore* UnityPalSemaphoreNew(int32_t initialValue, int32_t maximumValue);
void UnityPalSemaphoreDelete(UnityPalSemaphore* semaphore);
int32_t UnityPalSemaphorePost(UnityPalSemaphore* semaphore, int32_t releaseCount, int32_t* previousCount);
UnityPalWaitStatus UnityPalSemaphoreWait(UnityPalSemaphore* semaphore, int32_t interruptible);
UnityPalWaitStatus UnityPalSemaphoreWaitMs(UnityPalSemaphore* semaphore, uint32_t ms, int32_t interruptible);
UnityPalSemaphoreHandle* UnityPalSemaphoreHandleNew(UnityPalSemaphore* semaphore);
void UnityPalSemaphoreHandleDelete(UnityPalSemaphoreHandle* handle);
int32_t UnityPalSemaphoreHandleWait(UnityPalSemaphoreHandle* handle);
int32_t UnityPalSemaphoreHandleWaitMs(UnityPalSemaphoreHandle* handle, uint32_t ms);
void UnityPalSemaphoreHandleSignal(UnityPalSemaphoreHandle* handle);
UnityPalSemaphore* UnityPalSemaphoreHandleGet(UnityPalSemaphoreHandle* handle);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,24 @@
#pragma once
#include <stdint.h>
#include "WaitStatus-c-api.h"
#if defined(__cplusplus)
#include "os/Socket.h"
#else
#endif //__cplusplus
#if defined(__cplusplus)
extern "C"
{
#endif
UnityPalWaitStatus UnityPalGetHostByName(const char* host, char** name, int32_t* family, char*** aliases, void*** address_list, int32_t* address_size);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,15 @@
#pragma once
#include <stdint.h>
#if defined(__cplusplus)
extern "C"
{
#endif
void* UnityPalSystemCertificatesOpenSystemRootStore();
int UnityPalSystemCertificatesEnumSystemCertificates(void* certStore, void** iter, int *format, int* size, void** data);
void UnityPalSystemCertificatesCloseSystemRootStore(void* cStore);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,27 @@
#pragma once
#include <stdint.h>
#if defined(__cplusplus)
#include "os/Thread.h"
typedef il2cpp::os::Thread::ThreadId UnityPalThreadId;
#else
typedef uint64_t UnityPalThreadId;
#endif //__cplusplus
#if defined(__cplusplus)
extern "C"
{
#endif
void UnityPalThreadInitialize();
void UnityPalSleep(uint32_t milliseconds);
UnityPalThreadId UnityPalGetCurrentThreadId();
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,28 @@
#pragma once
#include "os/c-api/Error-c-api.h"
#if defined(__cplusplus)
#include "os/ThreadLocalValue.h"
typedef il2cpp::os::ThreadLocalValue UnityPalThreadLocalValue;
#else
typedef struct UnityPalThreadLocalValue UnityPalThreadLocalValue;
#endif
#if defined(__cplusplus)
extern "C"
{
#endif
UnityPalThreadLocalValue* UnityPalThreadLocalValueNew();
void UnityPalThreadLocalValueDelete(UnityPalThreadLocalValue* object);
UnityPalErrorCode UnityPalThreadLocalValueSetValue(UnityPalThreadLocalValue* object, void* value);
UnityPalErrorCode UnityPalThreadLocalValueGetValue(UnityPalThreadLocalValue* object, void** value);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,17 @@
#pragma once
#include <stdint.h>
#if defined(__cplusplus)
extern "C"
{
#endif
uint32_t UnityPalGetTicksMillisecondsMonotonic();
int64_t UnityPalGetTicks100NanosecondsMonotonic();
int64_t UnityPalGetTicks100NanosecondsDateTime();
int64_t UnityPalGetSystemTimeAsFileTime();
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,14 @@
#pragma once
#include <stdint.h>
#if defined(__cplusplus)
extern "C"
{
#endif
int32_t UnityPalGetTimeZoneData(int32_t year, int64_t data[4], const char* names[2]);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,19 @@
#pragma once
#include <stdint.h>
#include "il2cpp-config-platforms.h"
#include "il2cpp-config-api-platforms.h"
#if defined(__cplusplus)
extern "C"
{
#endif
IL2CPP_EXPORT int UseUnityPalForTimeZoneInformation();
IL2CPP_EXPORT void* UnityPalTimeZoneInfoGetTimeZoneIDs();
IL2CPP_EXPORT int UnityPalGetLocalTimeZoneData(void** nativeRawData, char** nativeID, int* size);
IL2CPP_EXPORT int UnityPalGetTimeZoneDataForID(char* id, void** nativeRawData, int* size);
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,14 @@
#pragma once
// This should match MonoW32HandleWaitRet in the Mono code.
#define MAXIMUM_WAIT_OBJECTS 64
typedef enum
{
kWaitStatusSuccess = 0,
kWaitStatusAbandoned = kWaitStatusSuccess + MAXIMUM_WAIT_OBJECTS,
kWaitStatusAlerted = -1,
kWaitStatusTimeout = -2,
kWaitStatusFailure = -3,
} UnityPalWaitStatus;
@@ -0,0 +1,82 @@
#pragma once
#include <stdint.h>
#ifndef NOMINMAX
#define NOMINMAX
#endif
#define WIN32_LEAN_AND_MEAN 1
#define INC_OLE2 1
#include <Windows.h>
#if defined(__cplusplus)
extern "C" {
#endif
static inline int32_t UnityPalCompareExchange(volatile int32_t* dest, int32_t exchange, int32_t comparand)
{
return InterlockedCompareExchange((long volatile*)dest, exchange, comparand);
}
static inline int64_t UnityPalCompareExchange64(volatile int64_t* dest, int64_t exchange, int64_t comparand)
{
return InterlockedCompareExchange64((long long volatile*)dest, exchange, comparand);
}
static inline void* UnityPalCompareExchangePointer(void* volatile* dest, void* exchange, void* comparand)
{
return InterlockedCompareExchangePointer(dest, exchange, comparand);
}
static inline int32_t UnityPalAdd(volatile int32_t* location1, int32_t value)
{
return (InterlockedExchangeAdd((long volatile*)location1, value) + value);
}
static inline int64_t UnityPalAdd64(volatile int64_t* location1, int64_t value)
{
return (InterlockedExchangeAdd64((long long volatile*)location1, value) + value);
}
static inline int32_t UnityPalIncrement(volatile int32_t* value)
{
return InterlockedIncrement((long volatile*)value);
}
static inline int64_t UnityPalIncrement64(volatile int64_t* value)
{
return InterlockedIncrement64(value);
}
static inline int32_t UnityPalDecrement(volatile int32_t* value)
{
return InterlockedDecrement((long volatile*)value);
}
static inline int64_t UnityPalDecrement64(volatile int64_t* value)
{
return InterlockedDecrement64((long long volatile*)value);
}
static inline int64_t UnityPalExchange64(volatile int64_t* dest, int64_t exchange)
{
return InterlockedExchange64(dest, exchange);
}
static inline int32_t UnityPalExchange(volatile int32_t* dest, int32_t exchange)
{
return InterlockedExchange((long volatile*)dest, exchange);
}
static inline void* UnityPalExchangePointer(void* volatile* dest, void* exchange)
{
return InterlockedExchangePointer(dest, exchange);
}
static inline int64_t UnityPalRead64(volatile int64_t* addr)
{
return InterlockedCompareExchange64((long long volatile*)addr, 0, 0);
}
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,23 @@
#pragma once
#ifndef NOMINMAX
#define NOMINMAX
#endif
#define WIN32_LEAN_AND_MEAN 1
#define INC_OLE2 1
#include <Windows.h>
#include <Objidl.h>
#if IL2CPP_TARGET_WINDOWS_DESKTOP || IL2CPP_TARGET_WINRT
#include <wincrypt.h>
#include <Iphlpapi.h>
#endif
#if !IL2CPP_TARGET_WINDOWS_DESKTOP
#include <bcrypt.h>
#include <roapi.h>
#include <robuffer.h>
#include <winstring.h>
#endif
#define LINK_TO_WINDOWSRUNTIME_LIBS (!IL2CPP_TARGET_WINDOWS_DESKTOP)
@@ -0,0 +1,15 @@
#pragma once
#include "os/c-api/il2cpp-config-platforms.h"
#ifdef _MSC_VER
# include <malloc.h>
# define IL2CPP_EXPORT __declspec(dllexport)
# define IL2CPP_IMPORT __declspec(dllimport)
#elif IL2CPP_TARGET_PSP2 || IL2CPP_TARGET_PS4
# define IL2CPP_EXPORT __declspec(dllexport)
# define IL2CPP_IMPORT __declspec(dllimport)
#else
# define IL2CPP_EXPORT __attribute__ ((visibility ("default")))
# define IL2CPP_IMPORT
#endif
@@ -0,0 +1,221 @@
#pragma once
#include <assert.h>
#if defined(__aarch64__) && defined(__arm__)
#error We assume both __aarch64__ and __arm__ cannot be defined at tha same time.
#endif
#if defined(__aarch64__)
#define IL2CPP_TARGET_ARM64 1
#define IL2CPP_TARGET_ARMV7 0
#elif defined(__arm__)
#define IL2CPP_TARGET_ARM64 0
#define IL2CPP_TARGET_ARMV7 1
#else
#define IL2CPP_TARGET_ARM64 0
#define IL2CPP_TARGET_ARMV7 0
#endif
#define IL2CPP_BINARY_SECTION_NAME ".il2cpp"
#if defined(SN_TARGET_PSP2)
#define IL2CPP_TARGET_PSP2 1
#define _UNICODE 1
#define UNICODE 1
#include "il2cpp-config-psp2.h"
#elif defined(SN_TARGET_ORBIS)
#define IL2CPP_TARGET_PS4 1
#define _UNICODE 1
#define UNICODE 1
#elif defined(_MSC_VER)
#define IL2CPP_TARGET_WINDOWS 1
#define IL2CPP_PLATFORM_SUPPORTS_CUSTOM_SECTIONS 1
#define IL2CPP_PLATFORM_SUPPORTS_DEBUGGER_PRESENT 1
#define IL2CPP_METHOD_ATTR __declspec(code_seg (".il2cpp"))
#if defined(_XBOX_ONE)
#define IL2CPP_TARGET_XBOXONE 1
#define IL2CPP_PLATFORM_SUPPORTS_DEBUGGER_PRESENT 1
#elif defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
#define IL2CPP_TARGET_WINRT 1
#define IL2CPP_PLATFORM_SUPPORTS_SYSTEM_CERTIFICATES 1
#else
#define IL2CPP_TARGET_WINDOWS_DESKTOP 1
#define IL2CPP_PLATFORM_SUPPORTS_SYSTEM_CERTIFICATES 1
#define IL2CPP_PLATFORM_SUPPORTS_CPU_INFO 1
#endif
#define _UNICODE 1
#define UNICODE 1
#define STRICT 1
#elif defined(__APPLE__)
#define IL2CPP_TARGET_DARWIN 1
#define IL2CPP_PLATFORM_SUPPORTS_CPU_INFO 1
#define IL2CPP_PLATFORM_SUPPORTS_TIMEZONEINFO 1
#include "TargetConditionals.h"
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR || TARGET_OS_TV || TARGET_TVOS_SIMULATOR
#define IL2CPP_TARGET_IOS 1
#define IL2CPP_PLATFORM_SUPPORTS_CPU_INFO 1
#else
#define IL2CPP_TARGET_OSX 1
#define IL2CPP_PLATFORM_SUPPORTS_SYSTEM_CERTIFICATES 1
#endif
#define IL2CPP_PLATFORM_SUPPORTS_CUSTOM_SECTIONS !(IL2CPP_TARGET_IOS && IL2CPP_TARGET_ARMV7)
#if IL2CPP_PLATFORM_SUPPORTS_CUSTOM_SECTIONS
// The following gives managed stack traces (even with bitcode App Store submission), but may cause linker
// errors on ARMv7 builds.
#define IL2CPP_METHOD_ATTR __attribute__((section ("__TEXT," IL2CPP_BINARY_SECTION_NAME ",regular,pure_instructions")))
#endif
#elif defined(__ANDROID__)
#define IL2CPP_TARGET_ANDROID 1
#define IL2CPP_PLATFORM_SUPPORTS_TIMEZONEINFO 1
#define IL2CPP_PLATFORM_SUPPORTS_CUSTOM_SECTIONS 1
#define IL2CPP_METHOD_ATTR __attribute__((section ("__TEXT," IL2CPP_BINARY_SECTION_NAME ",regular,pure_instructions")))
#elif defined(EMSCRIPTEN)
#define IL2CPP_TARGET_JAVASCRIPT 1
#define IL2CPP_PLATFORM_SUPPORTS_CPU_INFO 1
#elif defined(NOVA)
#define IL2CPP_TARGET_NOVA 1
#elif defined(__linux__)
#define IL2CPP_TARGET_LINUX 1
#define IL2CPP_PLATFORM_SUPPORTS_CPU_INFO 1
#define IL2CPP_PLATFORM_SUPPORTS_SYSTEM_CERTIFICATES 1
#elif defined(NN_PLATFORM_CTR)
#define IL2CPP_TARGET_N3DS 1
#elif defined(NN_BUILD_TARGET_PLATFORM_NX)
#define IL2CPP_TARGET_SWITCH 1
#include "il2cpp-config-switch.h"
#else
#error please define your target platform
#endif
#ifndef IL2CPP_TARGET_WINDOWS
#define IL2CPP_TARGET_WINDOWS 0
#endif
#ifndef IL2CPP_TARGET_WINDOWS_DESKTOP
#define IL2CPP_TARGET_WINDOWS_DESKTOP 0
#endif
#ifndef IL2CPP_TARGET_WINRT
#define IL2CPP_TARGET_WINRT 0
#endif
#ifndef IL2CPP_TARGET_XBOXONE
#define IL2CPP_TARGET_XBOXONE 0
#endif
#ifndef IL2CPP_TARGET_DARWIN
#define IL2CPP_TARGET_DARWIN 0
#endif
#ifndef IL2CPP_TARGET_IOS
#define IL2CPP_TARGET_IOS 0
#endif
#ifndef IL2CPP_TARGET_OSX
#define IL2CPP_TARGET_OSX 0
#endif
#ifndef IL2CPP_TARGET_ANDROID
#define IL2CPP_TARGET_ANDROID 0
#endif
#ifndef IL2CPP_TARGET_JAVASCRIPT
#define IL2CPP_TARGET_JAVASCRIPT 0
#endif
#ifndef IL2CPP_TARGET_LINUX
#define IL2CPP_TARGET_LINUX 0
#endif
#ifndef IL2CPP_TARGET_N3DS
#define IL2CPP_TARGET_N3DS 0
#endif
#ifndef IL2CPP_TARGET_PS4
#define IL2CPP_TARGET_PS4 0
#endif
#ifndef IL2CPP_TARGET_PSP2
#define IL2CPP_TARGET_PSP2 0
#endif
#ifndef IL2CPP_TARGET_SWITCH
#define IL2CPP_TARGET_SWITCH 0
#endif
#define IL2CPP_TARGET_POSIX (IL2CPP_TARGET_DARWIN || IL2CPP_TARGET_JAVASCRIPT || IL2CPP_TARGET_LINUX || IL2CPP_TARGET_ANDROID || IL2CPP_TARGET_PS4 || IL2CPP_TARGET_PSP2 || IL2CPP_TARGET_NOVA)
#define IL2CPP_SUPPORT_THREADS !IL2CPP_TARGET_JAVASCRIPT
#ifndef IL2CPP_PLATFORM_SUPPORTS_SYSTEM_CERTIFICATES
#define IL2CPP_PLATFORM_SUPPORTS_SYSTEM_CERTIFICATES 0
#endif
#ifndef IL2CPP_PLATFORM_SUPPORTS_TIMEZONEINFO
#define IL2CPP_PLATFORM_SUPPORTS_TIMEZONEINFO 0
#endif
#ifndef IL2CPP_PLATFORM_SUPPORTS_CUSTOM_SECTIONS
#define IL2CPP_PLATFORM_SUPPORTS_CUSTOM_SECTIONS 0
#endif
#if IL2CPP_TARGET_WINDOWS || IL2CPP_TARGET_XBOXONE || IL2CPP_TARGET_WINRT
#include <crtdbg.h>
#define IL2CPP_ASSERT(expr) \
_ASSERTE(expr)
#else
#define IL2CPP_ASSERT(expr) \
assert(expr)
#endif
#ifndef IL2CPP_PLATFORM_SUPPORTS_CPU_INFO
#define IL2CPP_PLATFORM_SUPPORTS_CPU_INFO 0
#endif
#ifndef IL2CPP_PLATFORM_SUPPORTS_DEBUGGER_PRESENT
#define IL2CPP_PLATFORM_SUPPORTS_DEBUGGER_PRESENT 0
#endif
#define IL2CPP_USE_STD_THREAD 0
#define IL2CPP_THREADS_STD IL2CPP_USE_STD_THREAD
#define IL2CPP_THREADS_PTHREAD (!IL2CPP_THREADS_STD && IL2CPP_TARGET_POSIX)
#define IL2CPP_THREADS_WIN32 (!IL2CPP_THREADS_STD && IL2CPP_TARGET_WINDOWS)
#define IL2CPP_THREADS_N3DS (!IL2CPP_THREADS_STD && IL2CPP_TARGET_N3DS)
#define IL2CPP_THREADS_PS4 (!IL2CPP_THREADS_STD && IL2CPP_TARGET_PS4)
#define IL2CPP_THREADS_PSP2 (!IL2CPP_THREADS_STD && IL2CPP_TARGET_PSP2)
#define IL2CPP_THREADS_SWITCH (!IL2CPP_THREADS_STD && IL2CPP_TARGET_SWITCH)
/* Trigger assert if 'ptr' is not aligned to 'alignment'. */
#define ASSERT_ALIGNMENT(ptr, alignment) \
IL2CPP_ASSERT((((ptrdiff_t) ptr) & (alignment - 1)) == 0 && "Unaligned pointer!")
#if defined(_MSC_VER)
#if defined(_M_X64)
#define IL2CPP_SIZEOF_VOID_P 8
#elif defined(_M_IX86) || defined(_M_ARM)
#define IL2CPP_SIZEOF_VOID_P 4
#else
#error invalid windows architecture
#endif
#elif defined(__GNUC__) || defined(__SNC__)
#if defined(__x86_64__)
#define IL2CPP_SIZEOF_VOID_P 8
#elif defined(__i386__)
#define IL2CPP_SIZEOF_VOID_P 4
#elif defined(EMSCRIPTEN)
#define IL2CPP_SIZEOF_VOID_P 4
#elif defined(__arm__)
#define IL2CPP_SIZEOF_VOID_P 4
#elif defined(__arm64__) || defined(__aarch64__)
#define IL2CPP_SIZEOF_VOID_P 8
#else
#error invalid windows architecture
#endif
#else
#error please define your target architecture size
#endif
@@ -0,0 +1,9 @@
#pragma once
#if IL2CPP_TARGET_PS4
#define FILE_PATH_PREFIX "/app0/"
#else
#define FILE_PATH_PREFIX
#endif
#define CURRENT_DIRECTORY(filename) FILE_PATH_PREFIX filename