#ifndef LLVM_SUPPORT_WIN_ADAPTER_H
#define LLVM_SUPPORT_WIN_ADAPTER_H
#ifndef _WIN32
#ifdef __cplusplus
#include <atomic>
#include <cassert>
#include <climits>
#include <cstring>
#include <cwchar>
#include <fstream>
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <string>
#include <typeindex>
#include <typeinfo>
#include <vector>
#endif
#define COM_NO_WINDOWS_H …
#define C_ASSERT(expr) …
#define ATLASSERT …
#define CoTaskMemAlloc …
#define CoTaskMemFree …
#define ARRAYSIZE(array) …
#define _countof(a) …
#ifndef __clang__
#define __EMULATE_UUID …
#endif
#ifdef __EMULATE_UUID
#define __declspec(x) …
#endif
#define DECLSPEC_SELECTANY
#ifdef __EMULATE_UUID
#define uuid(id) …
#endif
#define STDMETHODCALLTYPE
#define STDMETHODIMP_(type) …
#define STDMETHODIMP …
#define STDMETHOD_(type, name) …
#define STDMETHOD(name) …
#define EXTERN_C …
#define UNREFERENCED_PARAMETER(P) …
#define RtlEqualMemory(Destination, Source, Length) …
#define RtlMoveMemory(Destination, Source, Length) …
#define RtlCopyMemory(Destination, Source, Length) …
#define RtlFillMemory(Destination, Length, Fill) …
#define RtlZeroMemory(Destination, Length) …
#define MoveMemory …
#define CopyMemory …
#define FillMemory …
#define ZeroMemory …
#define FALSE …
#define TRUE …
#define GetConsoleOutputCP() …
#define _HRESULT_TYPEDEF_(_sc) …
#define DISP_E_BADINDEX …
#define REGDB_E_CLASSNOTREG …
#define UIntToInt(uint_arg, int_ptr_arg) …
#define INVALID_HANDLE_VALUE …
#define GetLastError() …
#define SetLastError(ERR) …
#define ERROR_SUCCESS …
#define ERROR_ARITHMETIC_OVERFLOW …
#define ERROR_FILE_NOT_FOUND …
#define ERROR_FUNCTION_NOT_CALLED …
#define ERROR_IO_DEVICE …
#define ERROR_INSUFFICIENT_BUFFER …
#define ERROR_INVALID_HANDLE …
#define ERROR_INVALID_PARAMETER …
#define ERROR_OUT_OF_STRUCTURES …
#define ERROR_NOT_CAPABLE …
#define ERROR_NOT_FOUND …
#define ERROR_UNHANDLED_EXCEPTION …
#define ERROR_BROKEN_PIPE …
#define SEVERITY_ERROR …
#define FACILITY_WIN32 …
#define HRESULT_CODE(hr) …
#define MAKE_HRESULT(severity, facility, code) …
#define FILE_TYPE_UNKNOWN …
#define FILE_TYPE_DISK …
#define FILE_TYPE_CHAR …
#define FILE_TYPE_PIPE …
#define FILE_TYPE_REMOTE …
#define FILE_ATTRIBUTE_NORMAL …
#define FILE_ATTRIBUTE_DIRECTORY …
#define INVALID_FILE_ATTRIBUTES …
#define STDOUT_FILENO …
#define STDERR_FILENO …
#define STGTY_STORAGE …
#define STGTY_STREAM …
#define STGTY_LOCKBYTES …
#define STGTY_PROPERTY …
#define STG_E_INVALIDFUNCTION …
#define STG_E_ACCESSDENIED …
#define STREAM_SEEK_SET …
#define STREAM_SEEK_CUR …
#define STREAM_SEEK_END …
#define HEAP_NO_SERIALIZE …
#define HEAP_ZERO_MEMORY …
#define MB_ERR_INVALID_CHARS …
#define CREATE_ALWAYS …
#define CREATE_NEW …
#define OPEN_ALWAYS …
#define OPEN_EXISTING …
#define TRUNCATE_EXISTING …
#define FILE_SHARE_DELETE …
#define FILE_SHARE_READ …
#define FILE_SHARE_WRITE …
#define GENERIC_READ …
#define GENERIC_WRITE …
#define _atoi64 …
#define sprintf_s …
#define _strdup …
#define _strnicmp …
#define vsnprintf_s …
#define strcat_s …
#define strcpy_s(dst, n, src) …
#define _vscwprintf …
#define vswprintf_s …
#define swprintf_s …
#define StringCchCopyW(dst, n, src) …
#define OutputDebugStringW(msg) …
#define OutputDebugStringA(msg) …
#define OutputDebugFormatA(...) …
#define DxcEtw_DXCompilerCreateInstance_Start() …
#define DxcEtw_DXCompilerCreateInstance_Stop(hr) …
#define DxcEtw_DXCompilerCompile_Start() …
#define DxcEtw_DXCompilerCompile_Stop(hr) …
#define DxcEtw_DXCompilerDisassemble_Start() …
#define DxcEtw_DXCompilerDisassemble_Stop(hr) …
#define DxcEtw_DXCompilerPreprocess_Start() …
#define DxcEtw_DXCompilerPreprocess_Stop(hr) …
#define DxcEtw_DxcValidation_Start() …
#define DxcEtw_DxcValidation_Stop(hr) …
#define UInt32Add …
#define Int32ToUInt32 …
#define S_OK …
#define S_FALSE …
#define E_ABORT …
#define E_ACCESSDENIED …
#define E_BOUNDS …
#define E_FAIL …
#define E_HANDLE …
#define E_INVALIDARG …
#define E_NOINTERFACE …
#define E_NOTIMPL …
#define E_NOT_VALID_STATE …
#define E_OUTOFMEMORY …
#define E_POINTER …
#define E_UNEXPECTED …
#define SUCCEEDED(hr) …
#define FAILED(hr) …
#define DXC_FAILED(hr) …
#define HRESULT_FROM_WIN32(x) …
#define _In_
#define _In_z_
#define _In_opt_
#define _In_opt_count_(size) …
#define _In_opt_z_
#define _In_count_(size) …
#define _In_bytecount_(size) …
#define _Out_
#define _Out_opt_
#define _Outptr_
#define _Outptr_opt_
#define _Outptr_result_z_
#define _Outptr_opt_result_z_
#define _Outptr_result_maybenull_
#define _Outptr_result_nullonfailure_
#define _Outptr_result_buffer_maybenull_(ptr) …
#define _Outptr_result_buffer_(ptr) …
#define _COM_Outptr_
#define _COM_Outptr_opt_
#define _COM_Outptr_result_maybenull_
#define _COM_Outptr_opt_result_maybenull_
#define THIS_
#define THIS
#define PURE …
#define _Maybenull_
#define __debugbreak() …
#ifdef __GNUC__
#define __cdecl
#define __CRTDECL
#define __stdcall
#define __vectorcall
#define __thiscall
#define __fastcall
#define __clrcall
#endif
#ifdef __cplusplus
UINT8;
LPBYTE;
BOOLEAN;
PBOOLEAN;
BOOL;
LPBOOL;
INT;
LONG;
UINT;
ULONG;
LONGLONG;
LONG_PTR;
ULONG_PTR;
ULONGLONG;
WORD;
DWORD;
LPDWORD;
UINT32;
UINT64;
PINT8;
PINT32;
SIZE_T;
LPCSTR;
PCSTR;
errno_t;
WCHAR;
LPWSTR;
PWCHAR;
LPCWSTR;
PCWSTR;
OLECHAR;
BSTR;
LPOLESTR;
LPSTR;
LPVOID;
LPCVOID;
nullptr_t;
HRESULT;
HANDLE;
RPC_IF_HANDLE;
#define DECLARE_HANDLE(name) …
DECLARE_HANDLE(…) …;
HMODULE;
#define STD_INPUT_HANDLE …
#define STD_OUTPUT_HANDLE …
#define STD_ERROR_HANDLE …
#ifdef __EMULATE_UUID
struct GUID
#else
typedef struct _GUID
#endif
{ … }
#ifdef __EMULATE_UUID
;
#else
GUID;
#endif
CLSID;
REFGUID;
REFCLSID;
IID;
LPIID;
REFIID;
inline bool IsEqualGUID(REFGUID rguid1, REFGUID rguid2) { … }
inline bool operator==(REFGUID guidOne, REFGUID guidOther) { … }
inline bool operator!=(REFGUID guidOne, REFGUID guidOther) { … }
inline bool IsEqualIID(REFIID riid1, REFIID riid2) { … }
inline bool IsEqualCLSID(REFCLSID rclsid1, REFCLSID rclsid2) { … }
LPFILETIME;
LPBY_HANDLE_FILE_INFORMATION;
LPWIN32_FIND_DATAW;
LARGE_INTEGER;
PLARGE_INTEGER;
ULARGE_INTEGER;
PULARGE_INTEGER;
STATSTG;
enum tagSTATFLAG { … };
#ifdef __EMULATE_UUID
constexpr uint8_t nybble_from_hex(char c) { … }
constexpr uint8_t byte_from_hex(char c1, char c2) { … }
constexpr uint8_t byte_from_hexstr(const char str[2]) { … }
constexpr GUID guid_from_string(const char str[37]) { … }
template <typename interface> inline GUID __emulated_uuidof();
#define CROSS_PLATFORM_UUIDOF(interface, spec) …
#define __uuidof(T) …
#define IID_PPV_ARGS(ppType) …
#else
#ifndef CROSS_PLATFORM_UUIDOF
#define CROSS_PLATFORM_UUIDOF …
#endif
template <typename T> inline void **IID_PPV_ARGS_Helper(T **pp) {
return reinterpret_cast<void **>(pp);
}
#define IID_PPV_ARGS …
#endif
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) …
#define DECLSPEC_UUID(x) …
#define MIDL_INTERFACE(x) …
#define DECLARE_INTERFACE(iface) …
#define DECLARE_INTERFACE_(iface, parent) …
CROSS_PLATFORM_UUIDOF(IUnknown, "00000000-0000-0000-C000-000000000046")
struct IUnknown { … };
CROSS_PLATFORM_UUIDOF(INoMarshal, "ECC8691B-C1DB-4DC0-855E-65F6C551AF49")
struct INoMarshal : public IUnknown { … };
CROSS_PLATFORM_UUIDOF(IMalloc, "00000002-0000-0000-C000-000000000046")
struct IMalloc : public IUnknown { … };
CROSS_PLATFORM_UUIDOF(ISequentialStream, "0C733A30-2A1C-11CE-ADE5-00AA0044773D")
struct ISequentialStream : public IUnknown { … };
CROSS_PLATFORM_UUIDOF(IStream, "0000000c-0000-0000-C000-000000000046")
struct IStream : public ISequentialStream { … };
CROSS_PLATFORM_UUIDOF(ID3D12LibraryReflection,
"8E349D19-54DB-4A56-9DC9-119D87BDB804")
CROSS_PLATFORM_UUIDOF(ID3D12ShaderReflection,
"5A58797D-A72C-478D-8BA2-EFC6B0EFE88E")
class CAllocator { … };
template <class T> class CComPtrBase { … };
template <class T> class CComPtr : public CComPtrBase<T> { … };
template <class T> class CSimpleArray : public std::vector<T> { … };
template <class T, class Allocator = CAllocator> class CHeapPtrBase { … };
template <typename T, class Allocator = CAllocator>
class CHeapPtr : public CHeapPtrBase<T, Allocator> { … };
#define CComHeapPtr …
void SysFreeString(BSTR bstrString);
BSTR SysAllocStringLen(const OLECHAR *strIn, UINT ui);
unsigned int SysStringLen(const BSTR bstrString);
#define CP_ACP …
#define CP_UTF8 …
class ScopedLocale { … };
template <int t_nBufferLength = 128> class CW2AEX { … };
CW2A;
template <int t_nBufferLength = 128> class CA2WEX { … };
CA2W;
class CHandle { … };
class CComBSTR { … };
class WArgV { … };
#endif
#endif
#endif