diff --git a/Source/Editor/Cooker/CookingData.h b/Source/Editor/Cooker/CookingData.h
index ef12d204e..06e48cc95 100644
--- a/Source/Editor/Cooker/CookingData.h
+++ b/Source/Editor/Cooker/CookingData.h
@@ -134,6 +134,12 @@ API_ENUM() enum class BuildPlatform
///
API_ENUM(Attributes="EditorDisplay(null, \"iOS ARM64\")")
iOSARM64 = 14,
+
+ ///
+ /// Windows (ARM64)
+ ///
+ API_ENUM(Attributes = "EditorDisplay(null, \"Windows ARM64\")")
+ WindowsARM64 = 15,
};
///
diff --git a/Source/Editor/Cooker/GameCooker.cpp b/Source/Editor/Cooker/GameCooker.cpp
index 118dd397f..17392adee 100644
--- a/Source/Editor/Cooker/GameCooker.cpp
+++ b/Source/Editor/Cooker/GameCooker.cpp
@@ -148,6 +148,8 @@ const Char* ToString(const BuildPlatform platform)
return TEXT("Mac ARM64");
case BuildPlatform::iOSARM64:
return TEXT("iOS ARM64");
+ case BuildPlatform::WindowsARM64:
+ return TEXT("Windows ARM64");
default:
return TEXT("");
}
@@ -300,6 +302,10 @@ void CookingData::GetBuildPlatformName(const Char*& platform, const Char*& archi
platform = TEXT("iOS");
architecture = TEXT("ARM64");
break;
+ case BuildPlatform::WindowsARM64:
+ platform = TEXT("Windows");
+ architecture = TEXT("ARM64");
+ break;
default:
LOG(Fatal, "Unknown or unsupported build platform.");
}
@@ -386,6 +392,9 @@ PlatformTools* GameCooker::GetTools(BuildPlatform platform)
case BuildPlatform::Windows64:
result = New(ArchitectureType::x64);
break;
+ case BuildPlatform::WindowsARM64:
+ result = New(ArchitectureType::ARM64);
+ break;
#endif
#if PLATFORM_TOOLS_UWP
case BuildPlatform::UWPx86:
@@ -547,7 +556,12 @@ void GameCooker::GetCurrentPlatform(PlatformType& platform, BuildPlatform& build
switch (PLATFORM_TYPE)
{
case PlatformType::Windows:
- buildPlatform = PLATFORM_64BITS ? BuildPlatform::Windows64 : BuildPlatform::Windows32;
+ if (PLATFORM_ARCH == ArchitectureType::x64)
+ buildPlatform = BuildPlatform::Windows64;
+ else if (PLATFORM_ARCH == ArchitectureType::ARM64)
+ buildPlatform = BuildPlatform::WindowsARM64;
+ else
+ buildPlatform = BuildPlatform::Windows32;
break;
case PlatformType::XboxOne:
buildPlatform = BuildPlatform::XboxOne;
diff --git a/Source/Editor/Cooker/Steps/CookAssetsStep.cpp b/Source/Editor/Cooker/Steps/CookAssetsStep.cpp
index 52050708e..dddfc3ff9 100644
--- a/Source/Editor/Cooker/Steps/CookAssetsStep.cpp
+++ b/Source/Editor/Cooker/Steps/CookAssetsStep.cpp
@@ -447,6 +447,7 @@ bool ProcessShaderBase(CookAssetsStep::AssetCookData& data, ShaderAssetBase* ass
#if PLATFORM_TOOLS_WINDOWS
case BuildPlatform::Windows32:
case BuildPlatform::Windows64:
+ case BuildPlatform::WindowsARM64:
{
const char* platformDefineName = "PLATFORM_WINDOWS";
const auto settings = WindowsPlatformSettings::Get();
diff --git a/Source/Editor/Cooker/Steps/DeployDataStep.cpp b/Source/Editor/Cooker/Steps/DeployDataStep.cpp
index 0b4f5d939..551002e0b 100644
--- a/Source/Editor/Cooker/Steps/DeployDataStep.cpp
+++ b/Source/Editor/Cooker/Steps/DeployDataStep.cpp
@@ -73,6 +73,7 @@ bool DeployDataStep::Perform(CookingData& data)
{
case BuildPlatform::Windows32:
case BuildPlatform::Windows64:
+ case BuildPlatform::WindowsARM64:
canUseSystemDotnet = PLATFORM_TYPE == PlatformType::Windows;
break;
case BuildPlatform::LinuxX64:
@@ -159,7 +160,20 @@ bool DeployDataStep::Perform(CookingData& data)
}
else
{
- failed |= EditorUtilities::CopyDirectoryIfNewer(dstDotnet / TEXT("host/fxr") / version, srcDotnet / TEXT("host/fxr") / version, true);
+ // TODO: hostfxr for target platform should be copied from nuget package location: microsoft.netcore.app.runtime.//runtimes//native/hostfxr.dll
+ String dstHostfxr = dstDotnet / TEXT("host/fxr") / version;
+ if (!FileSystem::DirectoryExists(dstHostfxr))
+ FileSystem::CreateDirectory(dstHostfxr);
+ const Char *platformName, *archName;
+ data.GetBuildPlatformName(platformName, archName);
+ if (data.Platform == BuildPlatform::Windows64 || data.Platform == BuildPlatform::WindowsARM64 || data.Platform == BuildPlatform::Windows32)
+ failed |= FileSystem::CopyFile(dstHostfxr / TEXT("hostfxr.dll"), depsRoot / TEXT("ThirdParty") / archName / TEXT("hostfxr.dll"));
+ else if (data.Platform == BuildPlatform::LinuxX64)
+ failed |= FileSystem::CopyFile(dstHostfxr / TEXT("hostfxr.so"), depsRoot / TEXT("ThirdParty") / archName / TEXT("hostfxr.so"));
+ else if (data.Platform == BuildPlatform::MacOSx64 || data.Platform == BuildPlatform::MacOSARM64)
+ failed |= FileSystem::CopyFile(dstHostfxr / TEXT("hostfxr.dylib"), depsRoot / TEXT("ThirdParty") / archName / TEXT("hostfxr.dylib"));
+ else
+ failed |= true;
failed |= EditorUtilities::CopyDirectoryIfNewer(dstDotnet / TEXT("shared/Microsoft.NETCore.App") / version, srcDotnet / TEXT("shared/Microsoft.NETCore.App") / version, true);
}
if (failed)
diff --git a/Source/Editor/Windows/GameCookerWindow.cs b/Source/Editor/Windows/GameCookerWindow.cs
index 55262910c..855faed63 100644
--- a/Source/Editor/Windows/GameCookerWindow.cs
+++ b/Source/Editor/Windows/GameCookerWindow.cs
@@ -767,13 +767,6 @@ namespace FlaxEditor.Windows
Platform = BuildPlatform.Windows64,
Mode = BuildConfiguration.Development,
},
- new BuildTarget
- {
- Name = "Windows 32bit",
- Output = "Output\\Win32",
- Platform = BuildPlatform.Windows32,
- Mode = BuildConfiguration.Development,
- },
}
};
_data = presets;
@@ -793,9 +786,9 @@ namespace FlaxEditor.Windows
Array.Copy(_data[_selectedPresetIndex].Targets, targets, count);
targets[count] = new BuildTarget
{
- Name = "Xbox One",
- Output = "Output\\XboxOne",
- Platform = BuildPlatform.XboxOne,
+ Name = "Windows 64bit",
+ Output = "Output\\Win64",
+ Platform = BuildPlatform.Windows64,
Mode = BuildConfiguration.Development,
};
_data[_selectedPresetIndex].Targets = targets;
diff --git a/Source/Engine/Core/Memory/Allocation.h b/Source/Engine/Core/Memory/Allocation.h
index 42b39a682..7d28c70cb 100644
--- a/Source/Engine/Core/Memory/Allocation.h
+++ b/Source/Engine/Core/Memory/Allocation.h
@@ -15,7 +15,7 @@ public:
enum { HasSwap = false };
template
- class Data
+ class alignas(sizeof(void*)) Data
{
private:
byte _data[Capacity * sizeof(T)];
@@ -183,7 +183,7 @@ public:
enum { HasSwap = false };
template
- class Data
+ class alignas(sizeof(void*)) Data
{
private:
typedef typename OtherAllocator::template Data OtherData;
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUDeviceDX11.cpp b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUDeviceDX11.cpp
index 3e6d97b28..432a44ee8 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUDeviceDX11.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUDeviceDX11.cpp
@@ -71,6 +71,27 @@ static bool TryCreateDevice(IDXGIAdapter* adapter, D3D_FEATURE_LEVEL maxFeatureL
context->Release();
return true;
}
+#if GPU_ENABLE_DIAGNOSTICS
+ deviceFlags &= ~D3D11_CREATE_DEVICE_DEBUG;
+ if (SUCCEEDED(D3D11CreateDevice(
+ adapter,
+ D3D_DRIVER_TYPE_UNKNOWN,
+ NULL,
+ deviceFlags,
+ &featureLevels[levelIndex],
+ ARRAY_COUNT(featureLevels) - levelIndex,
+ D3D11_SDK_VERSION,
+ &device,
+ featureLevel,
+ &context
+ )))
+ {
+ LOG(Warning, "Direct3D SDK debug layers were requested, but not available.");
+ device->Release();
+ context->Release();
+ return true;
+ }
+#endif
return false;
}
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUContextDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUContextDX12.cpp
index 45d3e3777..8c31a358a 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUContextDX12.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUContextDX12.cpp
@@ -2,6 +2,20 @@
#if GRAPHICS_API_DIRECTX12
+#include "Engine/Graphics/Config.h"
+#if USE_PIX && GPU_ALLOW_PROFILE_EVENTS
+// Include these header files before pix3
+#define WIN32_LEAN_AND_MEAN
+#define NOMINMAX
+#define NOGDI
+#define NODRAWTEXT
+//#define NOCTLMGR
+#define NOFLATSBAPIS
+#include
+#include
+#include
+#endif
+
#include "GPUContextDX12.h"
#include "Engine/Core/Log.h"
#include "Engine/Core/Math/Viewport.h"
@@ -22,9 +36,6 @@
#include "Engine/Profiler/RenderStats.h"
#include "Engine/Graphics/Shaders/GPUShader.h"
#include "Engine/Threading/Threading.h"
-#if USE_PIX && GPU_ALLOW_PROFILE_EVENTS
-#include
-#endif
#define DX12_ENABLE_RESOURCE_BARRIERS_BATCHING 1
#define DX12_ENABLE_RESOURCE_BARRIERS_DEBUGGING 0
diff --git a/Source/Engine/Platform/Win32/Win32Defines.h b/Source/Engine/Platform/Win32/Win32Defines.h
index 891e86839..4571dc419 100644
--- a/Source/Engine/Platform/Win32/Win32Defines.h
+++ b/Source/Engine/Platform/Win32/Win32Defines.h
@@ -6,10 +6,14 @@
// Platform description
#define PLATFORM_DESKTOP 1
-#if defined(WIN64)
+#if defined(WIN64) && defined(_M_X64)
#define PLATFORM_64BITS 1
#define PLATFORM_ARCH_X64 1
#define PLATFORM_ARCH ArchitectureType::x64
+#elif defined(WIN64) && defined(_M_ARM64)
+#define PLATFORM_64BITS 1
+#define PLATFORM_ARCH_ARM64 1
+#define PLATFORM_ARCH ArchitectureType::ARM64
#else
#define PLATFORM_64BITS 0
#define PLATFORM_ARCH_X86 1
diff --git a/Source/Engine/Platform/Win32/Win32Platform.cpp b/Source/Engine/Platform/Win32/Win32Platform.cpp
index 25559d411..bbc8c4ba1 100644
--- a/Source/Engine/Platform/Win32/Win32Platform.cpp
+++ b/Source/Engine/Platform/Win32/Win32Platform.cpp
@@ -159,10 +159,14 @@ bool Win32Platform::Init()
CpuInfo.PageSize = siSysInfo.dwPageSize;
CpuInfo.ClockSpeed = ClockFrequency;
{
+#ifdef _M_ARM64
+ CpuInfo.CacheLineSize = 128;
+#else
int args[4];
__cpuid(args, 0x80000006);
CpuInfo.CacheLineSize = args[2] & 0xFF;
ASSERT(CpuInfo.CacheLineSize && Math::IsPowerOfTwo(CpuInfo.CacheLineSize));
+#endif
}
// Setup unique device ID
@@ -229,10 +233,12 @@ void Win32Platform::MemoryBarrier()
{
_ReadWriteBarrier();
#if PLATFORM_64BITS
-#ifdef _AMD64_
+#if defined(_AMD64_)
__faststorefence();
#elif defined(_IA64_)
__mf();
+#elif defined(_ARM64_)
+ __dmb(_ARM64_BARRIER_ISH);
#else
#error "Invalid platform."
#endif
@@ -246,7 +252,11 @@ void Win32Platform::MemoryBarrier()
void Win32Platform::Prefetch(void const* ptr)
{
+#if _M_ARM64
+ __prefetch((char const*)ptr);
+#else
_mm_prefetch((char const*)ptr, _MM_HINT_T0);
+#endif
}
void* Win32Platform::Allocate(uint64 size, uint64 alignment)
diff --git a/Source/Engine/Platform/Windows/WindowsPlatform.cpp b/Source/Engine/Platform/Windows/WindowsPlatform.cpp
index ba450d7ee..0f1159fc5 100644
--- a/Source/Engine/Platform/Windows/WindowsPlatform.cpp
+++ b/Source/Engine/Platform/Windows/WindowsPlatform.cpp
@@ -1312,6 +1312,14 @@ Array WindowsPlatform::GetStackFrames(int32 skipCount,
stack.AddrBStore.Mode = AddrModeFlat;
stack.AddrStack.Offset = ctx.IntSp;
stack.AddrStack.Mode = AddrModeFlat;
+#elif _M_ARM64
+ imageType = IMAGE_FILE_MACHINE_ARM64;
+ stack.AddrPC.Offset = ctx.Pc;
+ stack.AddrPC.Mode = AddrModeFlat;
+ stack.AddrFrame.Offset = ctx.Fp;
+ stack.AddrFrame.Mode = AddrModeFlat;
+ stack.AddrStack.Offset = ctx.Sp;
+ stack.AddrStack.Mode = AddrModeFlat;
#else
#error "Platform not supported!"
#endif
diff --git a/Source/Engine/Scripting/Runtime/DotNet.cpp b/Source/Engine/Scripting/Runtime/DotNet.cpp
index a3ec1321f..25213ec46 100644
--- a/Source/Engine/Scripting/Runtime/DotNet.cpp
+++ b/Source/Engine/Scripting/Runtime/DotNet.cpp
@@ -1777,13 +1777,18 @@ bool InitHostfxr()
{
case PlatformType::Windows:
case PlatformType::UWP:
- platformStr = PLATFORM_64BITS ? "Windows x64" : "Windows x86";
+ if (PLATFORM_ARCH == ArchitectureType::x64)
+ platformStr = "Windows x64";
+ else if (PLATFORM_ARCH == ArchitectureType::ARM64)
+ platformStr = "Windows ARM64";
+ else
+ platformStr = "Windows x86";
break;
case PlatformType::Linux:
- platformStr = PLATFORM_ARCH_ARM64 ? "Linux Arm64" : PLATFORM_ARCH_ARM ? "Linux Arm32" : PLATFORM_64BITS ? "Linux x64" : "Linux x86";
+ platformStr = PLATFORM_ARCH_ARM64 ? "Linux ARM64" : PLATFORM_ARCH_ARM ? "Linux Arm32" : PLATFORM_64BITS ? "Linux x64" : "Linux x86";
break;
case PlatformType::Mac:
- platformStr = PLATFORM_ARCH_ARM || PLATFORM_ARCH_ARM64 ? "macOS Arm64" : PLATFORM_64BITS ? "macOS x64" : "macOS x86";
+ platformStr = PLATFORM_ARCH_ARM || PLATFORM_ARCH_ARM64 ? "macOS ARM64" : PLATFORM_64BITS ? "macOS x64" : "macOS x86";
break;
default:;
platformStr = "";
diff --git a/Source/Engine/Scripting/ScriptingType.h b/Source/Engine/Scripting/ScriptingType.h
index 17a844097..01335b6cb 100644
--- a/Source/Engine/Scripting/ScriptingType.h
+++ b/Source/Engine/Scripting/ScriptingType.h
@@ -493,6 +493,66 @@ FORCE_INLINE int32 GetVTableIndex(void** vtable, int32 entriesCount, void* func)
if (op == 0x20)
return 0;
return *(byte*)funcJmp / sizeof(void*);
+#elif defined(_MSC_VER) && PLATFORM_ARCH_ARM64
+ // For MSVC ARM64, the following thunk takes a relative jump from the function pointer to the next thunk:
+ // adrp xip0, offset_high
+ // add xip0, xip0, offset_low
+ // br xip0
+ // The last thunk contains the offset to the vtable:
+ // ldr xip0, [x0]
+ // ldr xip0, [xip0, XXX]
+ uint32_t* op = (uint32_t*)func;
+
+ uint32_t def = *op;
+ if ((*op & 0x9F000000) == 0x90000000)
+ {
+ // adrp
+ uint32_t imm20 = (((*op & 0x60000000) >> 29) + ((*op & 0xFFFFE0) >> 3)) << 12;
+ op++;
+
+ // add
+ def = *op;
+ uint32_t imm12 = (*op & 0x3FFC00) >> 10;
+ imm12 = (*op & 0x400000) != 0 ? (imm12 << 12) : imm12;
+
+ // br
+ op = (uint32_t*)(((uintptr)func & ((uintptr)-1 << 12)) + imm20 + imm12) + 1;
+
+ // ldr + offset
+ def = *op;
+ uint32_t offset = ((*op & 0x3FFC00) >> 10) * ((*op & 0x40000000) != 0 ? 8 : 4);
+ return offset / sizeof(void*);
+ }
+ else if ((*op & 0xBFC00000) == 0xB9400000)
+ {
+ // ldr + offset
+ uint32_t offset = ((*op & 0x3FFC00) >> 10) * ((*op & 0x40000000) != 0 ? 8 : 4);
+ op++;
+
+ // ldr + offset
+ def = *op;
+ if ((*op & 0xBFE00C00) == 0xB8400400)
+ {
+ // offset is stored in the register as is
+ uint32_t postindex = (*op & 0x1FF000) >> 12;
+ offset = postindex;
+ return offset / sizeof(void*);
+ }
+ else if ((*op & 0xBFE00C00) == 0xB8400C00)
+ {
+ // offset is added to the value in base register... updated to the same register
+ uint32_t preindex = (*op & 0x1FF000) >> 12;
+ offset += preindex;
+ return offset / sizeof(void*);
+ }
+ else if ((*op & 0xBFC00000) == 0xB9400000)
+ {
+ // 20-bit offset
+ offset = ((*op & 0x3FFC00) >> 10) * ((*op & 0x40000000) != 0 ? 8 : 4);
+ return offset / sizeof(void*);
+ }
+ CRASH;
+ }
#elif defined(__clang__)
// On Clang member function pointer represents the offset from the vtable begin.
return (int32)(intptr)func / sizeof(void*);
diff --git a/Source/FlaxEditor.Build.cs b/Source/FlaxEditor.Build.cs
index b6074e264..e77fcaade 100644
--- a/Source/FlaxEditor.Build.cs
+++ b/Source/FlaxEditor.Build.cs
@@ -56,6 +56,9 @@ public class FlaxEditor : EngineTarget
case TargetArchitecture.x86:
options.OutputFolder = Path.Combine(options.WorkingDirectory, "Binaries", "Editor", "Win32", options.Configuration.ToString());
break;
+ case TargetArchitecture.ARM64:
+ options.OutputFolder = Path.Combine(options.WorkingDirectory, "Binaries", "Editor", "ARM64", options.Configuration.ToString());
+ break;
default: throw new InvalidArchitectureException(options.Architecture, "Not supported Editor architecture.");
}
break;
diff --git a/Source/ThirdParty/DirectXMesh/DirectXMesh.h b/Source/ThirdParty/DirectXMesh/DirectXMesh.h
index 9a8c72a3b..f3c3779dd 100644
--- a/Source/ThirdParty/DirectXMesh/DirectXMesh.h
+++ b/Source/ThirdParty/DirectXMesh/DirectXMesh.h
@@ -1,9 +1,9 @@
//-------------------------------------------------------------------------------------
// DirectXMesh.h
-//
+//
// DirectX Mesh Geometry Library
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/?LinkID=324981
@@ -11,51 +11,63 @@
#pragma once
+#include
+#include
#include
#include
#include
+#include
#include
-#include
-
-#if !defined(__d3d11_h__) && !defined(__d3d11_x_h__) && !defined(__d3d12_h__) && !defined(__d3d12_x_h__)
-#if defined(_XBOX_ONE) && defined(_TITLE)
-#include
+#ifdef _WIN32
+#if !defined(__d3d11_h__) && !defined(__d3d11_x_h__) && !defined(__d3d12_h__) && !defined(__d3d12_x_h__) && !defined(__XBOX_D3D12_X__)
+#ifdef _GAMING_XBOX_SCARLETT
+#include
+#elif defined(_GAMING_XBOX)
+#include
+#elif defined(_XBOX_ONE) && defined(_TITLE)
+#error This library no longer supports legacy Xbox One XDK
#else
#include
#endif
#endif
+#else // !WIN32
+#include
+#include
+#endif
-#include
+#include
+#include
+#include
-#define DIRECTX_MESH_VERSION 130
+#define DIRECTX_MESH_VERSION 166
namespace DirectX
{
//---------------------------------------------------------------------------------
// DXGI Format Utilities
- bool __cdecl IsValidVB(_In_ DXGI_FORMAT fmt);
- bool __cdecl IsValidIB(_In_ DXGI_FORMAT fmt);
- size_t __cdecl BytesPerElement(_In_ DXGI_FORMAT fmt);
+ bool __cdecl IsValidVB(_In_ DXGI_FORMAT fmt) noexcept;
+ constexpr bool __cdecl IsValidIB(_In_ DXGI_FORMAT fmt) noexcept;
+ size_t __cdecl BytesPerElement(_In_ DXGI_FORMAT fmt) noexcept;
//---------------------------------------------------------------------------------
// Input Layout Descriptor Utilities
#if defined(__d3d11_h__) || defined(__d3d11_x_h__)
- bool __cdecl IsValid(_In_reads_(nDecl) const D3D11_INPUT_ELEMENT_DESC* vbDecl, _In_ size_t nDecl);
+ bool __cdecl IsValid(_In_reads_(nDecl) const D3D11_INPUT_ELEMENT_DESC* vbDecl, _In_ size_t nDecl) noexcept;
void __cdecl ComputeInputLayout(
_In_reads_(nDecl) const D3D11_INPUT_ELEMENT_DESC* vbDecl, _In_ size_t nDecl,
_Out_writes_opt_(nDecl) uint32_t* offsets,
- _Out_writes_opt_(D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT) uint32_t* strides);
+ _Out_writes_opt_(D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT) uint32_t* strides) noexcept;
#endif
-#if defined(__d3d12_h__) || defined(__d3d12_x_h__)
- bool __cdecl IsValid(const D3D12_INPUT_LAYOUT_DESC& vbDecl);
+#if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__)
+ bool __cdecl IsValid(const D3D12_INPUT_LAYOUT_DESC& vbDecl) noexcept;
void __cdecl ComputeInputLayout(
const D3D12_INPUT_LAYOUT_DESC& vbDecl,
_Out_writes_opt_(vbDecl.NumElements) uint32_t* offsets,
- _Out_writes_opt_(D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT) uint32_t* strides);
+ _Out_writes_opt_(D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT) uint32_t* strides) noexcept;
#endif
//---------------------------------------------------------------------------------
@@ -80,8 +92,8 @@ namespace DirectX
{
public:
VBReader() noexcept(false);
- VBReader(VBReader&& moveFrom) noexcept;
- VBReader& operator= (VBReader&& moveFrom) noexcept;
+ VBReader(VBReader&&) noexcept;
+ VBReader& operator= (VBReader&&) noexcept;
VBReader(VBReader const&) = delete;
VBReader& operator= (VBReader const&) = delete;
@@ -93,12 +105,12 @@ namespace DirectX
// Does not support VB decls with D3D11_INPUT_PER_INSTANCE_DATA
#endif
- #if defined(__d3d12_h__) || defined(__d3d12_x_h__)
+ #if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__)
HRESULT __cdecl Initialize(const D3D12_INPUT_LAYOUT_DESC& vbDecl);
// Does not support VB decls with D3D12_INPUT_CLASSIFICATION_PER_INSTANCE_DATA
#endif
- HRESULT __cdecl AddStream(_In_reads_bytes_(stride*nVerts) const void* vb, _In_ size_t nVerts, _In_ size_t inputSlot, _In_ size_t stride = 0);
+ HRESULT __cdecl AddStream(_In_reads_bytes_(stride*nVerts) const void* vb, _In_ size_t nVerts, _In_ size_t inputSlot, _In_ size_t stride = 0) noexcept;
// Add vertex buffer to reader
HRESULT __cdecl Read(_Out_writes_(count) XMVECTOR* buffer, _In_z_ const char* semanticName, _In_ unsigned int semanticIndex, _In_ size_t count, bool x2bias = false) const;
@@ -110,7 +122,7 @@ namespace DirectX
HRESULT __cdecl Read(_Out_writes_(count) XMFLOAT4* buffer, _In_z_ const char* semanticName, _In_ unsigned int semanticIndex, _In_ size_t count, bool x2bias = false) const;
// Helpers for data extraction
- void __cdecl Release();
+ void __cdecl Release() noexcept;
#if defined(__d3d11_h__) || defined(__d3d11_x_h__)
const D3D11_INPUT_ELEMENT_DESC* GetElement(_In_z_ const char* semanticName, _In_ unsigned int semanticIndex) const
@@ -121,7 +133,7 @@ namespace DirectX
const D3D11_INPUT_ELEMENT_DESC* __cdecl GetElement11(_In_z_ const char* semanticName, _In_ unsigned int semanticIndex) const;
#endif
- #if defined(__d3d12_h__) || defined(__d3d12_x_h__)
+ #if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__)
const D3D12_INPUT_ELEMENT_DESC* __cdecl GetElement12(_In_z_ const char* semanticName, _In_ unsigned int semanticIndex) const;
#endif
@@ -136,8 +148,8 @@ namespace DirectX
{
public:
VBWriter() noexcept(false);
- VBWriter(VBWriter&& moveFrom) noexcept;
- VBWriter& operator= (VBWriter&& moveFrom) noexcept;
+ VBWriter(VBWriter&&) noexcept;
+ VBWriter& operator= (VBWriter&&) noexcept;
VBWriter(VBWriter const&) = delete;
VBWriter& operator= (VBWriter const&) = delete;
@@ -149,12 +161,12 @@ namespace DirectX
// Does not support VB decls with D3D11_INPUT_PER_INSTANCE_DATA
#endif
- #if defined(__d3d12_h__) || defined(__d3d12_x_h__)
+ #if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__)
HRESULT __cdecl Initialize(const D3D12_INPUT_LAYOUT_DESC& vbDecl);
// Does not support VB decls with D3D12_INPUT_CLASSIFICATION_PER_INSTANCE_DATA
#endif
- HRESULT __cdecl AddStream(_Out_writes_bytes_(stride*nVerts) void* vb, _In_ size_t nVerts, _In_ size_t inputSlot, _In_ size_t stride = 0);
+ HRESULT __cdecl AddStream(_Out_writes_bytes_(stride*nVerts) void* vb, _In_ size_t nVerts, _In_ size_t inputSlot, _In_ size_t stride = 0) noexcept;
// Add vertex buffer to writer
HRESULT __cdecl Write(_In_reads_(count) const XMVECTOR* buffer, _In_z_ const char* semanticName, _In_ unsigned int semanticIndex, _In_ size_t count, bool x2bias = false) const;
@@ -166,7 +178,7 @@ namespace DirectX
HRESULT __cdecl Write(_In_reads_(count) const XMFLOAT4* buffer, _In_z_ const char* semanticName, _In_ unsigned int semanticIndex, _In_ size_t count, bool x2bias = false) const;
// Helpers for data insertion
- void __cdecl Release();
+ void __cdecl Release() noexcept;
#if defined(__d3d11_h__) || defined(__d3d11_x_h__)
const D3D11_INPUT_ELEMENT_DESC* __cdecl GetElement(_In_z_ const char* semanticName, _In_ unsigned int semanticIndex) const
@@ -177,7 +189,7 @@ namespace DirectX
const D3D11_INPUT_ELEMENT_DESC* __cdecl GetElement11(_In_z_ const char* semanticName, _In_ unsigned int semanticIndex) const;
#endif
- #if defined(__d3d12_h__) || defined(__d3d12_x_h__)
+ #if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__)
const D3D12_INPUT_ELEMENT_DESC* __cdecl GetElement12(_In_z_ const char* semanticName, _In_ unsigned int semanticIndex) const;
#endif
@@ -221,42 +233,42 @@ namespace DirectX
_In_reads_(nFaces * 3) const uint16_t* indices, _In_ size_t nFaces,
_In_reads_(nVerts) const uint32_t* pointRep,
_In_reads_(nFaces * 3) const uint32_t* adjacency, _In_ size_t nVerts,
- _Out_writes_(nFaces * 6) uint16_t* indicesAdj);
+ _Out_writes_(nFaces * 6) uint16_t* indicesAdj) noexcept;
HRESULT __cdecl GenerateGSAdjacency(
_In_reads_(nFaces * 3) const uint32_t* indices, _In_ size_t nFaces,
_In_reads_(nVerts) const uint32_t* pointRep,
_In_reads_(nFaces * 3) const uint32_t* adjacency, _In_ size_t nVerts,
- _Out_writes_(nFaces * 6) uint32_t* indicesAdj);
+ _Out_writes_(nFaces * 6) uint32_t* indicesAdj) noexcept;
// Generates an IB suitable for Geometry Shader using D3D1x_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ
//---------------------------------------------------------------------------------
// Normals, Tangents, and Bi-Tangents Computation
- enum CNORM_FLAGS
+ enum CNORM_FLAGS : unsigned long
{
- CNORM_DEFAULT = 0x0,
- // Default is to compute normals using weight-by-angle
+ CNORM_DEFAULT = 0x0,
+ // Default is to compute normals using weight-by-angle
- CNORM_WEIGHT_BY_AREA = 0x1,
- // Computes normals using weight-by-area
+ CNORM_WEIGHT_BY_AREA = 0x1,
+ // Computes normals using weight-by-area
- CNORM_WEIGHT_EQUAL = 0x2,
- // Compute normals with equal weights
+ CNORM_WEIGHT_EQUAL = 0x2,
+ // Compute normals with equal weights
- CNORM_WIND_CW = 0x4,
- // Vertices are clock-wise (defaults to CCW)
+ CNORM_WIND_CW = 0x4,
+ // Vertices are clock-wise (defaults to CCW)
};
HRESULT __cdecl ComputeNormals(
_In_reads_(nFaces * 3) const uint16_t* indices, _In_ size_t nFaces,
_In_reads_(nVerts) const XMFLOAT3* positions, _In_ size_t nVerts,
- _In_ DWORD flags,
- _Out_writes_(nVerts) XMFLOAT3* normals);
+ _In_ CNORM_FLAGS flags,
+ _Out_writes_(nVerts) XMFLOAT3* normals) noexcept;
HRESULT __cdecl ComputeNormals(
_In_reads_(nFaces * 3) const uint32_t* indices, _In_ size_t nFaces,
_In_reads_(nVerts) const XMFLOAT3* positions, _In_ size_t nVerts,
- _In_ DWORD flags,
- _Out_writes_(nVerts) XMFLOAT3* normals);
+ _In_ CNORM_FLAGS flags,
+ _Out_writes_(nVerts) XMFLOAT3* normals) noexcept;
// Computes vertex normals
HRESULT __cdecl ComputeTangentFrame(
@@ -265,73 +277,73 @@ namespace DirectX
_In_reads_(nVerts) const XMFLOAT3* normals,
_In_reads_(nVerts) const XMFLOAT2* texcoords, _In_ size_t nVerts,
_Out_writes_opt_(nVerts) XMFLOAT3* tangents,
- _Out_writes_opt_(nVerts) XMFLOAT3* bitangents);
+ _Out_writes_opt_(nVerts) XMFLOAT3* bitangents) noexcept;
HRESULT __cdecl ComputeTangentFrame(
_In_reads_(nFaces * 3) const uint32_t* indices, _In_ size_t nFaces,
_In_reads_(nVerts) const XMFLOAT3* positions,
_In_reads_(nVerts) const XMFLOAT3* normals,
_In_reads_(nVerts) const XMFLOAT2* texcoords, _In_ size_t nVerts,
_Out_writes_opt_(nVerts) XMFLOAT3* tangents,
- _Out_writes_opt_(nVerts) XMFLOAT3* bitangents);
+ _Out_writes_opt_(nVerts) XMFLOAT3* bitangents) noexcept;
HRESULT __cdecl ComputeTangentFrame(
_In_reads_(nFaces * 3) const uint16_t* indices, _In_ size_t nFaces,
_In_reads_(nVerts) const XMFLOAT3* positions,
_In_reads_(nVerts) const XMFLOAT3* normals,
_In_reads_(nVerts) const XMFLOAT2* texcoords, _In_ size_t nVerts,
_Out_writes_opt_(nVerts) XMFLOAT4* tangents,
- _Out_writes_opt_(nVerts) XMFLOAT3* bitangents);
+ _Out_writes_opt_(nVerts) XMFLOAT3* bitangents) noexcept;
HRESULT __cdecl ComputeTangentFrame(
_In_reads_(nFaces * 3) const uint32_t* indices, _In_ size_t nFaces,
_In_reads_(nVerts) const XMFLOAT3* positions,
_In_reads_(nVerts) const XMFLOAT3* normals,
_In_reads_(nVerts) const XMFLOAT2* texcoords, _In_ size_t nVerts,
_Out_writes_opt_(nVerts) XMFLOAT4* tangents,
- _Out_writes_opt_(nVerts) XMFLOAT3* bitangents);
+ _Out_writes_opt_(nVerts) XMFLOAT3* bitangents) noexcept;
HRESULT __cdecl ComputeTangentFrame(
_In_reads_(nFaces * 3) const uint16_t* indices, _In_ size_t nFaces,
_In_reads_(nVerts) const XMFLOAT3* positions,
_In_reads_(nVerts) const XMFLOAT3* normals,
_In_reads_(nVerts) const XMFLOAT2* texcoords, _In_ size_t nVerts,
- _Out_writes_(nVerts) XMFLOAT4* tangents);
+ _Out_writes_(nVerts) XMFLOAT4* tangents) noexcept;
HRESULT __cdecl ComputeTangentFrame(
_In_reads_(nFaces * 3) const uint32_t* indices, _In_ size_t nFaces,
_In_reads_(nVerts) const XMFLOAT3* positions,
_In_reads_(nVerts) const XMFLOAT3* normals,
_In_reads_(nVerts) const XMFLOAT2* texcoords, _In_ size_t nVerts,
- _Out_writes_(nVerts) XMFLOAT4* tangents);
+ _Out_writes_(nVerts) XMFLOAT4* tangents) noexcept;
// Computes tangents and/or bi-tangents (optionally with handedness stored in .w)
//---------------------------------------------------------------------------------
// Mesh clean-up and validation
- enum VALIDATE_FLAGS
+ enum VALIDATE_FLAGS : unsigned long
{
- VALIDATE_DEFAULT = 0x0,
+ VALIDATE_DEFAULT = 0x0,
- VALIDATE_BACKFACING = 0x1,
- // Check for duplicate neighbor from triangle (requires adjacency)
+ VALIDATE_BACKFACING = 0x1,
+ // Check for duplicate neighbor from triangle (requires adjacency)
- VALIDATE_BOWTIES = 0x2,
- // Check for two fans of triangles using the same vertex (requires adjacency)
+ VALIDATE_BOWTIES = 0x2,
+ // Check for two fans of triangles using the same vertex (requires adjacency)
- VALIDATE_DEGENERATE = 0x4,
- // Check for degenerate triangles
+ VALIDATE_DEGENERATE = 0x4,
+ // Check for degenerate triangles
- VALIDATE_UNUSED = 0x8,
- // Check for issues with 'unused' triangles
+ VALIDATE_UNUSED = 0x8,
+ // Check for issues with 'unused' triangles
- VALIDATE_ASYMMETRIC_ADJ = 0x10,
- // Checks that neighbors are symmetric (requires adjacency)
+ VALIDATE_ASYMMETRIC_ADJ = 0x10,
+ // Checks that neighbors are symmetric (requires adjacency)
};
HRESULT __cdecl Validate(
_In_reads_(nFaces * 3) const uint16_t* indices, _In_ size_t nFaces,
_In_ size_t nVerts, _In_reads_opt_(nFaces * 3) const uint32_t* adjacency,
- _In_ DWORD flags, _In_opt_ std::wstring* msgs = nullptr);
+ _In_ VALIDATE_FLAGS flags, _In_opt_ std::wstring* msgs = nullptr);
HRESULT __cdecl Validate(
_In_reads_(nFaces * 3) const uint32_t* indices, _In_ size_t nFaces,
_In_ size_t nVerts, _In_reads_opt_(nFaces * 3) const uint32_t* adjacency,
- _In_ DWORD flags, _In_opt_ std::wstring* msgs = nullptr);
+ _In_ VALIDATE_FLAGS flags, _In_opt_ std::wstring* msgs = nullptr);
// Checks the mesh for common problems, return 'S_OK' if no problems were found
HRESULT __cdecl Clean(
@@ -361,6 +373,15 @@ namespace DirectX
_In_ std::function weldTest);
// Welds vertices together based on a test function
+ HRESULT __cdecl ConcatenateMesh(
+ _In_ size_t nFaces,
+ _In_ size_t nVerts,
+ _Out_writes_(nFaces) uint32_t* faceDestMap,
+ _Out_writes_(nVerts) uint32_t* vertexDestMap,
+ _Inout_ size_t& totalFaces,
+ _Inout_ size_t& totalVerts) noexcept;
+ // Merge meshes together
+
//---------------------------------------------------------------------------------
// Mesh Optimization
@@ -369,17 +390,17 @@ namespace DirectX
_Out_writes_(nFaces) uint32_t* faceRemap);
// Reorders faces by attribute id
- enum OPTFACES
+ enum OPTFACES : uint32_t
{
- OPTFACES_V_DEFAULT = 12,
- OPTFACES_R_DEFAULT = 7,
- // Default vertex cache size and restart threshold which is considered 'device independent'
+ OPTFACES_V_DEFAULT = 12,
+ OPTFACES_R_DEFAULT = 7,
+ // Default vertex cache size and restart threshold which is considered 'device independent'
- OPTFACES_LRU_DEFAULT = 32,
- // Default vertex cache size for the LRU algorithm
+ OPTFACES_LRU_DEFAULT = 32,
+ // Default vertex cache size for the LRU algorithm
- OPTFACES_V_STRIPORDER = 0,
- // Indicates no vertex cache optimization, only reordering into strips
+ OPTFACES_V_STRIPORDER = 0,
+ // Indicates no vertex cache optimization, only reordering into strips
};
HRESULT __cdecl OptimizeFaces(
@@ -432,10 +453,10 @@ namespace DirectX
HRESULT __cdecl OptimizeVertices(
_In_reads_(nFaces * 3) const uint16_t* indices, _In_ size_t nFaces, _In_ size_t nVerts,
- _Out_writes_(nVerts) uint32_t* vertexRemap, _Out_opt_ size_t* trailingUnused = nullptr);
+ _Out_writes_(nVerts) uint32_t* vertexRemap, _Out_opt_ size_t* trailingUnused = nullptr) noexcept;
HRESULT __cdecl OptimizeVertices(
_In_reads_(nFaces * 3) const uint32_t* indices, _In_ size_t nFaces, _In_ size_t nVerts,
- _Out_writes_(nVerts) uint32_t* vertexRemap, _Out_opt_ size_t* trailingUnused = nullptr);
+ _Out_writes_(nVerts) uint32_t* vertexRemap, _Out_opt_ size_t* trailingUnused = nullptr) noexcept;
// Reorders vertices in order of use
//---------------------------------------------------------------------------------
@@ -444,59 +465,59 @@ namespace DirectX
HRESULT __cdecl ReorderIB(
_In_reads_(nFaces * 3) const uint16_t* ibin, _In_ size_t nFaces,
_In_reads_(nFaces) const uint32_t* faceRemap,
- _Out_writes_(nFaces * 3) uint16_t* ibout);
+ _Out_writes_(nFaces * 3) uint16_t* ibout) noexcept;
HRESULT __cdecl ReorderIB(
_Inout_updates_all_(nFaces * 3) uint16_t* ib, _In_ size_t nFaces,
- _In_reads_(nFaces) const uint32_t* faceRemap);
+ _In_reads_(nFaces) const uint32_t* faceRemap) noexcept;
HRESULT __cdecl ReorderIB(
_In_reads_(nFaces * 3) const uint32_t* ibin, _In_ size_t nFaces,
_In_reads_(nFaces) const uint32_t* faceRemap,
- _Out_writes_(nFaces * 3) uint32_t* ibout);
+ _Out_writes_(nFaces * 3) uint32_t* ibout) noexcept;
HRESULT __cdecl ReorderIB(
_Inout_updates_all_(nFaces * 3) uint32_t* ib, _In_ size_t nFaces,
- _In_reads_(nFaces) const uint32_t* faceRemap);
+ _In_reads_(nFaces) const uint32_t* faceRemap) noexcept;
// Applies a face remap reordering to an index buffer
HRESULT __cdecl ReorderIBAndAdjacency(
_In_reads_(nFaces * 3) const uint16_t* ibin, _In_ size_t nFaces, _In_reads_(nFaces * 3) const uint32_t* adjin,
_In_reads_(nFaces) const uint32_t* faceRemap,
- _Out_writes_(nFaces * 3) uint16_t* ibout, _Out_writes_(nFaces * 3) uint32_t* adjout);
+ _Out_writes_(nFaces * 3) uint16_t* ibout, _Out_writes_(nFaces * 3) uint32_t* adjout) noexcept;
HRESULT __cdecl ReorderIBAndAdjacency(
_Inout_updates_all_(nFaces * 3) uint16_t* ib, _In_ size_t nFaces, _Inout_updates_all_(nFaces * 3) uint32_t* adj,
- _In_reads_(nFaces) const uint32_t* faceRemap);
+ _In_reads_(nFaces) const uint32_t* faceRemap) noexcept;
HRESULT __cdecl ReorderIBAndAdjacency(
_In_reads_(nFaces * 3) const uint32_t* ibin, _In_ size_t nFaces, _In_reads_(nFaces * 3) const uint32_t* adjin,
_In_reads_(nFaces) const uint32_t* faceRemap,
- _Out_writes_(nFaces * 3) uint32_t* ibout, _Out_writes_(nFaces * 3) uint32_t* adjout);
+ _Out_writes_(nFaces * 3) uint32_t* ibout, _Out_writes_(nFaces * 3) uint32_t* adjout) noexcept;
HRESULT __cdecl ReorderIBAndAdjacency(
_Inout_updates_all_(nFaces * 3) uint32_t* ib, _In_ size_t nFaces, _Inout_updates_all_(nFaces * 3) uint32_t* adj,
- _In_reads_(nFaces) const uint32_t* faceRemap);
+ _In_reads_(nFaces) const uint32_t* faceRemap) noexcept;
// Applies a face remap reordering to an index buffer and adjacency
HRESULT __cdecl FinalizeIB(
_In_reads_(nFaces * 3) const uint16_t* ibin, _In_ size_t nFaces,
_In_reads_(nVerts) const uint32_t* vertexRemap, _In_ size_t nVerts,
- _Out_writes_(nFaces * 3) uint16_t* ibout);
+ _Out_writes_(nFaces * 3) uint16_t* ibout) noexcept;
HRESULT __cdecl FinalizeIB(
_Inout_updates_all_(nFaces * 3) uint16_t* ib, _In_ size_t nFaces,
- _In_reads_(nVerts) const uint32_t* vertexRemap, _In_ size_t nVerts);
+ _In_reads_(nVerts) const uint32_t* vertexRemap, _In_ size_t nVerts) noexcept;
HRESULT __cdecl FinalizeIB(
_In_reads_(nFaces * 3) const uint32_t* ibin, _In_ size_t nFaces,
_In_reads_(nVerts) const uint32_t* vertexRemap, _In_ size_t nVerts,
- _Out_writes_(nFaces * 3) uint32_t* ibout);
+ _Out_writes_(nFaces * 3) uint32_t* ibout) noexcept;
HRESULT __cdecl FinalizeIB(
_Inout_updates_all_(nFaces * 3) uint32_t* ib, _In_ size_t nFaces,
- _In_reads_(nVerts) const uint32_t* vertexRemap, _In_ size_t nVerts);
+ _In_reads_(nVerts) const uint32_t* vertexRemap, _In_ size_t nVerts) noexcept;
// Applies a vertex remap reordering to an index buffer
HRESULT __cdecl FinalizeVB(
_In_reads_bytes_(nVerts*stride) const void* vbin, _In_ size_t stride, _In_ size_t nVerts,
_In_reads_opt_(nDupVerts) const uint32_t* dupVerts, _In_ size_t nDupVerts,
_In_reads_opt_(nVerts + nDupVerts) const uint32_t* vertexRemap,
- _Out_writes_bytes_((nVerts + nDupVerts)*stride) void* vbout);
+ _Out_writes_bytes_((nVerts + nDupVerts)*stride) void* vbout) noexcept;
HRESULT __cdecl FinalizeVB(
_Inout_updates_bytes_all_(nVerts*stride) void* vb, _In_ size_t stride, _In_ size_t nVerts,
- _In_reads_(nVerts) const uint32_t* vertexRemap);
+ _In_reads_(nVerts) const uint32_t* vertexRemap) noexcept;
// Applies a vertex remap and/or a vertex duplication set to a vertex buffer
HRESULT __cdecl FinalizeVBAndPointReps(
@@ -505,20 +526,125 @@ namespace DirectX
_In_reads_opt_(nDupVerts) const uint32_t* dupVerts, _In_ size_t nDupVerts,
_In_reads_opt_(nVerts + nDupVerts) const uint32_t* vertexRemap,
_Out_writes_bytes_((nVerts + nDupVerts)*stride) void* vbout,
- _Out_writes_(nVerts + nDupVerts) uint32_t* prout);
+ _Out_writes_(nVerts + nDupVerts) uint32_t* prout) noexcept;
HRESULT __cdecl FinalizeVBAndPointReps(
_Inout_updates_bytes_all_(nVerts*stride) void* vb, _In_ size_t stride, _In_ size_t nVerts,
_Inout_updates_all_(nVerts) uint32_t* pointRep,
- _In_reads_(nVerts) const uint32_t* vertexRemap);
+ _In_reads_(nVerts) const uint32_t* vertexRemap) noexcept;
// Applies a vertex remap and/or a vertex duplication set to a vertex buffer and point representatives
HRESULT __cdecl CompactVB(
_In_reads_bytes_(nVerts*stride) const void* vbin, _In_ size_t stride, _In_ size_t nVerts,
_In_ size_t trailingUnused,
_In_reads_opt_(nVerts) const uint32_t* vertexRemap,
- _Out_writes_bytes_((nVerts - trailingUnused)*stride) void* vbout);
+ _Out_writes_bytes_((nVerts - trailingUnused)*stride) void* vbout) noexcept;
// Applies a vertex remap which contains a known number of unused entries at the end
+ //---------------------------------------------------------------------------------
+ // Meshlet Generation
+
+ constexpr size_t MESHLET_DEFAULT_MAX_VERTS = 128u;
+ constexpr size_t MESHLET_DEFAULT_MAX_PRIMS = 128u;
+
+ constexpr size_t MESHLET_MINIMUM_SIZE = 32u;
+ constexpr size_t MESHLET_MAXIMUM_SIZE = 256u;
+
+ enum MESHLET_FLAGS : unsigned long
+ {
+ MESHLET_DEFAULT = 0x0,
+
+ MESHLET_WIND_CW = 0x1,
+ // Vertices are clock-wise (defaults to CCW)
+ };
+
+ struct Meshlet
+ {
+ uint32_t VertCount;
+ uint32_t VertOffset;
+ uint32_t PrimCount;
+ uint32_t PrimOffset;
+ };
+
+ struct MeshletTriangle
+ {
+ uint32_t i0 : 10;
+ uint32_t i1 : 10;
+ uint32_t i2 : 10;
+ };
+
+ struct CullData
+ {
+ DirectX::BoundingSphere BoundingSphere; // xyz = center, w = radius
+ DirectX::PackedVector::XMUBYTEN4 NormalCone; // xyz = axis, w = -cos(a + 90)
+ float ApexOffset; // apex = center - axis * offset
+ };
+
+ HRESULT __cdecl ComputeMeshlets(
+ _In_reads_(nFaces * 3) const uint16_t* indices, _In_ size_t nFaces,
+ _In_reads_(nVerts) const XMFLOAT3* positions, _In_ size_t nVerts,
+ _In_reads_opt_(nFaces * 3) const uint32_t* adjacency,
+ _Inout_ std::vector& meshlets,
+ _Inout_ std::vector& uniqueVertexIB,
+ _Inout_ std::vector& primitiveIndices,
+ _In_ size_t maxVerts = MESHLET_DEFAULT_MAX_VERTS, _In_ size_t maxPrims = MESHLET_DEFAULT_MAX_PRIMS);
+ HRESULT __cdecl ComputeMeshlets(
+ _In_reads_(nFaces * 3) const uint32_t* indices, _In_ size_t nFaces,
+ _In_reads_(nVerts) const XMFLOAT3* positions, _In_ size_t nVerts,
+ _In_reads_opt_(nFaces * 3) const uint32_t* adjacency,
+ _Inout_ std::vector& meshlets,
+ _Inout_ std::vector& uniqueVertexIB,
+ _Inout_ std::vector& primitiveIndices,
+ _In_ size_t maxVerts = MESHLET_DEFAULT_MAX_VERTS, _In_ size_t maxPrims = MESHLET_DEFAULT_MAX_PRIMS);
+ // Generates meshlets for a single subset mesh
+
+ HRESULT __cdecl ComputeMeshlets(
+ _In_reads_(nFaces * 3) const uint16_t* indices, _In_ size_t nFaces,
+ _In_reads_(nVerts) const XMFLOAT3* positions, _In_ size_t nVerts,
+ _In_reads_(nSubsets) const std::pair* subsets, _In_ size_t nSubsets,
+ _In_reads_opt_(nFaces * 3) const uint32_t* adjacency,
+ _Inout_ std::vector& meshlets,
+ _Inout_ std::vector& uniqueVertexIB,
+ _Inout_ std::vector& primitiveIndices,
+ _Out_writes_(nSubsets) std::pair* meshletSubsets,
+ _In_ size_t maxVerts = MESHLET_DEFAULT_MAX_VERTS, _In_ size_t maxPrims = MESHLET_DEFAULT_MAX_PRIMS);
+ HRESULT __cdecl ComputeMeshlets(
+ _In_reads_(nFaces * 3) const uint32_t* indices, _In_ size_t nFaces,
+ _In_reads_(nVerts) const XMFLOAT3* positions, _In_ size_t nVerts,
+ _In_reads_(nSubsets) const std::pair* subsets, _In_ size_t nSubsets,
+ _In_reads_opt_(nFaces * 3) const uint32_t* adjacency,
+ _Inout_ std::vector& meshlets,
+ _Inout_ std::vector& uniqueVertexIB,
+ _Inout_ std::vector& primitiveIndices,
+ _Out_writes_(nSubsets) std::pair* meshletSubsets,
+ _In_ size_t maxVerts = MESHLET_DEFAULT_MAX_VERTS, _In_ size_t maxPrims = MESHLET_DEFAULT_MAX_PRIMS);
+ // Generates meshlets for a mesh with several face subsets
+
+ HRESULT __cdecl ComputeCullData(
+ _In_reads_(nVerts) const XMFLOAT3* positions, _In_ size_t nVerts,
+ _In_reads_(nMeshlets) const Meshlet* meshlets, _In_ size_t nMeshlets,
+ _In_reads_(nVertIndices) const uint16_t* uniqueVertexIndices, _In_ size_t nVertIndices,
+ _In_reads_(nPrimIndices) const MeshletTriangle* primitiveIndices, _In_ size_t nPrimIndices,
+ _Out_writes_(nMeshlets) CullData* cullData,
+ _In_ MESHLET_FLAGS flags = MESHLET_DEFAULT) noexcept;
+ HRESULT __cdecl ComputeCullData(
+ _In_reads_(nVerts) const XMFLOAT3* positions, _In_ size_t nVerts,
+ _In_reads_(nMeshlets) const Meshlet* meshlets, _In_ size_t nMeshlets,
+ _In_reads_(nVertIndices) const uint32_t* uniqueVertexIndices, _In_ size_t nVertIndices,
+ _In_reads_(nPrimIndices) const MeshletTriangle* primitiveIndices, _In_ size_t nPrimIndices,
+ _Out_writes_(nMeshlets) CullData* cullData,
+ _In_ MESHLET_FLAGS flags = MESHLET_DEFAULT) noexcept;
+ // Computes culling data for each input meshlet
+
+ //---------------------------------------------------------------------------------
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-dynamic-exception-spec"
+#endif
+
#include "DirectXMesh.inl"
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
} // namespace
diff --git a/Source/ThirdParty/DirectXMesh/DirectXMesh.inl b/Source/ThirdParty/DirectXMesh/DirectXMesh.inl
index bed0f4ae6..7f9cbb37e 100644
--- a/Source/ThirdParty/DirectXMesh/DirectXMesh.inl
+++ b/Source/ThirdParty/DirectXMesh/DirectXMesh.inl
@@ -1,9 +1,9 @@
//-------------------------------------------------------------------------------------
// DirectXMesh.inl
-//
+//
// DirectX Mesh Geometry Library
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/?LinkID=324981
@@ -11,17 +11,25 @@
#pragma once
+//=====================================================================================
+// Bitmask flags enumerator operators
+//=====================================================================================
+DEFINE_ENUM_FLAG_OPERATORS(CNORM_FLAGS);
+DEFINE_ENUM_FLAG_OPERATORS(VALIDATE_FLAGS);
+DEFINE_ENUM_FLAG_OPERATORS(MESHLET_FLAGS);
+
+
//=====================================================================================
// DXGI Format Utilities
//=====================================================================================
_Use_decl_annotations_
-inline bool __cdecl IsValidVB(DXGI_FORMAT fmt)
+inline bool __cdecl IsValidVB(DXGI_FORMAT fmt) noexcept
{
return BytesPerElement(fmt) != 0;
}
_Use_decl_annotations_
-inline bool __cdecl IsValidIB(DXGI_FORMAT fmt)
+constexpr bool __cdecl IsValidIB(DXGI_FORMAT fmt) noexcept
{
return (fmt == DXGI_FORMAT_R32_UINT || fmt == DXGI_FORMAT_R16_UINT) != 0;
}
diff --git a/Source/ThirdParty/DirectXMesh/LICENSE b/Source/ThirdParty/DirectXMesh/LICENSE
index e8e78a94f..9e841e7a2 100644
--- a/Source/ThirdParty/DirectXMesh/LICENSE
+++ b/Source/ThirdParty/DirectXMesh/LICENSE
@@ -1,21 +1,21 @@
- The MIT License (MIT)
+ MIT License
-Copyright (c) 2014-2019 Microsoft Corp
+ Copyright (c) Microsoft Corporation.
-Permission is hereby granted, free of charge, to any person obtaining a copy of this
-software and associated documentation files (the "Software"), to deal in the Software
-without restriction, including without limitation the rights to use, copy, modify,
-merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to the following
-conditions:
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
-The above copyright notice and this permission notice shall be included in all copies
-or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/Source/ThirdParty/NvCloth/ps/PsMathUtils.h b/Source/ThirdParty/NvCloth/ps/PsMathUtils.h
index b2c4602c0..123114598 100644
--- a/Source/ThirdParty/NvCloth/ps/PsMathUtils.h
+++ b/Source/ThirdParty/NvCloth/ps/PsMathUtils.h
@@ -313,7 +313,7 @@ PX_FORCE_INLINE physx::PxI32 rand(const physx::PxI32 a, const physx::PxI32 b)
*/
PX_FORCE_INLINE physx::PxF32 rand(const physx::PxF32 a, const physx::PxF32 b)
{
- return a + (b - a) * ::rand() / RAND_MAX;
+ return a + (b - a) * ::rand() / (physx::PxF32)RAND_MAX;
}
//! \brief return angle between two vectors in radians
diff --git a/Source/ThirdParty/NvCloth/ps/windows/PsWindowsIntrinsics.h b/Source/ThirdParty/NvCloth/ps/windows/PsWindowsIntrinsics.h
index 5eaaac40f..f32b3802d 100644
--- a/Source/ThirdParty/NvCloth/ps/windows/PsWindowsIntrinsics.h
+++ b/Source/ThirdParty/NvCloth/ps/windows/PsWindowsIntrinsics.h
@@ -118,7 +118,7 @@ PX_FORCE_INLINE uint32_t PxCountLeadingZeros(uint32_t v)
/*!
Prefetch aligned cache size around \c ptr+offset.
*/
-#if !PX_ARM
+#if !PX_ARM && !PX_A64
PX_FORCE_INLINE void PxPrefetchLine(const void* ptr, uint32_t offset = 0)
{
// cache line on X86/X64 is 64-bytes so a 128-byte prefetch would require 2 prefetches.
diff --git a/Source/ThirdParty/PhysX/PxPhysics.h b/Source/ThirdParty/PhysX/PxPhysics.h
index 6446856ec..21fe137f1 100644
--- a/Source/ThirdParty/PhysX/PxPhysics.h
+++ b/Source/ThirdParty/PhysX/PxPhysics.h
@@ -22,7 +22,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Copyright (c) 2008-2024 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
diff --git a/Source/ThirdParty/PhysX/PxPhysicsAPI.h b/Source/ThirdParty/PhysX/PxPhysicsAPI.h
index 343a0099e..d66780805 100644
--- a/Source/ThirdParty/PhysX/PxPhysicsAPI.h
+++ b/Source/ThirdParty/PhysX/PxPhysicsAPI.h
@@ -22,7 +22,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Copyright (c) 2008-2024 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
diff --git a/Source/ThirdParty/PhysX/PxPhysicsSerialization.h b/Source/ThirdParty/PhysX/PxPhysicsSerialization.h
index 82a95f0be..e9383ab51 100644
--- a/Source/ThirdParty/PhysX/PxPhysicsSerialization.h
+++ b/Source/ThirdParty/PhysX/PxPhysicsSerialization.h
@@ -22,7 +22,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Copyright (c) 2008-2024 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
diff --git a/Source/ThirdParty/PhysX/PxSimulationStatistics.h b/Source/ThirdParty/PhysX/PxSimulationStatistics.h
index baac037b2..2102ecd90 100644
--- a/Source/ThirdParty/PhysX/PxSimulationStatistics.h
+++ b/Source/ThirdParty/PhysX/PxSimulationStatistics.h
@@ -22,7 +22,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// Copyright (c) 2008-2024 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
diff --git a/Source/ThirdParty/PhysX/extensions/PxParticleExt.h b/Source/ThirdParty/PhysX/extensions/PxParticleExt.h
index 4ad9c5e80..d78eae2a5 100644
--- a/Source/ThirdParty/PhysX/extensions/PxParticleExt.h
+++ b/Source/ThirdParty/PhysX/extensions/PxParticleExt.h
@@ -275,7 +275,9 @@ class PxParticleAttachmentBuffer : public PxUserAllocated
PxU32 mNumDeviceAttachments;
PxU32 mNumDeviceFilters;
+#if PX_SUPPORT_GPU_PHYSX
PxCudaContextManager* mCudaContextManager;
+#endif
PxParticleSystem& mParticleSystem;
diff --git a/Source/ThirdParty/PhysX/foundation/PxAoS.h b/Source/ThirdParty/PhysX/foundation/PxAoS.h
index bb5e74807..03584e7a0 100644
--- a/Source/ThirdParty/PhysX/foundation/PxAoS.h
+++ b/Source/ThirdParty/PhysX/foundation/PxAoS.h
@@ -33,6 +33,8 @@
#if PX_WINDOWS && !PX_NEON
#include "windows/PxWindowsAoS.h"
+#elif PX_WINDOWS_FAMILY && PX_NEON
+#include "windows/neon/PxWindowsNeonAoS.h"
#elif(PX_UNIX_FAMILY || PX_PS4 || PX_PS5 || PX_SWITCH)
#include "unix/PxUnixAoS.h"
#else
diff --git a/Source/ThirdParty/PhysX/foundation/PxInlineAoS.h b/Source/ThirdParty/PhysX/foundation/PxInlineAoS.h
index f59cc5972..e415e11e3 100644
--- a/Source/ThirdParty/PhysX/foundation/PxInlineAoS.h
+++ b/Source/ThirdParty/PhysX/foundation/PxInlineAoS.h
@@ -31,9 +31,13 @@
#include "foundation/PxPreprocessor.h"
-#if PX_WINDOWS
+#if PX_WINDOWS_FAMILY
#include "windows/PxWindowsTrigConstants.h"
+#if PX_NEON
+#include "windows/neon/PxWindowsNeonInlineAoS.h"
+#else
#include "windows/PxWindowsInlineAoS.h"
+#endif
#elif (PX_UNIX_FAMILY || PX_PS4 || PX_PS5 || PX_SWITCH)
#include "unix/PxUnixTrigConstants.h"
#include "unix/PxUnixInlineAoS.h"
diff --git a/Source/ThirdParty/PhysX/foundation/PxPreprocessor.h b/Source/ThirdParty/PhysX/foundation/PxPreprocessor.h
index 5dc1217d8..2b23aa222 100644
--- a/Source/ThirdParty/PhysX/foundation/PxPreprocessor.h
+++ b/Source/ThirdParty/PhysX/foundation/PxPreprocessor.h
@@ -143,7 +143,7 @@ SIMD defines
#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64) || (defined (__EMSCRIPTEN__) && defined(__SSE2__))
#define PX_SSE2 1
#endif
- #if defined(_M_ARM) || defined(__ARM_NEON__) || defined(__ARM_NEON)
+ #if defined(_M_ARM) || defined(__ARM_NEON__) || defined(__ARM_NEON) || defined(_M_ARM64)
#define PX_NEON 1
#endif
#if defined(_M_PPC) || defined(__CELLOS_LV2__)
diff --git a/Source/ThirdParty/PhysX/foundation/PxVecMath.h b/Source/ThirdParty/PhysX/foundation/PxVecMath.h
index 729729e6b..3e5ed3ced 100644
--- a/Source/ThirdParty/PhysX/foundation/PxVecMath.h
+++ b/Source/ThirdParty/PhysX/foundation/PxVecMath.h
@@ -57,6 +57,8 @@
#define COMPILE_VECTOR_INTRINSICS 1
#elif PX_SWITCH
#define COMPILE_VECTOR_INTRINSICS 1
+#elif PX_ARM_FAMILY && PX_NEON
+ #define COMPILE_VECTOR_INTRINSICS 1
#else
#define COMPILE_VECTOR_INTRINSICS 0
#endif
diff --git a/Source/ThirdParty/PhysX/foundation/unix/PxUnixIntrinsics.h b/Source/ThirdParty/PhysX/foundation/unix/PxUnixIntrinsics.h
index cb529be5c..02104221a 100644
--- a/Source/ThirdParty/PhysX/foundation/unix/PxUnixIntrinsics.h
+++ b/Source/ThirdParty/PhysX/foundation/unix/PxUnixIntrinsics.h
@@ -58,6 +58,7 @@ Return the index of the highest set bit. Undefined for zero arg.
*/
PX_INLINE uint32_t PxHighestSetBitUnsafe(uint32_t v)
{
+
return uint32_t(31 - __builtin_clz(v));
}
diff --git a/Source/ThirdParty/PhysX/foundation/windows/neon/PxWindowsNeonAoS.h b/Source/ThirdParty/PhysX/foundation/windows/neon/PxWindowsNeonAoS.h
new file mode 100644
index 000000000..d4f2c856a
--- /dev/null
+++ b/Source/ThirdParty/PhysX/foundation/windows/neon/PxWindowsNeonAoS.h
@@ -0,0 +1,136 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PXFOUNDATION_PXWINDOWSNEONAOS_H
+#define PXFOUNDATION_PXWINDOWSNEONAOS_H
+
+// no includes here! this file should be included from PxcVecMath.h only!!!
+
+#if !COMPILE_VECTOR_INTRINSICS
+#error Vector intrinsics should not be included when using scalar implementation.
+#endif
+
+// only ARM NEON compatible platforms should reach this
+#include
+
+namespace physx
+{
+namespace aos
+{
+
+typedef float32x2_t FloatV;
+typedef float32x4_t Vec3V;
+typedef float32x4_t Vec4V;
+typedef uint32x4_t BoolV;
+typedef float32x4_t QuatV;
+
+typedef uint32x4_t VecU32V;
+typedef int32x4_t VecI32V;
+typedef uint16x8_t VecU16V;
+typedef int16x8_t VecI16V;
+typedef uint8x16_t VecU8V;
+
+#define FloatVArg FloatV &
+#define Vec3VArg Vec3V &
+#define Vec4VArg Vec4V &
+#define BoolVArg BoolV &
+#define VecU32VArg VecU32V &
+#define VecI32VArg VecI32V &
+#define VecU16VArg VecU16V &
+#define VecI16VArg VecI16V &
+#define VecU8VArg VecU8V &
+#define QuatVArg QuatV &
+
+// KS - TODO - make an actual VecCrossV type for NEON
+#define VecCrossV Vec3V
+
+typedef VecI32V VecShiftV;
+#define VecShiftVArg VecShiftV &
+
+PX_ALIGN_PREFIX(16)
+struct Mat33V
+{
+ Mat33V()
+ {
+ }
+ Mat33V(const Vec3V& c0, const Vec3V& c1, const Vec3V& c2) : col0(c0), col1(c1), col2(c2)
+ {
+ }
+ Vec3V PX_ALIGN(16, col0);
+ Vec3V PX_ALIGN(16, col1);
+ Vec3V PX_ALIGN(16, col2);
+} PX_ALIGN_SUFFIX(16);
+
+PX_ALIGN_PREFIX(16)
+struct Mat34V
+{
+ Mat34V()
+ {
+ }
+ Mat34V(const Vec3V& c0, const Vec3V& c1, const Vec3V& c2, const Vec3V& c3) : col0(c0), col1(c1), col2(c2), col3(c3)
+ {
+ }
+ Vec3V PX_ALIGN(16, col0);
+ Vec3V PX_ALIGN(16, col1);
+ Vec3V PX_ALIGN(16, col2);
+ Vec3V PX_ALIGN(16, col3);
+} PX_ALIGN_SUFFIX(16);
+
+PX_ALIGN_PREFIX(16)
+struct Mat43V
+{
+ Mat43V()
+ {
+ }
+ Mat43V(const Vec4V& c0, const Vec4V& c1, const Vec4V& c2) : col0(c0), col1(c1), col2(c2)
+ {
+ }
+ Vec4V PX_ALIGN(16, col0);
+ Vec4V PX_ALIGN(16, col1);
+ Vec4V PX_ALIGN(16, col2);
+} PX_ALIGN_SUFFIX(16);
+
+PX_ALIGN_PREFIX(16)
+struct Mat44V
+{
+ Mat44V()
+ {
+ }
+ Mat44V(const Vec4V& c0, const Vec4V& c1, const Vec4V& c2, const Vec4V& c3) : col0(c0), col1(c1), col2(c2), col3(c3)
+ {
+ }
+ Vec4V PX_ALIGN(16, col0);
+ Vec4V PX_ALIGN(16, col1);
+ Vec4V PX_ALIGN(16, col2);
+ Vec4V PX_ALIGN(16, col3);
+} PX_ALIGN_SUFFIX(16);
+
+} // namespace aos
+} // namespace physx
+
+#endif // PXFOUNDATION_PXWINDOWSNEONAOS_H
diff --git a/Source/ThirdParty/PhysX/foundation/windows/neon/PxWindowsNeonInlineAoS.h b/Source/ThirdParty/PhysX/foundation/windows/neon/PxWindowsNeonInlineAoS.h
new file mode 100644
index 000000000..eafb17d9f
--- /dev/null
+++ b/Source/ThirdParty/PhysX/foundation/windows/neon/PxWindowsNeonInlineAoS.h
@@ -0,0 +1,3656 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of NVIDIA CORPORATION nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved.
+// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
+// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
+
+#ifndef PXFOUNDATION_PXWINDOWSNEONINLINEAOS_H
+#define PXFOUNDATION_PXWINDOWSNEONINLINEAOS_H
+
+#if !COMPILE_VECTOR_INTRINSICS
+#error Vector intrinsics should not be included when using scalar implementation.
+#endif
+
+namespace physx
+{
+namespace aos
+{
+
+// improved estimates
+#define VRECIPEQ recipq_newton<1>
+#define VRECIPE recip_newton<1>
+#define VRECIPSQRTEQ rsqrtq_newton<1>
+#define VRECIPSQRTE rsqrt_newton<1>
+
+// "exact"
+#define VRECIPQ recipq_newton<4>
+#if PX_SWITCH
+// StabilizationTests.AveragePoint needs more precision to succeed.
+#define VRECIP recip_newton<5>
+#else
+#define VRECIP recip_newton<4>
+#endif
+#define VRECIPSQRTQ rsqrtq_newton<4>
+#define VRECIPSQRT rsqrt_newton<4>
+
+#define VECMATH_AOS_EPSILON (1e-3f)
+
+//////////////////////////////////////////////////////////////////////
+//Test that Vec3V and FloatV are legal
+//////////////////////////////////
+
+#define FLOAT_COMPONENTS_EQUAL_THRESHOLD 0.01f
+PX_FORCE_INLINE bool isValidFloatV(const FloatV a)
+{
+ /*
+ PX_ALIGN(16, PxF32) data[4];
+ vst1_f32(reinterpret_cast(data), a);
+ return
+ PxU32* intData = reinterpret_cast(data);
+ return intData[0] == intData[1];
+ */
+ PX_ALIGN(16, PxF32) data[4];
+ vst1_f32(reinterpret_cast(data), a);
+ const float32_t x = data[0];
+ const float32_t y = data[1];
+
+ return (x == y);
+
+ /*if (PxAbs(x - y) < FLOAT_COMPONENTS_EQUAL_THRESHOLD)
+ {
+ return true;
+ }
+
+ if (PxAbs((x - y) / x) < FLOAT_COMPONENTS_EQUAL_THRESHOLD)
+ {
+ return true;
+ }
+
+ return false;*/
+}
+
+PX_FORCE_INLINE bool isValidVec3V(const Vec3V a)
+{
+ const float32_t w = vgetq_lane_f32(a, 3);
+ return (0.0f == w);
+ //const PxU32* intData = reinterpret_cast(&w);
+ //return *intData == 0;
+}
+
+PX_FORCE_INLINE bool isAligned16(const void* a)
+{
+ return(0 == (size_t(a) & 0x0f));
+}
+
+#if PX_DEBUG
+#define ASSERT_ISVALIDVEC3V(a) PX_ASSERT(isValidVec3V(a))
+#define ASSERT_ISVALIDFLOATV(a) PX_ASSERT(isValidFloatV(a))
+#define ASSERT_ISALIGNED16(a) PX_ASSERT(isAligned16(static_cast(a)))
+#else
+#define ASSERT_ISVALIDVEC3V(a)
+#define ASSERT_ISVALIDFLOATV(a)
+#define ASSERT_ISALIGNED16(a)
+#endif
+
+namespace internalUnitNeonSimd
+{
+PX_FORCE_INLINE PxU32 BAllTrue4_R(const BoolV a)
+{
+ const uint16x4_t dHigh = vget_high_u16(vreinterpretq_u16_u32(a));
+ const uint16x4_t dLow = vmovn_u32(a);
+ const uint16x8_t combined = vcombine_u16(dLow, dHigh);
+ const uint32x2_t finalReduce = vreinterpret_u32_u8(vmovn_u16(combined));
+ return PxU32(vget_lane_u32(finalReduce, 0) == 0xffffFFFF);
+}
+
+PX_FORCE_INLINE PxU32 BAllTrue3_R(const BoolV a)
+{
+ const uint16x4_t dHigh = vget_high_u16(vreinterpretq_u16_u32(a));
+ const uint16x4_t dLow = vmovn_u32(a);
+ const uint16x8_t combined = vcombine_u16(dLow, dHigh);
+ const uint32x2_t finalReduce = vreinterpret_u32_u8(vmovn_u16(combined));
+ return PxU32((vget_lane_u32(finalReduce, 0) & 0xffFFff) == 0xffFFff);
+}
+
+PX_FORCE_INLINE PxU32 BAnyTrue4_R(const BoolV a)
+{
+ const uint16x4_t dHigh = vget_high_u16(vreinterpretq_u16_u32(a));
+ const uint16x4_t dLow = vmovn_u32(a);
+ const uint16x8_t combined = vcombine_u16(dLow, dHigh);
+ const uint32x2_t finalReduce = vreinterpret_u32_u8(vmovn_u16(combined));
+ return PxU32(vget_lane_u32(finalReduce, 0) != 0x0);
+}
+
+PX_FORCE_INLINE PxU32 BAnyTrue3_R(const BoolV a)
+{
+ const uint16x4_t dHigh = vget_high_u16(vreinterpretq_u16_u32(a));
+ const uint16x4_t dLow = vmovn_u32(a);
+ const uint16x8_t combined = vcombine_u16(dLow, dHigh);
+ const uint32x2_t finalReduce = vreinterpret_u32_u8(vmovn_u16(combined));
+ return PxU32((vget_lane_u32(finalReduce, 0) & 0xffFFff) != 0);
+}
+}
+
+namespace vecMathTests
+{
+// PT: this function returns an invalid Vec3V (W!=0.0f) just for unit-testing 'isValidVec3V'
+PX_FORCE_INLINE Vec3V getInvalidVec3V()
+{
+ PX_ALIGN(16, PxF32) data[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
+ return V4LoadA(data);
+}
+
+PX_FORCE_INLINE bool allElementsEqualFloatV(const FloatV a, const FloatV b)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ ASSERT_ISVALIDFLOATV(b);
+ return vget_lane_u32(vceq_f32(a, b), 0) != 0;
+}
+
+PX_FORCE_INLINE bool allElementsEqualVec3V(const Vec3V a, const Vec3V b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ return V3AllEq(a, b) != 0;
+}
+
+PX_FORCE_INLINE bool allElementsEqualVec4V(const Vec4V a, const Vec4V b)
+{
+ return V4AllEq(a, b) != 0;
+}
+
+PX_FORCE_INLINE bool allElementsEqualBoolV(const BoolV a, const BoolV b)
+{
+ return internalUnitNeonSimd::BAllTrue4_R(vceqq_u32(a, b)) != 0;
+}
+
+PX_FORCE_INLINE PxU32 V4U32AllEq(const VecU32V a, const VecU32V b)
+{
+ return internalUnitNeonSimd::BAllTrue4_R(V4IsEqU32(a, b));
+}
+
+PX_FORCE_INLINE bool allElementsEqualVecU32V(const VecU32V a, const VecU32V b)
+{
+ return V4U32AllEq(a, b) != 0;
+}
+
+PX_FORCE_INLINE BoolV V4IsEqI32(const VecI32V a, const VecI32V b)
+{
+ return vceqq_s32(a, b);
+}
+
+PX_FORCE_INLINE PxU32 V4I32AllEq(const VecI32V a, const VecI32V b)
+{
+ return internalUnitNeonSimd::BAllTrue4_R(V4IsEqI32(a, b));
+}
+
+PX_FORCE_INLINE bool allElementsEqualVecI32V(const VecI32V a, const VecI32V b)
+{
+ return V4I32AllEq(a, b) != 0;
+}
+
+PX_FORCE_INLINE bool allElementsNearEqualFloatV(const FloatV a, const FloatV b)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ ASSERT_ISVALIDFLOATV(b);
+
+ const float32x2_t c = vsub_f32(a, b);
+ const float32x2_t error = vdup_n_f32(VECMATH_AOS_EPSILON);
+// absolute compare abs(error) > abs(c)
+ const uint32x2_t greater = vcagt_f32(error, c);
+ const uint32x2_t min = vpmin_u32(greater, greater);
+ return vget_lane_u32(min, 0) != 0x0;
+}
+
+PX_FORCE_INLINE bool allElementsNearEqualVec3V(const Vec3V a, const Vec3V b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ const float32x4_t c = vsubq_f32(a, b);
+ const float32x4_t error = vdupq_n_f32(VECMATH_AOS_EPSILON);
+// absolute compare abs(error) > abs(c)
+ const uint32x4_t greater = vcagtq_f32(error, c);
+ return internalUnitNeonSimd::BAllTrue3_R(greater) != 0;
+}
+
+PX_FORCE_INLINE bool allElementsNearEqualVec4V(const Vec4V a, const Vec4V b)
+{
+ const float32x4_t c = vsubq_f32(a, b);
+ const float32x4_t error = vdupq_n_f32(VECMATH_AOS_EPSILON);
+// absolute compare abs(error) > abs(c)
+ const uint32x4_t greater = vcagtq_f32(error, c);
+ return internalUnitNeonSimd::BAllTrue4_R(greater) != 0x0;
+}
+}
+
+#if 0 // debugging printfs
+#include
+PX_FORCE_INLINE void printVec(const float32x4_t& v, const char* name)
+{
+ PX_ALIGN(16, float32_t) data[4];
+ vst1q_f32(data, v);
+ printf("%s: (%f, %f, %f, %f)\n", name, data[0], data[1], data[2], data[3]);
+}
+
+PX_FORCE_INLINE void printVec(const float32x2_t& v, const char* name)
+{
+ PX_ALIGN(16, float32_t) data[2];
+ vst1_f32(data, v);
+ printf("%s: (%f, %f)\n", name, data[0], data[1]);
+}
+
+PX_FORCE_INLINE void printVec(const uint32x4_t& v, const char* name)
+{
+ PX_ALIGN(16, uint32_t) data[4];
+ vst1q_u32(data, v);
+ printf("%s: (0x%x, 0x%x, 0x%x, 0x%x)\n", name, data[0], data[1], data[2], data[3]);
+}
+
+PX_FORCE_INLINE void printVec(const uint16x8_t& v, const char* name)
+{
+ PX_ALIGN(16, uint16_t) data[8];
+ vst1q_u16(data, v);
+ printf("%s: (0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x)\n", name, data[0], data[1], data[2], data[3],
+ data[4], data[5], data[6], data[7]);
+}
+
+PX_FORCE_INLINE void printVec(const int32x4_t& v, const char* name)
+{
+ PX_ALIGN(16, int32_t) data[4];
+ vst1q_s32(data, v);
+ printf("%s: (0x%x, 0x%x, 0x%x, 0x%x)\n", name, data[0], data[1], data[2], data[3]);
+}
+
+PX_FORCE_INLINE void printVec(const int16x8_t& v, const char* name)
+{
+ PX_ALIGN(16, int16_t) data[8];
+ vst1q_s16(data, v);
+ printf("%s: (0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x)\n", name, data[0], data[1], data[2], data[3],
+ data[4], data[5], data[6], data[7]);
+}
+
+PX_FORCE_INLINE void printVec(const uint16x4_t& v, const char* name)
+{
+ PX_ALIGN(16, uint16_t) data[4];
+ vst1_u16(data, v);
+ printf("%s: (0x%x, 0x%x, 0x%x, 0x%x)\n", name, data[0], data[1], data[2], data[3]);
+}
+
+PX_FORCE_INLINE void printVec(const uint32x2_t& v, const char* name)
+{
+ PX_ALIGN(16, uint32_t) data[2];
+ vst1_u32(data, v);
+ printf("%s: (0x%x, 0x%x)\n", name, data[0], data[1]);
+}
+
+PX_FORCE_INLINE void printVar(const PxU32 v, const char* name)
+{
+ printf("%s: 0x%x\n", name, v);
+}
+
+PX_FORCE_INLINE void printVar(const PxF32 v, const char* name)
+{
+ printf("%s: %f\n", name, v);
+}
+
+#define PRINT_VAR(X) printVar((X), #X)
+#define PRINT_VEC(X) printVec((X), #X)
+#define PRINT_VEC_TITLE(TITLE, X) printVec((X), TITLE #X)
+#endif // debugging printf
+
+/////////////////////////////////////////////////////////////////////
+////FUNCTIONS USED ONLY FOR ASSERTS IN VECTORISED IMPLEMENTATIONS
+/////////////////////////////////////////////////////////////////////
+
+PX_FORCE_INLINE bool isFiniteFloatV(const FloatV a)
+{
+ PX_ALIGN(16, PxF32) data[4];
+ vst1_f32(reinterpret_cast(data), a);
+ return PxIsFinite(data[0]) && PxIsFinite(data[1]);
+}
+
+PX_FORCE_INLINE bool isFiniteVec3V(const Vec3V a)
+{
+ PX_ALIGN(16, PxF32) data[4];
+ vst1q_f32(reinterpret_cast(data), a);
+ return PxIsFinite(data[0]) && PxIsFinite(data[1]) && PxIsFinite(data[2]);
+}
+
+PX_FORCE_INLINE bool isFiniteVec4V(const Vec4V a)
+{
+ PX_ALIGN(16, PxF32) data[4];
+ vst1q_f32(reinterpret_cast(data), a);
+ return PxIsFinite(data[0]) && PxIsFinite(data[1]) && PxIsFinite(data[2]) && PxIsFinite(data[3]);
+}
+
+PX_FORCE_INLINE bool hasZeroElementinFloatV(const FloatV a)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ return vget_lane_u32(vreinterpret_u32_f32(a), 0) == 0;
+}
+
+PX_FORCE_INLINE bool hasZeroElementInVec3V(const Vec3V a)
+{
+ const uint32x2_t dLow = vget_low_u32(vreinterpretq_u32_f32(a));
+ const uint32x2_t dMin = vpmin_u32(dLow, dLow);
+
+ return vget_lane_u32(dMin, 0) == 0 || vgetq_lane_u32(vreinterpretq_u32_f32(a), 2) == 0;
+}
+
+PX_FORCE_INLINE bool hasZeroElementInVec4V(const Vec4V a)
+{
+ const uint32x2_t dHigh = vget_high_u32(vreinterpretq_u32_f32(a));
+ const uint32x2_t dLow = vget_low_u32(vreinterpretq_u32_f32(a));
+
+ const uint32x2_t dMin = vmin_u32(dHigh, dLow);
+ const uint32x2_t pairMin = vpmin_u32(dMin, dMin);
+ return vget_lane_u32(pairMin, 0) == 0;
+}
+
+/////////////////////////////////////////////////////////////////////
+////VECTORISED FUNCTION IMPLEMENTATIONS
+/////////////////////////////////////////////////////////////////////
+
+PX_FORCE_INLINE FloatV FLoad(const PxF32 f)
+{
+ return vdup_n_f32(reinterpret_cast(f));
+}
+
+PX_FORCE_INLINE FloatV FLoadA(const PxF32* const f)
+{
+ ASSERT_ISALIGNED16(f);
+ return vld1_f32(reinterpret_cast(f));
+}
+
+PX_FORCE_INLINE Vec3V V3Load(const PxF32 f)
+{
+ PX_ALIGN(16, PxF32) data[4] = { f, f, f, 0.0f };
+ return V4LoadA(data);
+}
+
+PX_FORCE_INLINE Vec4V V4Load(const PxF32 f)
+{
+ return vdupq_n_f32(reinterpret_cast(f));
+}
+
+PX_FORCE_INLINE BoolV BLoad(const bool f)
+{
+ const PxU32 i = static_cast(-(static_cast(f)));
+ return vdupq_n_u32(i);
+}
+
+PX_FORCE_INLINE Vec3V V3LoadA(const PxVec3& f)
+{
+ ASSERT_ISALIGNED16(&f);
+ PX_ALIGN(16, PxF32) data[4] = { f.x, f.y, f.z, 0.0f };
+ return V4LoadA(data);
+}
+
+PX_FORCE_INLINE Vec3V V3LoadU(const PxVec3& f)
+{
+ PX_ALIGN(16, PxF32) data[4] = { f.x, f.y, f.z, 0.0f };
+ return V4LoadA(data);
+}
+
+PX_FORCE_INLINE Vec3V V3LoadUnsafeA(const PxVec3& f)
+{
+ ASSERT_ISALIGNED16(&f);
+ PX_ALIGN(16, PxF32) data[4] = { f.x, f.y, f.z, 0.0f };
+ return V4LoadA(data);
+}
+
+PX_FORCE_INLINE Vec3V V3LoadA(const PxF32* f)
+{
+ ASSERT_ISALIGNED16(f);
+ PX_ALIGN(16, PxF32) data[4] = { f[0], f[1], f[2], 0.0f };
+ return V4LoadA(data);
+}
+
+PX_FORCE_INLINE Vec3V V3LoadU(const PxF32* f)
+{
+ PX_ALIGN(16, PxF32) data[4] = { f[0], f[1], f[2], 0.0f };
+ return V4LoadA(data);
+}
+
+PX_FORCE_INLINE Vec3V Vec3V_From_Vec4V(Vec4V v)
+{
+ return vsetq_lane_f32(0.0f, v, 3);
+}
+
+PX_FORCE_INLINE Vec3V Vec3V_From_Vec4V_WUndefined(Vec4V v)
+{
+ return v;
+}
+
+PX_FORCE_INLINE Vec4V Vec4V_From_Vec3V(Vec3V f)
+{
+ return f; // ok if it is implemented as the same type.
+}
+
+PX_FORCE_INLINE Vec4V Vec4V_From_FloatV(FloatV f)
+{
+ return vcombine_f32(f, f);
+}
+
+PX_FORCE_INLINE Vec3V Vec3V_From_FloatV(FloatV f)
+{
+ return Vec3V_From_Vec4V(Vec4V_From_FloatV(f));
+}
+
+PX_FORCE_INLINE Vec3V Vec3V_From_FloatV_WUndefined(FloatV f)
+{
+ return Vec3V_From_Vec4V_WUndefined(Vec4V_From_FloatV(f));
+}
+
+PX_FORCE_INLINE Vec4V Vec4V_From_PxVec3_WUndefined(const PxVec3& f)
+{
+ PX_ALIGN(16, PxF32) data[4] = { f.x, f.y, f.z, 0.0f };
+ return V4LoadA(data);
+}
+
+PX_FORCE_INLINE Mat33V Mat33V_From_PxMat33(const PxMat33& m)
+{
+ return Mat33V(V3LoadU(m.column0), V3LoadU(m.column1), V3LoadU(m.column2));
+}
+
+PX_FORCE_INLINE void PxMat33_From_Mat33V(const Mat33V& m, PxMat33& out)
+{
+ V3StoreU(m.col0, out.column0);
+ V3StoreU(m.col1, out.column1);
+ V3StoreU(m.col2, out.column2);
+}
+
+PX_FORCE_INLINE Vec4V V4LoadA(const PxF32* const f)
+{
+ ASSERT_ISALIGNED16(f);
+ return vld1q_f32(reinterpret_cast(f));
+}
+
+PX_FORCE_INLINE void V4StoreA(Vec4V a, PxF32* f)
+{
+ ASSERT_ISALIGNED16(f);
+ vst1q_f32(reinterpret_cast(f), a);
+}
+
+PX_FORCE_INLINE void V4StoreU(const Vec4V a, PxF32* f)
+{
+ PX_ALIGN(16, PxF32) f2[4];
+ vst1q_f32(reinterpret_cast(f2), a);
+ f[0] = f2[0];
+ f[1] = f2[1];
+ f[2] = f2[2];
+ f[3] = f2[3];
+}
+
+PX_FORCE_INLINE void BStoreA(const BoolV a, PxU32* u)
+{
+ ASSERT_ISALIGNED16(u);
+ vst1q_u32(reinterpret_cast(u), a);
+}
+
+PX_FORCE_INLINE void U4StoreA(const VecU32V uv, PxU32* u)
+{
+ ASSERT_ISALIGNED16(u);
+ vst1q_u32(reinterpret_cast(u), uv);
+}
+
+PX_FORCE_INLINE void I4StoreA(const VecI32V iv, PxI32* i)
+{
+ ASSERT_ISALIGNED16(i);
+ vst1q_s32(reinterpret_cast(i), iv);
+}
+
+PX_FORCE_INLINE Vec4V V4LoadU(const PxF32* const f)
+{
+ return vld1q_f32(reinterpret_cast(f));
+}
+
+PX_FORCE_INLINE BoolV BLoad(const bool* const f)
+{
+ const PX_ALIGN(16, PxU32) b[4] = { static_cast(-static_cast(f[0])),
+ static_cast(-static_cast(f[1])),
+ static_cast(-static_cast(f[2])),
+ static_cast(-static_cast(f[3])) };
+ return vld1q_u32(b);
+}
+
+PX_FORCE_INLINE void FStore(const FloatV a, PxF32* PX_RESTRICT f)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ // vst1q_lane_f32(f, a, 0); // causes vst1 alignment bug
+ *f = vget_lane_f32(a, 0);
+}
+
+PX_FORCE_INLINE void Store_From_BoolV(const BoolV a, PxU32* PX_RESTRICT f)
+{
+ *f = vget_lane_u32(vget_low_u32(a), 0);
+}
+
+PX_FORCE_INLINE void V3StoreA(const Vec3V a, PxVec3& f)
+{
+ ASSERT_ISALIGNED16(&f);
+ PX_ALIGN(16, PxF32) f2[4];
+ vst1q_f32(reinterpret_cast(f2), a);
+ f = PxVec3(f2[0], f2[1], f2[2]);
+}
+
+PX_FORCE_INLINE void V3StoreU(const Vec3V a, PxVec3& f)
+{
+ PX_ALIGN(16, PxF32) f2[4];
+ vst1q_f32(reinterpret_cast(f2), a);
+ f = PxVec3(f2[0], f2[1], f2[2]);
+}
+
+//////////////////////////////////
+// FLOATV
+//////////////////////////////////
+
+PX_FORCE_INLINE FloatV FZero()
+{
+ return FLoad(0.0f);
+}
+
+PX_FORCE_INLINE FloatV FOne()
+{
+ return FLoad(1.0f);
+}
+
+PX_FORCE_INLINE FloatV FHalf()
+{
+ return FLoad(0.5f);
+}
+
+PX_FORCE_INLINE FloatV FEps()
+{
+ return FLoad(PX_EPS_REAL);
+}
+
+PX_FORCE_INLINE FloatV FEps6()
+{
+ return FLoad(1e-6f);
+}
+
+PX_FORCE_INLINE FloatV FMax()
+{
+ return FLoad(PX_MAX_REAL);
+}
+
+PX_FORCE_INLINE FloatV FNegMax()
+{
+ return FLoad(-PX_MAX_REAL);
+}
+
+PX_FORCE_INLINE FloatV IZero()
+{
+ return vreinterpret_f32_u32(vdup_n_u32(0));
+}
+
+PX_FORCE_INLINE FloatV IOne()
+{
+ return vreinterpret_f32_u32(vdup_n_u32(1));
+}
+
+PX_FORCE_INLINE FloatV ITwo()
+{
+ return vreinterpret_f32_u32(vdup_n_u32(2));
+}
+
+PX_FORCE_INLINE FloatV IThree()
+{
+ return vreinterpret_f32_u32(vdup_n_u32(3));
+}
+
+PX_FORCE_INLINE FloatV IFour()
+{
+ return vreinterpret_f32_u32(vdup_n_u32(4));
+}
+
+PX_FORCE_INLINE FloatV FNeg(const FloatV f)
+{
+ ASSERT_ISVALIDFLOATV(f);
+ return vneg_f32(f);
+}
+
+PX_FORCE_INLINE FloatV FAdd(const FloatV a, const FloatV b)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ ASSERT_ISVALIDFLOATV(b);
+ return vadd_f32(a, b);
+}
+
+PX_FORCE_INLINE FloatV FSub(const FloatV a, const FloatV b)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ ASSERT_ISVALIDFLOATV(b);
+ return vsub_f32(a, b);
+}
+
+PX_FORCE_INLINE FloatV FMul(const FloatV a, const FloatV b)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ ASSERT_ISVALIDFLOATV(b);
+ return vmul_f32(a, b);
+}
+
+template
+PX_FORCE_INLINE float32x2_t recip_newton(const float32x2_t& in)
+{
+ float32x2_t recip = vrecpe_f32(in);
+ for(int i = 0; i < n; ++i)
+ recip = vmul_f32(recip, vrecps_f32(in, recip));
+ return recip;
+}
+
+template
+PX_FORCE_INLINE float32x4_t recipq_newton(const float32x4_t& in)
+{
+ float32x4_t recip = vrecpeq_f32(in);
+ for(int i = 0; i < n; ++i)
+ recip = vmulq_f32(recip, vrecpsq_f32(recip, in));
+ return recip;
+}
+
+template
+PX_FORCE_INLINE float32x2_t rsqrt_newton(const float32x2_t& in)
+{
+ float32x2_t rsqrt = vrsqrte_f32(in);
+ for(int i = 0; i < n; ++i)
+ rsqrt = vmul_f32(rsqrt, vrsqrts_f32(vmul_f32(rsqrt, rsqrt), in));
+ return rsqrt;
+}
+
+template
+PX_FORCE_INLINE float32x4_t rsqrtq_newton(const float32x4_t& in)
+{
+ float32x4_t rsqrt = vrsqrteq_f32(in);
+ for(int i = 0; i < n; ++i)
+ rsqrt = vmulq_f32(rsqrt, vrsqrtsq_f32(vmulq_f32(rsqrt, rsqrt), in));
+ return rsqrt;
+}
+
+PX_FORCE_INLINE FloatV FDiv(const FloatV a, const FloatV b)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ ASSERT_ISVALIDFLOATV(b);
+ return vmul_f32(a, VRECIP(b));
+}
+
+PX_FORCE_INLINE FloatV FDivFast(const FloatV a, const FloatV b)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ ASSERT_ISVALIDFLOATV(b);
+ return vmul_f32(a, VRECIPE(b));
+}
+
+PX_FORCE_INLINE FloatV FRecip(const FloatV a)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ return VRECIP(a);
+}
+
+PX_FORCE_INLINE FloatV FRecipFast(const FloatV a)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ return VRECIPE(a);
+}
+
+PX_FORCE_INLINE FloatV FRsqrt(const FloatV a)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ return VRECIPSQRT(a);
+}
+
+PX_FORCE_INLINE FloatV FSqrt(const FloatV a)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ return FSel(FIsEq(a, FZero()), a, vmul_f32(a, VRECIPSQRT(a)));
+}
+
+PX_FORCE_INLINE FloatV FRsqrtFast(const FloatV a)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ return VRECIPSQRTE(a);
+}
+
+PX_FORCE_INLINE FloatV FScaleAdd(const FloatV a, const FloatV b, const FloatV c)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ ASSERT_ISVALIDFLOATV(b);
+ ASSERT_ISVALIDFLOATV(c);
+ return vmla_f32(c, a, b);
+}
+
+PX_FORCE_INLINE FloatV FNegScaleSub(const FloatV a, const FloatV b, const FloatV c)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ ASSERT_ISVALIDFLOATV(b);
+ ASSERT_ISVALIDFLOATV(c);
+ return vmls_f32(c, a, b);
+}
+
+PX_FORCE_INLINE FloatV FAbs(const FloatV a)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ return vabs_f32(a);
+}
+
+PX_FORCE_INLINE FloatV FSel(const BoolV c, const FloatV a, const FloatV b)
+{
+ PX_ASSERT( vecMathTests::allElementsEqualBoolV(c, BTTTT()) ||
+ vecMathTests::allElementsEqualBoolV(c, BFFFF()));
+ ASSERT_ISVALIDFLOATV(vbsl_f32(vget_low_u32(c), a, b));
+ return vbsl_f32(vget_low_u32(c), a, b);
+}
+
+PX_FORCE_INLINE BoolV FIsGrtr(const FloatV a, const FloatV b)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ ASSERT_ISVALIDFLOATV(b);
+ return vdupq_lane_u32(vcgt_f32(a, b), 0);
+}
+
+PX_FORCE_INLINE BoolV FIsGrtrOrEq(const FloatV a, const FloatV b)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ ASSERT_ISVALIDFLOATV(b);
+ return vdupq_lane_u32(vcge_f32(a, b), 0);
+}
+
+PX_FORCE_INLINE BoolV FIsEq(const FloatV a, const FloatV b)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ ASSERT_ISVALIDFLOATV(b);
+ return vdupq_lane_u32(vceq_f32(a, b), 0);
+}
+
+PX_FORCE_INLINE FloatV FMax(const FloatV a, const FloatV b)
+{
+ //ASSERT_ISVALIDFLOATV(a);
+ //ASSERT_ISVALIDFLOATV(b);
+ return vmax_f32(a, b);
+}
+
+PX_FORCE_INLINE FloatV FMin(const FloatV a, const FloatV b)
+{
+ //ASSERT_ISVALIDFLOATV(a);
+ //ASSERT_ISVALIDFLOATV(b);
+ return vmin_f32(a, b);
+}
+
+PX_FORCE_INLINE FloatV FClamp(const FloatV a, const FloatV minV, const FloatV maxV)
+{
+ ASSERT_ISVALIDFLOATV(minV);
+ ASSERT_ISVALIDFLOATV(maxV);
+ return vmax_f32(vmin_f32(a, maxV), minV);
+}
+
+PX_FORCE_INLINE PxU32 FAllGrtr(const FloatV a, const FloatV b)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ ASSERT_ISVALIDFLOATV(b);
+ return vget_lane_u32(vcgt_f32(a, b), 0);
+}
+
+PX_FORCE_INLINE PxU32 FAllGrtrOrEq(const FloatV a, const FloatV b)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ ASSERT_ISVALIDFLOATV(b);
+ return vget_lane_u32(vcge_f32(a, b), 0);
+}
+
+PX_FORCE_INLINE PxU32 FAllEq(const FloatV a, const FloatV b)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ ASSERT_ISVALIDFLOATV(b);
+ return vget_lane_u32(vceq_f32(a, b), 0);
+}
+
+PX_FORCE_INLINE FloatV FRound(const FloatV a)
+{
+ ASSERT_ISVALIDFLOATV(a);
+
+ // truncate(a + (0.5f - sign(a)))
+ const float32x2_t half = vdup_n_f32(0.5f);
+ const float32x2_t sign = vcvt_f32_u32((vshr_n_u32(vreinterpret_u32_f32(a), 31)));
+ const float32x2_t aPlusHalf = vadd_f32(a, half);
+ const float32x2_t aRound = vsub_f32(aPlusHalf, sign);
+ int32x2_t tmp = vcvt_s32_f32(aRound);
+ return vcvt_f32_s32(tmp);
+}
+
+PX_FORCE_INLINE FloatV FSin(const FloatV a)
+{
+ ASSERT_ISVALIDFLOATV(a);
+
+ // Modulo the range of the given angles such that -XM_2PI <= Angles < XM_2PI
+ const FloatV recipTwoPi = FLoadA(g_PXReciprocalTwoPi.f);
+ const FloatV twoPi = FLoadA(g_PXTwoPi.f);
+ const FloatV tmp = FMul(a, recipTwoPi);
+ const FloatV b = FRound(tmp);
+ const FloatV V1 = FNegScaleSub(twoPi, b, a);
+
+ // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! -
+ // V^15 / 15! + V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI)
+ const FloatV V2 = FMul(V1, V1);
+ const FloatV V3 = FMul(V2, V1);
+ const FloatV V5 = FMul(V3, V2);
+ const FloatV V7 = FMul(V5, V2);
+ const FloatV V9 = FMul(V7, V2);
+ const FloatV V11 = FMul(V9, V2);
+ const FloatV V13 = FMul(V11, V2);
+ const FloatV V15 = FMul(V13, V2);
+ const FloatV V17 = FMul(V15, V2);
+ const FloatV V19 = FMul(V17, V2);
+ const FloatV V21 = FMul(V19, V2);
+ const FloatV V23 = FMul(V21, V2);
+
+ const Vec4V sinCoefficients0 = V4LoadA(g_PXSinCoefficients0.f);
+ const Vec4V sinCoefficients1 = V4LoadA(g_PXSinCoefficients1.f);
+ const Vec4V sinCoefficients2 = V4LoadA(g_PXSinCoefficients2.f);
+
+ const FloatV S1 = V4GetY(sinCoefficients0);
+ const FloatV S2 = V4GetZ(sinCoefficients0);
+ const FloatV S3 = V4GetW(sinCoefficients0);
+ const FloatV S4 = V4GetX(sinCoefficients1);
+ const FloatV S5 = V4GetY(sinCoefficients1);
+ const FloatV S6 = V4GetZ(sinCoefficients1);
+ const FloatV S7 = V4GetW(sinCoefficients1);
+ const FloatV S8 = V4GetX(sinCoefficients2);
+ const FloatV S9 = V4GetY(sinCoefficients2);
+ const FloatV S10 = V4GetZ(sinCoefficients2);
+ const FloatV S11 = V4GetW(sinCoefficients2);
+
+ FloatV Result;
+ Result = FScaleAdd(S1, V3, V1);
+ Result = FScaleAdd(S2, V5, Result);
+ Result = FScaleAdd(S3, V7, Result);
+ Result = FScaleAdd(S4, V9, Result);
+ Result = FScaleAdd(S5, V11, Result);
+ Result = FScaleAdd(S6, V13, Result);
+ Result = FScaleAdd(S7, V15, Result);
+ Result = FScaleAdd(S8, V17, Result);
+ Result = FScaleAdd(S9, V19, Result);
+ Result = FScaleAdd(S10, V21, Result);
+ Result = FScaleAdd(S11, V23, Result);
+
+ return Result;
+}
+
+PX_FORCE_INLINE FloatV FCos(const FloatV a)
+{
+ ASSERT_ISVALIDFLOATV(a);
+
+ // Modulo the range of the given angles such that -XM_2PI <= Angles < XM_2PI
+ const FloatV recipTwoPi = FLoadA(g_PXReciprocalTwoPi.f);
+ const FloatV twoPi = FLoadA(g_PXTwoPi.f);
+ const FloatV tmp = FMul(a, recipTwoPi);
+ const FloatV b = FRound(tmp);
+ const FloatV V1 = FNegScaleSub(twoPi, b, a);
+
+ // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + V^12 / 12! -
+ // V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI)
+ const FloatV V2 = FMul(V1, V1);
+ const FloatV V4 = FMul(V2, V2);
+ const FloatV V6 = FMul(V4, V2);
+ const FloatV V8 = FMul(V4, V4);
+ const FloatV V10 = FMul(V6, V4);
+ const FloatV V12 = FMul(V6, V6);
+ const FloatV V14 = FMul(V8, V6);
+ const FloatV V16 = FMul(V8, V8);
+ const FloatV V18 = FMul(V10, V8);
+ const FloatV V20 = FMul(V10, V10);
+ const FloatV V22 = FMul(V12, V10);
+
+ const Vec4V cosCoefficients0 = V4LoadA(g_PXCosCoefficients0.f);
+ const Vec4V cosCoefficients1 = V4LoadA(g_PXCosCoefficients1.f);
+ const Vec4V cosCoefficients2 = V4LoadA(g_PXCosCoefficients2.f);
+
+ const FloatV C1 = V4GetY(cosCoefficients0);
+ const FloatV C2 = V4GetZ(cosCoefficients0);
+ const FloatV C3 = V4GetW(cosCoefficients0);
+ const FloatV C4 = V4GetX(cosCoefficients1);
+ const FloatV C5 = V4GetY(cosCoefficients1);
+ const FloatV C6 = V4GetZ(cosCoefficients1);
+ const FloatV C7 = V4GetW(cosCoefficients1);
+ const FloatV C8 = V4GetX(cosCoefficients2);
+ const FloatV C9 = V4GetY(cosCoefficients2);
+ const FloatV C10 = V4GetZ(cosCoefficients2);
+ const FloatV C11 = V4GetW(cosCoefficients2);
+
+ FloatV Result;
+ Result = FScaleAdd(C1, V2, FOne());
+ Result = FScaleAdd(C2, V4, Result);
+ Result = FScaleAdd(C3, V6, Result);
+ Result = FScaleAdd(C4, V8, Result);
+ Result = FScaleAdd(C5, V10, Result);
+ Result = FScaleAdd(C6, V12, Result);
+ Result = FScaleAdd(C7, V14, Result);
+ Result = FScaleAdd(C8, V16, Result);
+ Result = FScaleAdd(C9, V18, Result);
+ Result = FScaleAdd(C10, V20, Result);
+ Result = FScaleAdd(C11, V22, Result);
+
+ return Result;
+}
+
+PX_FORCE_INLINE PxU32 FOutOfBounds(const FloatV a, const FloatV min, const FloatV max)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ ASSERT_ISVALIDFLOATV(min);
+ ASSERT_ISVALIDFLOATV(max);
+
+ const BoolV c = BOr(FIsGrtr(a, max), FIsGrtr(min, a));
+ return PxU32(!BAllEqFFFF(c));
+}
+
+PX_FORCE_INLINE PxU32 FInBounds(const FloatV a, const FloatV min, const FloatV max)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ ASSERT_ISVALIDFLOATV(min);
+ ASSERT_ISVALIDFLOATV(max);
+
+ const BoolV c = BAnd(FIsGrtrOrEq(a, min), FIsGrtrOrEq(max, a));
+ return PxU32(BAllEqTTTT(c));
+}
+
+PX_FORCE_INLINE PxU32 FOutOfBounds(const FloatV a, const FloatV bounds)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ ASSERT_ISVALIDFLOATV(bounds);
+ const uint32x2_t greater = vcagt_f32(a, bounds);
+ return vget_lane_u32(greater, 0);
+}
+
+PX_FORCE_INLINE PxU32 FInBounds(const FloatV a, const FloatV bounds)
+{
+ ASSERT_ISVALIDFLOATV(a);
+ ASSERT_ISVALIDFLOATV(bounds);
+ const uint32x2_t geq = vcage_f32(bounds, a);
+ return vget_lane_u32(geq, 0);
+}
+
+//////////////////////////////////
+// VEC3V
+//////////////////////////////////
+
+PX_FORCE_INLINE Vec3V V3Splat(const FloatV f)
+{
+ ASSERT_ISVALIDFLOATV(f);
+
+ const uint32_t ui32[2] = { 0xffffFFFF, 0x0 };
+ const uint32x2_t mask = vld1_u32(ui32);
+ const uint32x2_t uHigh = vreinterpret_u32_f32(f);
+ const float32x2_t dHigh = vreinterpret_f32_u32(vand_u32(uHigh, mask));
+
+ return vcombine_f32(f, dHigh);
+}
+
+PX_FORCE_INLINE Vec3V V3Merge(const FloatVArg x, const FloatVArg y, const FloatVArg z)
+{
+ ASSERT_ISVALIDFLOATV(x);
+ ASSERT_ISVALIDFLOATV(y);
+ ASSERT_ISVALIDFLOATV(z);
+
+ const uint32_t ui32[2] = { 0xffffFFFF, 0x0 };
+ const uint32x2_t mask = vld1_u32(ui32);
+ const uint32x2_t dHigh = vand_u32(vreinterpret_u32_f32(z), mask);
+ const uint32x2_t dLow = vext_u32(vreinterpret_u32_f32(x), vreinterpret_u32_f32(y), 1);
+ return vreinterpretq_f32_u32(vcombine_u32(dLow, dHigh));
+}
+
+PX_FORCE_INLINE Vec3V V3UnitX()
+{
+ const float f4[4] = { 1.0f, 0.0f, 0.0f, 0.0f };
+ const float32x4_t x = vld1q_f32(f4);
+ return x;
+}
+
+PX_FORCE_INLINE Vec3V V3UnitY()
+{
+ const float f4[4] = { 0, 1.0f, 0, 0 };
+ const float32x4_t y = vld1q_f32(f4);
+ return y;
+}
+
+PX_FORCE_INLINE Vec3V V3UnitZ()
+{
+ const float f4[4] = { 0, 0, 1.0f, 0 };
+ const float32x4_t z = vld1q_f32(f4);
+ return z;
+}
+
+PX_FORCE_INLINE FloatV V3GetX(const Vec3V f)
+{
+ ASSERT_ISVALIDVEC3V(f);
+ const float32x2_t fLow = vget_low_f32(f);
+ return vdup_lane_f32(fLow, 0);
+}
+
+PX_FORCE_INLINE FloatV V3GetY(const Vec3V f)
+{
+ ASSERT_ISVALIDVEC3V(f);
+ const float32x2_t fLow = vget_low_f32(f);
+ return vdup_lane_f32(fLow, 1);
+}
+
+PX_FORCE_INLINE FloatV V3GetZ(const Vec3V f)
+{
+ ASSERT_ISVALIDVEC3V(f);
+ const float32x2_t fhigh = vget_high_f32(f);
+ return vdup_lane_f32(fhigh, 0);
+}
+
+PX_FORCE_INLINE Vec3V V3SetX(const Vec3V v, const FloatV f)
+{
+ ASSERT_ISVALIDVEC3V(v);
+ ASSERT_ISVALIDFLOATV(f);
+ return V4Sel(BFTTT(), v, vcombine_f32(f, f));
+}
+
+PX_FORCE_INLINE Vec3V V3SetY(const Vec3V v, const FloatV f)
+{
+ ASSERT_ISVALIDVEC3V(v);
+ ASSERT_ISVALIDFLOATV(f);
+ return V4Sel(BTFTT(), v, vcombine_f32(f, f));
+}
+
+PX_FORCE_INLINE Vec3V V3SetZ(const Vec3V v, const FloatV f)
+{
+ ASSERT_ISVALIDVEC3V(v);
+ ASSERT_ISVALIDFLOATV(f);
+ return V4Sel(BTTFT(), v, vcombine_f32(f, f));
+}
+
+PX_FORCE_INLINE Vec3V V3ColX(const Vec3V a, const Vec3V b, const Vec3V c)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ ASSERT_ISVALIDVEC3V(c);
+
+ const float32x2_t aLow = vget_low_f32(a);
+ const float32x2_t bLow = vget_low_f32(b);
+ const float32x2_t cLow = vget_low_f32(c);
+ const float32x2_t zero = vdup_n_f32(0.0f);
+
+ const float32x2x2_t zipL = vzip_f32(aLow, bLow);
+ const float32x2x2_t zipH = vzip_f32(cLow, zero);
+
+ return vcombine_f32(zipL.val[0], zipH.val[0]);
+}
+
+PX_FORCE_INLINE Vec3V V3ColY(const Vec3V a, const Vec3V b, const Vec3V c)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ ASSERT_ISVALIDVEC3V(c);
+
+ const float32x2_t aLow = vget_low_f32(a);
+ const float32x2_t bLow = vget_low_f32(b);
+ const float32x2_t cLow = vget_low_f32(c);
+ const float32x2_t zero = vdup_n_f32(0.0f);
+
+ const float32x2x2_t zipL = vzip_f32(aLow, bLow);
+ const float32x2x2_t zipH = vzip_f32(cLow, zero);
+
+ return vcombine_f32(zipL.val[1], zipH.val[1]);
+}
+
+PX_FORCE_INLINE Vec3V V3ColZ(const Vec3V a, const Vec3V b, const Vec3V c)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ ASSERT_ISVALIDVEC3V(c);
+
+ const float32x2_t aHi = vget_high_f32(a);
+ const float32x2_t bHi = vget_high_f32(b);
+ const float32x2_t cHi = vget_high_f32(c);
+
+ const float32x2x2_t zipL = vzip_f32(aHi, bHi);
+
+ return vcombine_f32(zipL.val[0], cHi);
+}
+
+PX_FORCE_INLINE Vec3V V3Zero()
+{
+ return vdupq_n_f32(0.0f);
+}
+
+PX_FORCE_INLINE Vec3V V3Eps()
+{
+ return V3Load(PX_EPS_REAL);
+}
+
+PX_FORCE_INLINE Vec3V V3One()
+{
+ return V3Load(1.0f);
+}
+
+PX_FORCE_INLINE Vec3V V3Neg(const Vec3V f)
+{
+ ASSERT_ISVALIDVEC3V(f);
+ const float32x4_t tmp = vnegq_f32(f);
+ return vsetq_lane_f32(0.0f, tmp, 3);
+}
+
+PX_FORCE_INLINE Vec3V V3Add(const Vec3V a, const Vec3V b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ return vaddq_f32(a, b);
+}
+
+PX_FORCE_INLINE Vec3V V3Add(const Vec3V a, const FloatV b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDFLOATV(b);
+ return vaddq_f32(a, Vec3V_From_FloatV(b));
+}
+
+PX_FORCE_INLINE Vec3V V3Sub(const Vec3V a, const Vec3V b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ return vsubq_f32(a, b);
+}
+
+PX_FORCE_INLINE Vec3V V3Sub(const Vec3V a, const FloatV b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDFLOATV(b);
+ return vsubq_f32(a, Vec3V_From_FloatV(b));
+}
+
+PX_FORCE_INLINE Vec3V V3Scale(const Vec3V a, const FloatV b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDFLOATV(b);
+ const float32x4_t tmp = vmulq_lane_f32(a, b, 0);
+ return vsetq_lane_f32(0.0f, tmp, 3);
+}
+
+PX_FORCE_INLINE Vec3V V3Mul(const Vec3V a, const Vec3V b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ return vmulq_f32(a, b);
+}
+
+PX_FORCE_INLINE Vec3V V3ScaleInv(const Vec3V a, const FloatV b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDFLOATV(b);
+ const float32x2_t invB = VRECIP(b);
+ const float32x4_t tmp = vmulq_lane_f32(a, invB, 0);
+ return vsetq_lane_f32(0.0f, tmp, 3);
+}
+
+PX_FORCE_INLINE Vec3V V3Div(const Vec3V a, const Vec3V b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ float32x4_t invB = VRECIPQ(b);
+ invB = vsetq_lane_f32(0.0f, invB, 3);
+ return vmulq_f32(a, invB);
+}
+
+PX_FORCE_INLINE Vec3V V3ScaleInvFast(const Vec3V a, const FloatV b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDFLOATV(b);
+ const float32x2_t invB = VRECIPE(b);
+ const float32x4_t tmp = vmulq_lane_f32(a, invB, 0);
+ return vsetq_lane_f32(0.0f, tmp, 3);
+}
+
+PX_FORCE_INLINE Vec3V V3DivFast(const Vec3V a, const Vec3V b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ float32x4_t invB = VRECIPEQ(b);
+ invB = vsetq_lane_f32(0.0f, invB, 3);
+ return vmulq_f32(a, invB);
+}
+
+PX_FORCE_INLINE Vec3V V3Recip(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ const float32x4_t recipA = VRECIPQ(a);
+ return vsetq_lane_f32(0.0f, recipA, 3);
+}
+
+PX_FORCE_INLINE Vec3V V3RecipFast(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ const float32x4_t recipA = VRECIPEQ(a);
+ return vsetq_lane_f32(0.0f, recipA, 3);
+}
+
+PX_FORCE_INLINE Vec3V V3Rsqrt(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ const float32x4_t rSqrA = VRECIPSQRTQ(a);
+ return vsetq_lane_f32(0.0f, rSqrA, 3);
+}
+
+PX_FORCE_INLINE Vec3V V3RsqrtFast(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ const float32x4_t rSqrA = VRECIPSQRTEQ(a);
+ return vsetq_lane_f32(0.0f, rSqrA, 3);
+}
+
+PX_FORCE_INLINE Vec3V V3ScaleAdd(const Vec3V a, const FloatV b, const Vec3V c)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDFLOATV(b);
+ ASSERT_ISVALIDVEC3V(c);
+
+ float32x4_t tmp = vmlaq_lane_f32(c, a, b, 0);
+ // using vsetq_lane_f32 resulted in failures,
+ // probably related to a compiler bug on
+ // ndk r9d-win32, gcc 4.8, cardhu/shield
+
+ // code with issue
+ // return vsetq_lane_f32(0.0f, tmp, 3);
+
+ // workaround
+ float32x2_t w_z = vget_high_f32(tmp);
+ float32x2_t y_x = vget_low_f32(tmp);
+ w_z = vset_lane_f32(0.0f, w_z, 1);
+ return vcombine_f32(y_x, w_z);
+}
+
+PX_FORCE_INLINE Vec3V V3NegScaleSub(const Vec3V a, const FloatV b, const Vec3V c)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDFLOATV(b);
+ ASSERT_ISVALIDVEC3V(c);
+
+ float32x4_t tmp = vmlsq_lane_f32(c, a, b, 0);
+ // using vsetq_lane_f32 resulted in failures,
+ // probably related to a compiler bug on
+ // ndk r9d-win32, gcc 4.8, cardhu/shield
+
+ // code with issue
+ // return vsetq_lane_f32(0.0f, tmp, 3);
+
+ // workaround
+ float32x2_t w_z = vget_high_f32(tmp);
+ float32x2_t y_x = vget_low_f32(tmp);
+ w_z = vset_lane_f32(0.0f, w_z, 1);
+ return vcombine_f32(y_x, w_z);
+}
+
+PX_FORCE_INLINE Vec3V V3MulAdd(const Vec3V a, const Vec3V b, const Vec3V c)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ ASSERT_ISVALIDVEC3V(c);
+ return vmlaq_f32(c, a, b);
+}
+
+PX_FORCE_INLINE Vec3V V3NegMulSub(const Vec3V a, const Vec3V b, const Vec3V c)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ ASSERT_ISVALIDVEC3V(c);
+ return vmlsq_f32(c, a, b);
+}
+
+PX_FORCE_INLINE Vec3V V3Abs(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ return vabsq_f32(a);
+}
+
+PX_FORCE_INLINE FloatV V3Dot(const Vec3V a, const Vec3V b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+
+ // const uint32x2_t mask = {0xffffFFFF, 0x0};
+ const float32x4_t tmp = vmulq_f32(a, b);
+
+ const float32x2_t low = vget_low_f32(tmp);
+ const float32x2_t high = vget_high_f32(tmp);
+ // const float32x2_t high = vreinterpret_f32_u32(vand_u32(vreinterpret_u32_f32(high_), mask));
+
+ const float32x2_t sumTmp = vpadd_f32(low, high); // = {0+z, x+y}
+ const float32x2_t sum0ZYX = vpadd_f32(sumTmp, sumTmp); // = {x+y+z, x+y+z}
+
+ return sum0ZYX;
+}
+
+PX_FORCE_INLINE Vec3V V3Cross(const Vec3V a, const Vec3V b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+
+ const uint32_t ui32[2] = { 0xffffFFFF, 0x0 };
+ const uint32x2_t TF = vld1_u32(ui32);
+ const float32x2_t ay_ax = vget_low_f32(a); // d2
+ const float32x2_t aw_az = vget_high_f32(a); // d3
+ const float32x2_t by_bx = vget_low_f32(b); // d4
+ const float32x2_t bw_bz = vget_high_f32(b); // d5
+ // Hi, Lo
+ const float32x2_t bz_by = vext_f32(by_bx, bw_bz, 1); // bz, by
+ const float32x2_t az_ay = vext_f32(ay_ax, aw_az, 1); // az, ay
+
+ const float32x2_t azbx = vmul_f32(aw_az, by_bx); // 0, az*bx
+ const float32x2_t aybz_axby = vmul_f32(ay_ax, bz_by); // ay*bz, ax*by
+
+ const float32x2_t azbxSUBaxbz = vmls_f32(azbx, bw_bz, ay_ax); // 0, az*bx-ax*bz
+ const float32x2_t aybzSUBazby_axbySUBaybx = vmls_f32(aybz_axby, by_bx, az_ay); // ay*bz-az*by, ax*by-ay*bx
+
+ const float32x2_t retLow = vext_f32(aybzSUBazby_axbySUBaybx, azbxSUBaxbz, 1); // az*bx-ax*bz, ay*bz-az*by
+ const uint32x2_t retHigh = vand_u32(TF, vreinterpret_u32_f32(aybzSUBazby_axbySUBaybx)); // 0, ax*by-ay*bx
+
+ return vcombine_f32(retLow, vreinterpret_f32_u32(retHigh));
+}
+
+PX_FORCE_INLINE VecCrossV V3PrepareCross(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ return a;
+}
+
+PX_FORCE_INLINE FloatV V3Length(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+
+ // const uint32x2_t mask = {0xffffFFFF, 0x0};
+
+ const float32x4_t tmp = vmulq_f32(a, a);
+ const float32x2_t low = vget_low_f32(tmp);
+ const float32x2_t high = vget_high_f32(tmp);
+ // const float32x2_t high = vreinterpret_f32_u32(vand_u32(vreinterpret_u32_f32(high_), mask));
+
+ const float32x2_t sumTmp = vpadd_f32(low, high); // = {0+z, x+y}
+ const float32x2_t sum0ZYX = vpadd_f32(sumTmp, sumTmp); // = {x+y+z, x+y+z}
+
+ return FSqrt(sum0ZYX);
+}
+
+PX_FORCE_INLINE FloatV V3LengthSq(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ return V3Dot(a, a);
+}
+
+PX_FORCE_INLINE Vec3V V3Normalize(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ //PX_ASSERT(!FAllEq(V4LengthSq(a), FZero()));
+ return V3ScaleInv(a, V3Length(a));
+}
+
+PX_FORCE_INLINE Vec3V V3NormalizeFast(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ //PX_ASSERT(!FAllEq(V4LengthSq(a), FZero()));
+ return V3Scale(a, VRECIPSQRTE(V3Dot(a, a)));
+}
+
+PX_FORCE_INLINE Vec3V V3NormalizeSafe(const Vec3V a, const Vec3V unsafeReturnValue)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ const FloatV zero = vdup_n_f32(0.0f);
+ const FloatV length = V3Length(a);
+ const uint32x4_t isGreaterThanZero = FIsGrtr(length, zero);
+ return V3Sel(isGreaterThanZero, V3ScaleInv(a, length), unsafeReturnValue);
+}
+
+PX_FORCE_INLINE Vec3V V3Sel(const BoolV c, const Vec3V a, const Vec3V b)
+{
+ ASSERT_ISVALIDVEC3V( vbslq_f32(c, a, b));
+ return vbslq_f32(c, a, b);
+}
+
+PX_FORCE_INLINE BoolV V3IsGrtr(const Vec3V a, const Vec3V b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ return vcgtq_f32(a, b);
+}
+
+PX_FORCE_INLINE BoolV V3IsGrtrOrEq(const Vec3V a, const Vec3V b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ return vcgeq_f32(a, b);
+}
+
+PX_FORCE_INLINE BoolV V3IsEq(const Vec3V a, const Vec3V b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ return vceqq_f32(a, b);
+}
+
+PX_FORCE_INLINE Vec3V V3Max(const Vec3V a, const Vec3V b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ return vmaxq_f32(a, b);
+}
+
+PX_FORCE_INLINE Vec3V V3Min(const Vec3V a, const Vec3V b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ return vminq_f32(a, b);
+}
+
+PX_FORCE_INLINE FloatV V3ExtractMax(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+
+ const float32x2_t low = vget_low_f32(a);
+ const float32x2_t high = vget_high_f32(a);
+
+ const float32x2_t zz = vdup_lane_f32(high, 0);
+ const float32x2_t max0 = vpmax_f32(zz, low);
+ const float32x2_t max1 = vpmax_f32(max0, max0);
+
+ return max1;
+}
+
+PX_FORCE_INLINE FloatV V3ExtractMin(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+
+ const float32x2_t low = vget_low_f32(a);
+ const float32x2_t high = vget_high_f32(a);
+
+ const float32x2_t zz = vdup_lane_f32(high, 0);
+ const float32x2_t min0 = vpmin_f32(zz, low);
+ const float32x2_t min1 = vpmin_f32(min0, min0);
+
+ return min1;
+}
+
+// return (a >= 0.0f) ? 1.0f : -1.0f;
+PX_FORCE_INLINE Vec3V V3Sign(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ const Vec3V zero = V3Zero();
+ const Vec3V one = V3One();
+ const Vec3V none = V3Neg(one);
+ return V3Sel(V3IsGrtrOrEq(a, zero), one, none);
+}
+
+PX_FORCE_INLINE Vec3V V3Clamp(const Vec3V a, const Vec3V minV, const Vec3V maxV)
+{
+ ASSERT_ISVALIDVEC3V(minV);
+ ASSERT_ISVALIDVEC3V(maxV);
+ return V3Max(V3Min(a, maxV), minV);
+}
+
+PX_FORCE_INLINE PxU32 V3AllGrtr(const Vec3V a, const Vec3V b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ return internalUnitNeonSimd::BAllTrue3_R(V4IsGrtr(a, b));
+}
+
+PX_FORCE_INLINE PxU32 V3AllGrtrOrEq(const Vec3V a, const Vec3V b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ return internalUnitNeonSimd::BAllTrue3_R(V4IsGrtrOrEq(a, b));
+}
+
+PX_FORCE_INLINE PxU32 V3AllEq(const Vec3V a, const Vec3V b)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(b);
+ return internalUnitNeonSimd::BAllTrue3_R(V4IsEq(a, b));
+}
+
+PX_FORCE_INLINE Vec3V V3Round(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ // truncate(a + (0.5f - sign(a)))
+ const Vec3V half = V3Load(0.5f);
+ const float32x4_t sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(a), 31)));
+ const Vec3V aPlusHalf = V3Add(a, half);
+ const Vec3V aRound = V3Sub(aPlusHalf, sign);
+ return vcvtq_f32_s32(vcvtq_s32_f32(aRound));
+}
+
+PX_FORCE_INLINE Vec3V V3Sin(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+
+ // Modulo the range of the given angles such that -XM_2PI <= Angles < XM_2PI
+ const Vec4V recipTwoPi = V4LoadA(g_PXReciprocalTwoPi.f);
+ const Vec4V twoPi = V4LoadA(g_PXTwoPi.f);
+ const Vec3V tmp = V4Mul(a, recipTwoPi);
+ const Vec3V b = V3Round(tmp);
+ const Vec3V V1 = V4NegMulSub(twoPi, b, a);
+
+ // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! -
+ // V^15 / 15! + V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI)
+ const Vec3V V2 = V3Mul(V1, V1);
+ const Vec3V V3 = V3Mul(V2, V1);
+ const Vec3V V5 = V3Mul(V3, V2);
+ const Vec3V V7 = V3Mul(V5, V2);
+ const Vec3V V9 = V3Mul(V7, V2);
+ const Vec3V V11 = V3Mul(V9, V2);
+ const Vec3V V13 = V3Mul(V11, V2);
+ const Vec3V V15 = V3Mul(V13, V2);
+ const Vec3V V17 = V3Mul(V15, V2);
+ const Vec3V V19 = V3Mul(V17, V2);
+ const Vec3V V21 = V3Mul(V19, V2);
+ const Vec3V V23 = V3Mul(V21, V2);
+
+ const Vec4V sinCoefficients0 = V4LoadA(g_PXSinCoefficients0.f);
+ const Vec4V sinCoefficients1 = V4LoadA(g_PXSinCoefficients1.f);
+ const Vec4V sinCoefficients2 = V4LoadA(g_PXSinCoefficients2.f);
+
+ const FloatV S1 = V4GetY(sinCoefficients0);
+ const FloatV S2 = V4GetZ(sinCoefficients0);
+ const FloatV S3 = V4GetW(sinCoefficients0);
+ const FloatV S4 = V4GetX(sinCoefficients1);
+ const FloatV S5 = V4GetY(sinCoefficients1);
+ const FloatV S6 = V4GetZ(sinCoefficients1);
+ const FloatV S7 = V4GetW(sinCoefficients1);
+ const FloatV S8 = V4GetX(sinCoefficients2);
+ const FloatV S9 = V4GetY(sinCoefficients2);
+ const FloatV S10 = V4GetZ(sinCoefficients2);
+ const FloatV S11 = V4GetW(sinCoefficients2);
+
+ Vec3V Result;
+ Result = V4ScaleAdd(V3, S1, V1);
+ Result = V4ScaleAdd(V5, S2, Result);
+ Result = V4ScaleAdd(V7, S3, Result);
+ Result = V4ScaleAdd(V9, S4, Result);
+ Result = V4ScaleAdd(V11, S5, Result);
+ Result = V4ScaleAdd(V13, S6, Result);
+ Result = V4ScaleAdd(V15, S7, Result);
+ Result = V4ScaleAdd(V17, S8, Result);
+ Result = V4ScaleAdd(V19, S9, Result);
+ Result = V4ScaleAdd(V21, S10, Result);
+ Result = V4ScaleAdd(V23, S11, Result);
+
+ return Result;
+}
+
+PX_FORCE_INLINE Vec3V V3Cos(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+
+ // Modulo the range of the given angles such that -XM_2PI <= Angles < XM_2PI
+ const Vec4V recipTwoPi = V4LoadA(g_PXReciprocalTwoPi.f);
+ const Vec4V twoPi = V4LoadA(g_PXTwoPi.f);
+ const Vec3V tmp = V4Mul(a, recipTwoPi);
+ const Vec3V b = V3Round(tmp);
+ const Vec3V V1 = V4NegMulSub(twoPi, b, a);
+
+ // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + V^12 / 12! -
+ // V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI)
+ const Vec3V V2 = V3Mul(V1, V1);
+ const Vec3V V4 = V3Mul(V2, V2);
+ const Vec3V V6 = V3Mul(V4, V2);
+ const Vec3V V8 = V3Mul(V4, V4);
+ const Vec3V V10 = V3Mul(V6, V4);
+ const Vec3V V12 = V3Mul(V6, V6);
+ const Vec3V V14 = V3Mul(V8, V6);
+ const Vec3V V16 = V3Mul(V8, V8);
+ const Vec3V V18 = V3Mul(V10, V8);
+ const Vec3V V20 = V3Mul(V10, V10);
+ const Vec3V V22 = V3Mul(V12, V10);
+
+ const Vec4V cosCoefficients0 = V4LoadA(g_PXCosCoefficients0.f);
+ const Vec4V cosCoefficients1 = V4LoadA(g_PXCosCoefficients1.f);
+ const Vec4V cosCoefficients2 = V4LoadA(g_PXCosCoefficients2.f);
+
+ const FloatV C1 = V4GetY(cosCoefficients0);
+ const FloatV C2 = V4GetZ(cosCoefficients0);
+ const FloatV C3 = V4GetW(cosCoefficients0);
+ const FloatV C4 = V4GetX(cosCoefficients1);
+ const FloatV C5 = V4GetY(cosCoefficients1);
+ const FloatV C6 = V4GetZ(cosCoefficients1);
+ const FloatV C7 = V4GetW(cosCoefficients1);
+ const FloatV C8 = V4GetX(cosCoefficients2);
+ const FloatV C9 = V4GetY(cosCoefficients2);
+ const FloatV C10 = V4GetZ(cosCoefficients2);
+ const FloatV C11 = V4GetW(cosCoefficients2);
+
+ Vec3V Result;
+ Result = V4ScaleAdd(V2, C1, V4One());
+ Result = V4ScaleAdd(V4, C2, Result);
+ Result = V4ScaleAdd(V6, C3, Result);
+ Result = V4ScaleAdd(V8, C4, Result);
+ Result = V4ScaleAdd(V10, C5, Result);
+ Result = V4ScaleAdd(V12, C6, Result);
+ Result = V4ScaleAdd(V14, C7, Result);
+ Result = V4ScaleAdd(V16, C8, Result);
+ Result = V4ScaleAdd(V18, C9, Result);
+ Result = V4ScaleAdd(V20, C10, Result);
+ Result = V4ScaleAdd(V22, C11, Result);
+
+ return V4ClearW(Result);
+}
+
+PX_FORCE_INLINE Vec3V V3PermYZZ(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ const float32x2_t xy = vget_low_f32(a);
+ const float32x2_t zw = vget_high_f32(a);
+ const float32x2_t yz = vext_f32(xy, zw, 1);
+ return vcombine_f32(yz, zw);
+}
+
+PX_FORCE_INLINE Vec3V V3PermXYX(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+
+ const uint32_t ui32[2] = { 0xffffFFFF, 0x0 };
+ const uint32x2_t mask = vld1_u32(ui32);
+ const uint32x2_t xy = vget_low_u32(vreinterpretq_u32_f32(a));
+ const uint32x2_t xw = vand_u32(xy, mask);
+ return vreinterpretq_f32_u32(vcombine_u32(xy, xw));
+}
+
+PX_FORCE_INLINE Vec3V V3PermYZX(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+
+ const uint32_t ui32[2] = { 0xffffFFFF, 0x0 };
+ const uint32x2_t mask = vld1_u32(ui32);
+ const uint32x2_t xy = vget_low_u32(vreinterpretq_u32_f32(a));
+ const uint32x2_t zw = vget_high_u32(vreinterpretq_u32_f32(a));
+ const uint32x2_t yz = vext_u32(xy, zw, 1);
+ const uint32x2_t xw = vand_u32(xy, mask);
+ return vreinterpretq_f32_u32(vcombine_u32(yz, xw));
+}
+
+PX_FORCE_INLINE Vec3V V3PermZXY(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+
+ const uint32x2_t xy = vget_low_u32(vreinterpretq_u32_f32(a));
+ const uint32x2_t zw = vget_high_u32(vreinterpretq_u32_f32(a));
+ const uint32x2_t wz = vrev64_u32(zw);
+
+ const uint32x2_t zx = vext_u32(wz, xy, 1);
+ const uint32x2_t yw = vext_u32(xy, wz, 1);
+
+ return vreinterpretq_f32_u32(vcombine_u32(zx, yw));
+}
+
+PX_FORCE_INLINE Vec3V V3PermZZY(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+
+ const uint32x2_t xy = vget_low_u32(vreinterpretq_u32_f32(a));
+ const uint32x2_t zw = vget_high_u32(vreinterpretq_u32_f32(a));
+
+ const uint32x2_t wz = vrev64_u32(zw);
+ const uint32x2_t yw = vext_u32(xy, wz, 1);
+ const uint32x2_t zz = vdup_lane_u32(wz, 1);
+
+ return vreinterpretq_f32_u32(vcombine_u32(zz, yw));
+}
+
+PX_FORCE_INLINE Vec3V V3PermYXX(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+
+ const uint32_t ui32[2] = { 0xffffFFFF, 0x0 };
+ const uint32x2_t mask = vld1_u32(ui32);
+ const uint32x2_t xy = vget_low_u32(vreinterpretq_u32_f32(a));
+ const uint32x2_t yx = vrev64_u32(xy);
+ const uint32x2_t xw = vand_u32(xy, mask);
+ return vreinterpretq_f32_u32(vcombine_u32(yx, xw));
+}
+
+PX_FORCE_INLINE Vec3V V3Perm_Zero_1Z_0Y(const Vec3V v0, const Vec3V v1)
+{
+ ASSERT_ISVALIDVEC3V(v0);
+ ASSERT_ISVALIDVEC3V(v1);
+
+ const uint32x2_t xy = vget_low_u32(vreinterpretq_u32_f32(v0));
+ const uint32x2_t zw = vget_high_u32(vreinterpretq_u32_f32(v1));
+ const uint32x2_t wz = vrev64_u32(zw);
+ const uint32x2_t yw = vext_u32(xy, wz, 1);
+
+ return vreinterpretq_f32_u32(vcombine_u32(wz, yw));
+}
+
+PX_FORCE_INLINE Vec3V V3Perm_0Z_Zero_1X(const Vec3V v0, const Vec3V v1)
+{
+ ASSERT_ISVALIDVEC3V(v0);
+ ASSERT_ISVALIDVEC3V(v1);
+
+ const uint32_t ui32[2] = { 0xffffFFFF, 0x0 };
+ const uint32x2_t mask = vld1_u32(ui32);
+ const uint32x2_t zw = vget_high_u32(vreinterpretq_u32_f32(v0));
+ const uint32x2_t xy = vget_low_u32(vreinterpretq_u32_f32(v1));
+ const uint32x2_t xw = vand_u32(xy, mask);
+
+ return vreinterpretq_f32_u32(vcombine_u32(zw, xw));
+}
+
+PX_FORCE_INLINE Vec3V V3Perm_1Y_0X_Zero(const Vec3V v0, const Vec3V v1)
+{
+ ASSERT_ISVALIDVEC3V(v0);
+ ASSERT_ISVALIDVEC3V(v1);
+
+ const uint32x2_t axy = vget_low_u32(vreinterpretq_u32_f32(v0));
+ const uint32x2_t bxy = vget_low_u32(vreinterpretq_u32_f32(v1));
+ const uint32x2_t byax = vext_u32(bxy, axy, 1);
+ const uint32x2_t ww = vdup_n_u32(0);
+
+ return vreinterpretq_f32_u32(vcombine_u32(byax, ww));
+}
+
+PX_FORCE_INLINE FloatV V3SumElems(const Vec3V a)
+{
+ ASSERT_ISVALIDVEC3V(a);
+
+ // const uint32x2_t mask = {0xffffFFFF, 0x0};
+
+ const float32x2_t low = vget_low_f32(a);
+ const float32x2_t high = vget_high_f32(a);
+ // const float32x2_t high = vreinterpret_f32_u32(vand_u32(vreinterpret_u32_f32(high_), mask));
+
+ const float32x2_t sumTmp = vpadd_f32(low, high); // = {0+z, x+y}
+ const float32x2_t sum0ZYX = vpadd_f32(sumTmp, sumTmp); // = {x+y+z, x+y+z}
+
+ return sum0ZYX;
+}
+
+PX_FORCE_INLINE PxU32 V3OutOfBounds(const Vec3V a, const Vec3V min, const Vec3V max)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(min);
+ ASSERT_ISVALIDVEC3V(max);
+
+ const BoolV c = BOr(V3IsGrtr(a, max), V3IsGrtr(min, a));
+ return internalUnitNeonSimd::BAnyTrue3_R(c);
+}
+
+PX_FORCE_INLINE PxU32 V3InBounds(const Vec3V a, const Vec3V min, const Vec3V max)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(min);
+ ASSERT_ISVALIDVEC3V(max);
+
+ const BoolV c = BAnd(V3IsGrtrOrEq(a, min), V3IsGrtrOrEq(max, a));
+ return internalUnitNeonSimd::BAllTrue4_R(c);
+}
+
+PX_FORCE_INLINE PxU32 V3OutOfBounds(const Vec3V a, const Vec3V bounds)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(bounds);
+
+ const BoolV greater = V3IsGrtr(V3Abs(a), bounds);
+ return internalUnitNeonSimd::BAnyTrue3_R(greater);
+}
+
+PX_FORCE_INLINE PxU32 V3InBounds(const Vec3V a, const Vec3V bounds)
+{
+ ASSERT_ISVALIDVEC3V(a);
+ ASSERT_ISVALIDVEC3V(bounds);
+
+ const BoolV greaterOrEq = V3IsGrtrOrEq(bounds, V3Abs(a));
+ return internalUnitNeonSimd::BAllTrue4_R(greaterOrEq);
+}
+
+PX_FORCE_INLINE void V3Transpose(Vec3V& col0, Vec3V& col1, Vec3V& col2)
+{
+ ASSERT_ISVALIDVEC3V(col0);
+ ASSERT_ISVALIDVEC3V(col1);
+ ASSERT_ISVALIDVEC3V(col2);
+
+ Vec3V col3 = V3Zero();
+ const float32x4x2_t v0v1 = vzipq_f32(col0, col2);
+ const float32x4x2_t v2v3 = vzipq_f32(col1, col3);
+ const float32x4x2_t zip0 = vzipq_f32(v0v1.val[0], v2v3.val[0]);
+ const float32x4x2_t zip1 = vzipq_f32(v0v1.val[1], v2v3.val[1]);
+ col0 = zip0.val[0];
+ col1 = zip0.val[1];
+ col2 = zip1.val[0];
+ // col3 = zip1.val[1];
+}
+
+//////////////////////////////////
+// VEC4V
+//////////////////////////////////
+
+PX_FORCE_INLINE Vec4V V4Splat(const FloatV f)
+{
+ ASSERT_ISVALIDFLOATV(f);
+ return vcombine_f32(f, f);
+}
+
+PX_FORCE_INLINE Vec4V V4Merge(const FloatV* const floatVArray)
+{
+ ASSERT_ISVALIDFLOATV(floatVArray[0]);
+ ASSERT_ISVALIDFLOATV(floatVArray[1]);
+ ASSERT_ISVALIDFLOATV(floatVArray[2]);
+ ASSERT_ISVALIDFLOATV(floatVArray[3]);
+
+ const uint32x2_t xLow = vreinterpret_u32_f32(floatVArray[0]);
+ const uint32x2_t yLow = vreinterpret_u32_f32(floatVArray[1]);
+ const uint32x2_t zLow = vreinterpret_u32_f32(floatVArray[2]);
+ const uint32x2_t wLow = vreinterpret_u32_f32(floatVArray[3]);
+
+ const uint32x2_t dLow = vext_u32(xLow, yLow, 1);
+ const uint32x2_t dHigh = vext_u32(zLow, wLow, 1);
+
+ return vreinterpretq_f32_u32(vcombine_u32(dLow, dHigh));
+}
+
+PX_FORCE_INLINE Vec4V V4Merge(const FloatVArg x, const FloatVArg y, const FloatVArg z, const FloatVArg w)
+{
+ ASSERT_ISVALIDFLOATV(x);
+ ASSERT_ISVALIDFLOATV(y);
+ ASSERT_ISVALIDFLOATV(z);
+ ASSERT_ISVALIDFLOATV(w);
+
+ const uint32x2_t xLow = vreinterpret_u32_f32(x);
+ const uint32x2_t yLow = vreinterpret_u32_f32(y);
+ const uint32x2_t zLow = vreinterpret_u32_f32(z);
+ const uint32x2_t wLow = vreinterpret_u32_f32(w);
+
+ const uint32x2_t dLow = vext_u32(xLow, yLow, 1);
+ const uint32x2_t dHigh = vext_u32(zLow, wLow, 1);
+
+ return vreinterpretq_f32_u32(vcombine_u32(dLow, dHigh));
+}
+
+PX_FORCE_INLINE Vec4V V4MergeW(const Vec4VArg x, const Vec4VArg y, const Vec4VArg z, const Vec4VArg w)
+{
+ const float32x2_t xx = vget_high_f32(x);
+ const float32x2_t yy = vget_high_f32(y);
+ const float32x2_t zz = vget_high_f32(z);
+ const float32x2_t ww = vget_high_f32(w);
+
+ const float32x2x2_t zipL = vzip_f32(xx, yy);
+ const float32x2x2_t zipH = vzip_f32(zz, ww);
+
+ return vcombine_f32(zipL.val[1], zipH.val[1]);
+}
+
+PX_FORCE_INLINE Vec4V V4MergeZ(const Vec4VArg x, const Vec4VArg y, const Vec4VArg z, const Vec4VArg w)
+{
+ const float32x2_t xx = vget_high_f32(x);
+ const float32x2_t yy = vget_high_f32(y);
+ const float32x2_t zz = vget_high_f32(z);
+ const float32x2_t ww = vget_high_f32(w);
+
+ const float32x2x2_t zipL = vzip_f32(xx, yy);
+ const float32x2x2_t zipH = vzip_f32(zz, ww);
+
+ return vcombine_f32(zipL.val[0], zipH.val[0]);
+}
+
+PX_FORCE_INLINE Vec4V V4MergeY(const Vec4VArg x, const Vec4VArg y, const Vec4VArg z, const Vec4VArg w)
+{
+ const float32x2_t xx = vget_low_f32(x);
+ const float32x2_t yy = vget_low_f32(y);
+ const float32x2_t zz = vget_low_f32(z);
+ const float32x2_t ww = vget_low_f32(w);
+
+ const float32x2x2_t zipL = vzip_f32(xx, yy);
+ const float32x2x2_t zipH = vzip_f32(zz, ww);
+
+ return vcombine_f32(zipL.val[1], zipH.val[1]);
+}
+
+PX_FORCE_INLINE Vec4V V4MergeX(const Vec4VArg x, const Vec4VArg y, const Vec4VArg z, const Vec4VArg w)
+{
+ const float32x2_t xx = vget_low_f32(x);
+ const float32x2_t yy = vget_low_f32(y);
+ const float32x2_t zz = vget_low_f32(z);
+ const float32x2_t ww = vget_low_f32(w);
+
+ const float32x2x2_t zipL = vzip_f32(xx, yy);
+ const float32x2x2_t zipH = vzip_f32(zz, ww);
+
+ return vcombine_f32(zipL.val[0], zipH.val[0]);
+}
+
+PX_FORCE_INLINE Vec4V V4UnpackXY(const Vec4VArg a, const Vec4VArg b)
+{
+ return vzipq_f32(a, b).val[0];
+}
+
+PX_FORCE_INLINE Vec4V V4UnpackZW(const Vec4VArg a, const Vec4VArg b)
+{
+ return vzipq_f32(a, b).val[1];
+}
+
+PX_FORCE_INLINE Vec4V V4UnitW()
+{
+ const float32x2_t zeros = vreinterpret_f32_u32(vmov_n_u32(0));
+ const float32x2_t ones = vmov_n_f32(1.0f);
+ const float32x2_t zo = vext_f32(zeros, ones, 1);
+ return vcombine_f32(zeros, zo);
+}
+
+PX_FORCE_INLINE Vec4V V4UnitX()
+{
+ const float32x2_t zeros = vreinterpret_f32_u32(vmov_n_u32(0));
+ const float32x2_t ones = vmov_n_f32(1.0f);
+ const float32x2_t oz = vext_f32(ones, zeros, 1);
+ return vcombine_f32(oz, zeros);
+}
+
+PX_FORCE_INLINE Vec4V V4UnitY()
+{
+ const float32x2_t zeros = vreinterpret_f32_u32(vmov_n_u32(0));
+ const float32x2_t ones = vmov_n_f32(1.0f);
+ const float32x2_t zo = vext_f32(zeros, ones, 1);
+ return vcombine_f32(zo, zeros);
+}
+
+PX_FORCE_INLINE Vec4V V4UnitZ()
+{
+ const float32x2_t zeros = vreinterpret_f32_u32(vmov_n_u32(0));
+ const float32x2_t ones = vmov_n_f32(1.0f);
+ const float32x2_t oz = vext_f32(ones, zeros, 1);
+ return vcombine_f32(zeros, oz);
+}
+
+PX_FORCE_INLINE FloatV V4GetW(const Vec4V f)
+{
+ const float32x2_t fhigh = vget_high_f32(f);
+ return vdup_lane_f32(fhigh, 1);
+}
+
+PX_FORCE_INLINE FloatV V4GetX(const Vec4V f)
+{
+ const float32x2_t fLow = vget_low_f32(f);
+ return vdup_lane_f32(fLow, 0);
+}
+
+PX_FORCE_INLINE FloatV V4GetY(const Vec4V f)
+{
+ const float32x2_t fLow = vget_low_f32(f);
+ return vdup_lane_f32(fLow, 1);
+}
+
+PX_FORCE_INLINE FloatV V4GetZ(const Vec4V f)
+{
+ const float32x2_t fhigh = vget_high_f32(f);
+ return vdup_lane_f32(fhigh, 0);
+}
+
+PX_FORCE_INLINE Vec4V V4SetW(const Vec4V v, const FloatV f)
+{
+ ASSERT_ISVALIDFLOATV(f);
+ return V4Sel(BTTTF(), v, vcombine_f32(f, f));
+}
+
+PX_FORCE_INLINE Vec4V V4SetX(const Vec4V v, const FloatV f)
+{
+ ASSERT_ISVALIDFLOATV(f);
+ return V4Sel(BFTTT(), v, vcombine_f32(f, f));
+}
+
+PX_FORCE_INLINE Vec4V V4SetY(const Vec4V v, const FloatV f)
+{
+ ASSERT_ISVALIDFLOATV(f);
+ return V4Sel(BTFTT(), v, vcombine_f32(f, f));
+}
+
+PX_FORCE_INLINE Vec4V V4SetZ(const Vec4V v, const FloatV f)
+{
+ ASSERT_ISVALIDFLOATV(f);
+ return V4Sel(BTTFT(), v, vcombine_f32(f, f));
+}
+
+PX_FORCE_INLINE Vec4V V4ClearW(const Vec4V v)
+{
+ return V4Sel(BTTTF(), v, V4Zero());
+}
+
+PX_FORCE_INLINE Vec4V V4PermYXWZ(const Vec4V a)
+{
+ const float32x2_t xy = vget_low_f32(a);
+ const float32x2_t zw = vget_high_f32(a);
+ const float32x2_t yx = vext_f32(xy, xy, 1);
+ const float32x2_t wz = vext_f32(zw, zw, 1);
+ return vcombine_f32(yx, wz);
+}
+
+PX_FORCE_INLINE Vec4V V4PermXZXZ(const Vec4V a)
+{
+ const float32x2_t xy = vget_low_f32(a);
+ const float32x2_t zw = vget_high_f32(a);
+ const float32x2x2_t xzyw = vzip_f32(xy, zw);
+ return vcombine_f32(xzyw.val[0], xzyw.val[0]);
+}
+
+PX_FORCE_INLINE Vec4V V4PermYWYW(const Vec4V a)
+{
+ const float32x2_t xy = vget_low_f32(a);
+ const float32x2_t zw = vget_high_f32(a);
+ const float32x2x2_t xzyw = vzip_f32(xy, zw);
+ return vcombine_f32(xzyw.val[1], xzyw.val[1]);
+}
+
+PX_FORCE_INLINE Vec4V V4PermYZXW(const Vec4V a)
+{
+ const uint32x2_t xy = vget_low_u32(vreinterpretq_u32_f32(a));
+ const uint32x2_t zw = vget_high_u32(vreinterpretq_u32_f32(a));
+ const uint32x2_t yz = vext_u32(xy, zw, 1);
+ const uint32x2_t xw = vrev64_u32(vext_u32(zw, xy, 1));
+ return vreinterpretq_f32_u32(vcombine_u32(yz, xw));
+}
+
+PX_FORCE_INLINE Vec4V V4PermZWXY(const Vec4V a)
+{
+ const float32x2_t low = vget_low_f32(a);
+ const float32x2_t high = vget_high_f32(a);
+ return vcombine_f32(high, low);
+}
+
+template
+PX_FORCE_INLINE Vec4V V4Perm(const Vec4V V)
+{
+ static const uint32_t ControlElement[4] =
+ {
+#if 1
+ 0x03020100, // XM_SWIZZLE_X
+ 0x07060504, // XM_SWIZZLE_Y
+ 0x0B0A0908, // XM_SWIZZLE_Z
+ 0x0F0E0D0C, // XM_SWIZZLE_W
+#else
+ 0x00010203, // XM_SWIZZLE_X
+ 0x04050607, // XM_SWIZZLE_Y
+ 0x08090A0B, // XM_SWIZZLE_Z
+ 0x0C0D0E0F, // XM_SWIZZLE_W
+#endif
+ };
+
+ uint8x8x2_t tbl;
+ tbl.val[0] = vreinterpret_u8_f32(vget_low_f32(V));
+ tbl.val[1] = vreinterpret_u8_f32(vget_high_f32(V));
+
+ uint8x8_t idx =
+ vcreate_u8(static_cast(ControlElement[E0]) | (static_cast(ControlElement[E1]) << 32));
+ const uint8x8_t rL = vtbl2_u8(tbl, idx);
+ idx = vcreate_u8(static_cast(ControlElement[E2]) | (static_cast(ControlElement[E3]) << 32));
+ const uint8x8_t rH = vtbl2_u8(tbl, idx);
+ return vreinterpretq_f32_u8(vcombine_u8(rL, rH));
+}
+
+// PT: this seems measurably slower than the hardcoded version
+/*PX_FORCE_INLINE Vec4V V4PermYZXW(const Vec4V a)
+{
+ return V4Perm<1, 2, 0, 3>(a);
+}*/
+
+PX_FORCE_INLINE Vec4V V4Zero()
+{
+ return vreinterpretq_f32_u32(vmovq_n_u32(0));
+ // return vmovq_n_f32(0.0f);
+}
+
+PX_FORCE_INLINE Vec4V V4One()
+{
+ return vmovq_n_f32(1.0f);
+}
+
+PX_FORCE_INLINE Vec4V V4Eps()
+{
+ // return vmovq_n_f32(PX_EPS_REAL);
+ return V4Load(PX_EPS_REAL);
+}
+
+PX_FORCE_INLINE Vec4V V4Neg(const Vec4V f)
+{
+ return vnegq_f32(f);
+}
+
+PX_FORCE_INLINE Vec4V V4Add(const Vec4V a, const Vec4V b)
+{
+ return vaddq_f32(a, b);
+}
+
+PX_FORCE_INLINE Vec4V V4Sub(const Vec4V a, const Vec4V b)
+{
+ return vsubq_f32(a, b);
+}
+
+PX_FORCE_INLINE Vec4V V4Scale(const Vec4V a, const FloatV b)
+{
+ return vmulq_lane_f32(a, b, 0);
+}
+
+PX_FORCE_INLINE Vec4V V4Mul(const Vec4V a, const Vec4V b)
+{
+ return vmulq_f32(a, b);
+}
+
+PX_FORCE_INLINE Vec4V V4ScaleInv(const Vec4V a, const FloatV b)
+{
+ ASSERT_ISVALIDFLOATV(b);
+ const float32x2_t invB = VRECIP(b);
+ return vmulq_lane_f32(a, invB, 0);
+}
+
+PX_FORCE_INLINE Vec4V V4Div(const Vec4V a, const Vec4V b)
+{
+ const float32x4_t invB = VRECIPQ(b);
+ return vmulq_f32(a, invB);
+}
+
+PX_FORCE_INLINE Vec4V V4ScaleInvFast(const Vec4V a, const FloatV b)
+{
+ ASSERT_ISVALIDFLOATV(b);
+ const float32x2_t invB = VRECIPE(b);
+ return vmulq_lane_f32(a, invB, 0);
+}
+
+PX_FORCE_INLINE Vec4V V4DivFast(const Vec4V a, const Vec4V b)
+{
+ const float32x4_t invB = VRECIPEQ(b);
+ return vmulq_f32(a, invB);
+}
+
+PX_FORCE_INLINE Vec4V V4Recip(const Vec4V a)
+{
+ return VRECIPQ(a);
+}
+
+PX_FORCE_INLINE Vec4V V4RecipFast(const Vec4V a)
+{
+ return VRECIPEQ(a);
+}
+
+PX_FORCE_INLINE Vec4V V4Rsqrt(const Vec4V a)
+{
+ return VRECIPSQRTQ(a);
+}
+
+PX_FORCE_INLINE Vec4V V4RsqrtFast(const Vec4V a)
+{
+ return VRECIPSQRTEQ(a);
+}
+
+PX_FORCE_INLINE Vec4V V4Sqrt(const Vec4V a)
+{
+ return V4Sel(V4IsEq(a, V4Zero()), a, V4Mul(a, VRECIPSQRTQ(a)));
+}
+
+PX_FORCE_INLINE Vec4V V4ScaleAdd(const Vec4V a, const FloatV b, const Vec4V c)
+{
+ ASSERT_ISVALIDFLOATV(b);
+ return vmlaq_lane_f32(c, a, b, 0);
+}
+
+PX_FORCE_INLINE Vec4V V4NegScaleSub(const Vec4V a, const FloatV b, const Vec4V c)
+{
+ ASSERT_ISVALIDFLOATV(b);
+ return vmlsq_lane_f32(c, a, b, 0);
+}
+
+PX_FORCE_INLINE Vec4V V4MulAdd(const Vec4V a, const Vec4V b, const Vec4V c)
+{
+ return vmlaq_f32(c, a, b);
+}
+
+PX_FORCE_INLINE Vec4V V4NegMulSub(const Vec4V a, const Vec4V b, const Vec4V c)
+{
+ return vmlsq_f32(c, a, b);
+}
+
+PX_FORCE_INLINE Vec4V V4Abs(const Vec4V a)
+{
+ return vabsq_f32(a);
+}
+
+PX_FORCE_INLINE FloatV V4SumElements(const Vec4V a)
+{
+ const Vec4V xy = V4UnpackXY(a, a); // x,x,y,y
+ const Vec4V zw = V4UnpackZW(a, a); // z,z,w,w
+ const Vec4V xz_yw = V4Add(xy, zw); // x+z,x+z,y+w,y+w
+ const FloatV xz = V4GetX(xz_yw); // x+z
+ const FloatV yw = V4GetZ(xz_yw); // y+w
+ return FAdd(xz, yw); // sum
+}
+
+PX_FORCE_INLINE FloatV V4Dot(const Vec4V a, const Vec4V b)
+{
+ const float32x4_t tmp = vmulq_f32(a, b);
+ const float32x2_t low = vget_low_f32(tmp);
+ const float32x2_t high = vget_high_f32(tmp);
+
+ const float32x2_t sumTmp = vpadd_f32(low, high); // = {z+w, x+y}
+ const float32x2_t sumWZYX = vpadd_f32(sumTmp, sumTmp); // = {x+y+z+w, x+y+z+w}
+ return sumWZYX;
+}
+
+PX_FORCE_INLINE FloatV V4Dot3(const Vec4V aa, const Vec4V bb)
+{
+ // PT: the V3Dot code relies on the fact that W=0 so we can't reuse it as-is, we need to clear W first.
+ // TODO: find a better implementation that does not need to clear W.
+ const Vec4V a = V4ClearW(aa);
+ const Vec4V b = V4ClearW(bb);
+
+ const float32x4_t tmp = vmulq_f32(a, b);
+ const float32x2_t low = vget_low_f32(tmp);
+ const float32x2_t high = vget_high_f32(tmp);
+
+ const float32x2_t sumTmp = vpadd_f32(low, high); // = {0+z, x+y}
+ const float32x2_t sum0ZYX = vpadd_f32(sumTmp, sumTmp); // = {x+y+z, x+y+z}
+ return sum0ZYX;
+}
+
+PX_FORCE_INLINE Vec4V V4Cross(const Vec4V a, const Vec4V b)
+{
+ const uint32_t ui32[2] = { 0xffffFFFF, 0x0 };
+ const uint32x2_t TF = vld1_u32(ui32);
+ const float32x2_t ay_ax = vget_low_f32(a); // d2
+ const float32x2_t aw_az = vget_high_f32(a); // d3
+ const float32x2_t by_bx = vget_low_f32(b); // d4
+ const float32x2_t bw_bz = vget_high_f32(b); // d5
+ // Hi, Lo
+ const float32x2_t bz_by = vext_f32(by_bx, bw_bz, 1); // bz, by
+ const float32x2_t az_ay = vext_f32(ay_ax, aw_az, 1); // az, ay
+
+ const float32x2_t azbx = vmul_f32(aw_az, by_bx); // 0, az*bx
+ const float32x2_t aybz_axby = vmul_f32(ay_ax, bz_by); // ay*bz, ax*by
+
+ const float32x2_t azbxSUBaxbz = vmls_f32(azbx, bw_bz, ay_ax); // 0, az*bx-ax*bz
+ const float32x2_t aybzSUBazby_axbySUBaybx = vmls_f32(aybz_axby, by_bx, az_ay); // ay*bz-az*by, ax*by-ay*bx
+
+ const float32x2_t retLow = vext_f32(aybzSUBazby_axbySUBaybx, azbxSUBaxbz, 1); // az*bx-ax*bz, ay*bz-az*by
+ const uint32x2_t retHigh = vand_u32(TF, vreinterpret_u32_f32(aybzSUBazby_axbySUBaybx)); // 0, ax*by-ay*bx
+
+ return vcombine_f32(retLow, vreinterpret_f32_u32(retHigh));
+}
+
+PX_FORCE_INLINE FloatV V4Length(const Vec4V a)
+{
+ const float32x4_t tmp = vmulq_f32(a, a);
+ const float32x2_t low = vget_low_f32(tmp);
+ const float32x2_t high = vget_high_f32(tmp);
+
+ const float32x2_t sumTmp = vpadd_f32(low, high); // = {0+z, x+y}
+ const float32x2_t sumWZYX = vpadd_f32(sumTmp, sumTmp); // = {x+y+z, x+y+z}
+ return FSqrt(sumWZYX);
+}
+
+PX_FORCE_INLINE FloatV V4LengthSq(const Vec4V a)
+{
+ return V4Dot(a, a);
+}
+
+PX_FORCE_INLINE Vec4V V4Normalize(const Vec4V a)
+{
+ //PX_ASSERT(!FAllEq(V4LengthSq(a), FZero()));
+ return V4ScaleInv(a, V4Length(a));
+}
+
+PX_FORCE_INLINE Vec4V V4NormalizeFast(const Vec4V a)
+{
+ //PX_ASSERT(!FAllEq(V4LengthSq(a), FZero()));
+ return V4Scale(a, FRsqrtFast(V4Dot(a, a)));
+}
+
+PX_FORCE_INLINE Vec4V V4NormalizeSafe(const Vec4V a, const Vec4V unsafeReturnValue)
+{
+ const FloatV zero = FZero();
+ const FloatV length = V4Length(a);
+ const uint32x4_t isGreaterThanZero = FIsGrtr(length, zero);
+ return V4Sel(isGreaterThanZero, V4ScaleInv(a, length), unsafeReturnValue);
+}
+
+PX_FORCE_INLINE BoolV V4IsEqU32(const VecU32V a, const VecU32V b)
+{
+ return vceqq_u32(a, b);
+}
+
+PX_FORCE_INLINE Vec4V V4Sel(const BoolV c, const Vec4V a, const Vec4V b)
+{
+ return vbslq_f32(c, a, b);
+}
+
+PX_FORCE_INLINE BoolV V4IsGrtr(const Vec4V a, const Vec4V b)
+{
+ return vcgtq_f32(a, b);
+}
+
+PX_FORCE_INLINE BoolV V4IsGrtrOrEq(const Vec4V a, const Vec4V b)
+{
+ return vcgeq_f32(a, b);
+}
+
+PX_FORCE_INLINE BoolV V4IsEq(const Vec4V a, const Vec4V b)
+{
+ return vceqq_f32(a, b);
+}
+
+PX_FORCE_INLINE Vec4V V4Max(const Vec4V a, const Vec4V b)
+{
+ return vmaxq_f32(a, b);
+}
+
+PX_FORCE_INLINE Vec4V V4Min(const Vec4V a, const Vec4V b)
+{
+ return vminq_f32(a, b);
+}
+
+PX_FORCE_INLINE FloatV V4ExtractMax(const Vec4V a)
+{
+ const float32x2_t low = vget_low_f32(a);
+ const float32x2_t high = vget_high_f32(a);
+
+ const float32x2_t max0 = vpmax_f32(high, low);
+ const float32x2_t max1 = vpmax_f32(max0, max0);
+
+ return max1;
+}
+
+PX_FORCE_INLINE FloatV V4ExtractMin(const Vec4V a)
+{
+ const float32x2_t low = vget_low_f32(a);
+ const float32x2_t high = vget_high_f32(a);
+
+ const float32x2_t min0 = vpmin_f32(high, low);
+ const float32x2_t min1 = vpmin_f32(min0, min0);
+
+ return min1;
+}
+
+PX_FORCE_INLINE Vec4V V4Clamp(const Vec4V a, const Vec4V minV, const Vec4V maxV)
+{
+ return V4Max(V4Min(a, maxV), minV);
+}
+
+PX_FORCE_INLINE PxU32 V4AllGrtr(const Vec4V a, const Vec4V b)
+{
+ return internalUnitNeonSimd::BAllTrue4_R(V4IsGrtr(a, b));
+}
+
+PX_FORCE_INLINE PxU32 V4AllGrtrOrEq(const Vec4V a, const Vec4V b)
+{
+ return internalUnitNeonSimd::BAllTrue4_R(V4IsGrtrOrEq(a, b));
+}
+
+PX_FORCE_INLINE PxU32 V4AllGrtrOrEq3(const Vec4V a, const Vec4V b)
+{
+ return internalUnitNeonSimd::BAllTrue3_R(V4IsGrtrOrEq(a, b));
+}
+
+PX_FORCE_INLINE PxU32 V4AllEq(const Vec4V a, const Vec4V b)
+{
+ return internalUnitNeonSimd::BAllTrue4_R(V4IsEq(a, b));
+}
+
+PX_FORCE_INLINE PxU32 V4AnyGrtr3(const Vec4V a, const Vec4V b)
+{
+ return internalUnitNeonSimd::BAnyTrue3_R(V4IsGrtr(a, b));
+}
+
+PX_FORCE_INLINE Vec4V V4Round(const Vec4V a)
+{
+ // truncate(a + (0.5f - sign(a)))
+ const Vec4V half = V4Load(0.5f);
+ const float32x4_t sign = vcvtq_f32_u32((vshrq_n_u32(vreinterpretq_u32_f32(a), 31)));
+ const Vec4V aPlusHalf = V4Add(a, half);
+ const Vec4V aRound = V4Sub(aPlusHalf, sign);
+ return vcvtq_f32_s32(vcvtq_s32_f32(aRound));
+}
+
+PX_FORCE_INLINE Vec4V V4Sin(const Vec4V a)
+{
+ const Vec4V recipTwoPi = V4LoadA(g_PXReciprocalTwoPi.f);
+ const Vec4V twoPi = V4LoadA(g_PXTwoPi.f);
+ const Vec4V tmp = V4Mul(a, recipTwoPi);
+ const Vec4V b = V4Round(tmp);
+ const Vec4V V1 = V4NegMulSub(twoPi, b, a);
+
+ // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! -
+ // V^15 / 15! + V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI)
+ const Vec4V V2 = V4Mul(V1, V1);
+ const Vec4V V3 = V4Mul(V2, V1);
+ const Vec4V V5 = V4Mul(V3, V2);
+ const Vec4V V7 = V4Mul(V5, V2);
+ const Vec4V V9 = V4Mul(V7, V2);
+ const Vec4V V11 = V4Mul(V9, V2);
+ const Vec4V V13 = V4Mul(V11, V2);
+ const Vec4V V15 = V4Mul(V13, V2);
+ const Vec4V V17 = V4Mul(V15, V2);
+ const Vec4V V19 = V4Mul(V17, V2);
+ const Vec4V V21 = V4Mul(V19, V2);
+ const Vec4V V23 = V4Mul(V21, V2);
+
+ const Vec4V sinCoefficients0 = V4LoadA(g_PXSinCoefficients0.f);
+ const Vec4V sinCoefficients1 = V4LoadA(g_PXSinCoefficients1.f);
+ const Vec4V sinCoefficients2 = V4LoadA(g_PXSinCoefficients2.f);
+
+ const FloatV S1 = V4GetY(sinCoefficients0);
+ const FloatV S2 = V4GetZ(sinCoefficients0);
+ const FloatV S3 = V4GetW(sinCoefficients0);
+ const FloatV S4 = V4GetX(sinCoefficients1);
+ const FloatV S5 = V4GetY(sinCoefficients1);
+ const FloatV S6 = V4GetZ(sinCoefficients1);
+ const FloatV S7 = V4GetW(sinCoefficients1);
+ const FloatV S8 = V4GetX(sinCoefficients2);
+ const FloatV S9 = V4GetY(sinCoefficients2);
+ const FloatV S10 = V4GetZ(sinCoefficients2);
+ const FloatV S11 = V4GetW(sinCoefficients2);
+
+ Vec4V Result;
+ Result = V4ScaleAdd(V3, S1, V1);
+ Result = V4ScaleAdd(V5, S2, Result);
+ Result = V4ScaleAdd(V7, S3, Result);
+ Result = V4ScaleAdd(V9, S4, Result);
+ Result = V4ScaleAdd(V11, S5, Result);
+ Result = V4ScaleAdd(V13, S6, Result);
+ Result = V4ScaleAdd(V15, S7, Result);
+ Result = V4ScaleAdd(V17, S8, Result);
+ Result = V4ScaleAdd(V19, S9, Result);
+ Result = V4ScaleAdd(V21, S10, Result);
+ Result = V4ScaleAdd(V23, S11, Result);
+
+ return Result;
+}
+
+PX_FORCE_INLINE Vec4V V4Cos(const Vec4V a)
+{
+ const Vec4V recipTwoPi = V4LoadA(g_PXReciprocalTwoPi.f);
+ const Vec4V twoPi = V4LoadA(g_PXTwoPi.f);
+ const Vec4V tmp = V4Mul(a, recipTwoPi);
+ const Vec4V b = V4Round(tmp);
+ const Vec4V V1 = V4NegMulSub(twoPi, b, a);
+
+ // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + V^12 / 12! -
+ // V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI)
+ const Vec4V V2 = V4Mul(V1, V1);
+ const Vec4V V4 = V4Mul(V2, V2);
+ const Vec4V V6 = V4Mul(V4, V2);
+ const Vec4V V8 = V4Mul(V4, V4);
+ const Vec4V V10 = V4Mul(V6, V4);
+ const Vec4V V12 = V4Mul(V6, V6);
+ const Vec4V V14 = V4Mul(V8, V6);
+ const Vec4V V16 = V4Mul(V8, V8);
+ const Vec4V V18 = V4Mul(V10, V8);
+ const Vec4V V20 = V4Mul(V10, V10);
+ const Vec4V V22 = V4Mul(V12, V10);
+
+ const Vec4V cosCoefficients0 = V4LoadA(g_PXCosCoefficients0.f);
+ const Vec4V cosCoefficients1 = V4LoadA(g_PXCosCoefficients1.f);
+ const Vec4V cosCoefficients2 = V4LoadA(g_PXCosCoefficients2.f);
+
+ const FloatV C1 = V4GetY(cosCoefficients0);
+ const FloatV C2 = V4GetZ(cosCoefficients0);
+ const FloatV C3 = V4GetW(cosCoefficients0);
+ const FloatV C4 = V4GetX(cosCoefficients1);
+ const FloatV C5 = V4GetY(cosCoefficients1);
+ const FloatV C6 = V4GetZ(cosCoefficients1);
+ const FloatV C7 = V4GetW(cosCoefficients1);
+ const FloatV C8 = V4GetX(cosCoefficients2);
+ const FloatV C9 = V4GetY(cosCoefficients2);
+ const FloatV C10 = V4GetZ(cosCoefficients2);
+ const FloatV C11 = V4GetW(cosCoefficients2);
+
+ Vec4V Result;
+ Result = V4ScaleAdd(V2, C1, V4One());
+ Result = V4ScaleAdd(V4, C2, Result);
+ Result = V4ScaleAdd(V6, C3, Result);
+ Result = V4ScaleAdd(V8, C4, Result);
+ Result = V4ScaleAdd(V10, C5, Result);
+ Result = V4ScaleAdd(V12, C6, Result);
+ Result = V4ScaleAdd(V14, C7, Result);
+ Result = V4ScaleAdd(V16, C8, Result);
+ Result = V4ScaleAdd(V18, C9, Result);
+ Result = V4ScaleAdd(V20, C10, Result);
+ Result = V4ScaleAdd(V22, C11, Result);
+
+ return Result;
+}
+
+PX_FORCE_INLINE void V4Transpose(Vec4V& col0, Vec4V& col1, Vec4V& col2, Vec4V& col3)
+{
+ const float32x4x2_t v0v1 = vzipq_f32(col0, col2);
+ const float32x4x2_t v2v3 = vzipq_f32(col1, col3);
+ const float32x4x2_t zip0 = vzipq_f32(v0v1.val[0], v2v3.val[0]);
+ const float32x4x2_t zip1 = vzipq_f32(v0v1.val[1], v2v3.val[1]);
+ col0 = zip0.val[0];
+ col1 = zip0.val[1];
+ col2 = zip1.val[0];
+ col3 = zip1.val[1];
+}
+
+//////////////////////////////////
+// VEC4V
+//////////////////////////////////
+
+PX_FORCE_INLINE BoolV BFFFF()
+{
+ return vmovq_n_u32(0);
+}
+
+PX_FORCE_INLINE BoolV BFFFT()
+{
+ const uint32x2_t zeros = vmov_n_u32(0);
+ const uint32x2_t ones = vmov_n_u32(0xffffFFFF);
+ const uint32x2_t zo = vext_u32(zeros, ones, 1);
+ return vcombine_u32(zeros, zo);
+}
+
+PX_FORCE_INLINE BoolV BFFTF()
+{
+ const uint32x2_t zeros = vmov_n_u32(0);
+ const uint32x2_t ones = vmov_n_u32(0xffffFFFF);
+ const uint32x2_t oz = vext_u32(ones, zeros, 1);
+ return vcombine_u32(zeros, oz);
+}
+
+PX_FORCE_INLINE BoolV BFFTT()
+{
+ const uint32x2_t zeros = vmov_n_u32(0);
+ const uint32x2_t ones = vmov_n_u32(0xffffFFFF);
+ return vcombine_u32(zeros, ones);
+}
+
+PX_FORCE_INLINE BoolV BFTFF()
+{
+ const uint32x2_t zeros = vmov_n_u32(0);
+ const uint32x2_t ones = vmov_n_u32(0xffffFFFF);
+ const uint32x2_t zo = vext_u32(zeros, ones, 1);
+ return vcombine_u32(zo, zeros);
+}
+
+PX_FORCE_INLINE BoolV BFTFT()
+{
+ const uint32x2_t zeros = vmov_n_u32(0);
+ const uint32x2_t ones = vmov_n_u32(0xffffFFFF);
+ const uint32x2_t zo = vext_u32(zeros, ones, 1);
+ return vcombine_u32(zo, zo);
+}
+
+PX_FORCE_INLINE BoolV BFTTF()
+{
+ const uint32x2_t zeros = vmov_n_u32(0);
+ const uint32x2_t ones = vmov_n_u32(0xffffFFFF);
+ const uint32x2_t zo = vext_u32(zeros, ones, 1);
+ const uint32x2_t oz = vext_u32(ones, zeros, 1);
+ return vcombine_u32(zo, oz);
+}
+
+PX_FORCE_INLINE BoolV BFTTT()
+{
+ const uint32x2_t zeros = vmov_n_u32(0);
+ const uint32x2_t ones = vmov_n_u32(0xffffFFFF);
+ const uint32x2_t zo = vext_u32(zeros, ones, 1);
+ return vcombine_u32(zo, ones);
+}
+
+PX_FORCE_INLINE BoolV BTFFF()
+{
+ const uint32x2_t zeros = vmov_n_u32(0);
+ const uint32x2_t ones = vmov_n_u32(0xffffFFFF);
+ // const uint32x2_t zo = vext_u32(zeros, ones, 1);
+ const uint32x2_t oz = vext_u32(ones, zeros, 1);
+ return vcombine_u32(oz, zeros);
+}
+
+PX_FORCE_INLINE BoolV BTFFT()
+{
+ const uint32x2_t zeros = vmov_n_u32(0);
+ const uint32x2_t ones = vmov_n_u32(0xffffFFFF);
+ const uint32x2_t zo = vext_u32(zeros, ones, 1);
+ const uint32x2_t oz = vext_u32(ones, zeros, 1);
+ return vcombine_u32(oz, zo);
+}
+
+PX_FORCE_INLINE BoolV BTFTF()
+{
+ const uint32x2_t zeros = vmov_n_u32(0);
+ const uint32x2_t ones = vmov_n_u32(0xffffFFFF);
+ const uint32x2_t oz = vext_u32(ones, zeros, 1);
+ return vcombine_u32(oz, oz);
+}
+
+PX_FORCE_INLINE BoolV BTFTT()
+{
+ const uint32x2_t zeros = vmov_n_u32(0);
+ const uint32x2_t ones = vmov_n_u32(0xffffFFFF);
+ const uint32x2_t oz = vext_u32(ones, zeros, 1);
+ return vcombine_u32(oz, ones);
+}
+
+PX_FORCE_INLINE BoolV BTTFF()
+{
+ const uint32x2_t zeros = vmov_n_u32(0);
+ const uint32x2_t ones = vmov_n_u32(0xffffFFFF);
+ return vcombine_u32(ones, zeros);
+}
+
+PX_FORCE_INLINE BoolV BTTFT()
+{
+ const uint32x2_t zeros = vmov_n_u32(0);
+ const uint32x2_t ones = vmov_n_u32(0xffffFFFF);
+ const uint32x2_t zo = vext_u32(zeros, ones, 1);
+ return vcombine_u32(ones, zo);
+}
+
+PX_FORCE_INLINE BoolV BTTTF()
+{
+ const uint32x2_t zeros = vmov_n_u32(0);
+ const uint32x2_t ones = vmov_n_u32(0xffffFFFF);
+ const uint32x2_t oz = vext_u32(ones, zeros, 1);
+ return vcombine_u32(ones, oz);
+}
+
+PX_FORCE_INLINE BoolV BTTTT()
+{
+ return vmovq_n_u32(0xffffFFFF);
+}
+
+PX_FORCE_INLINE BoolV BXMask()
+{
+ return BTFFF();
+}
+
+PX_FORCE_INLINE BoolV BYMask()
+{
+ return BFTFF();
+}
+
+PX_FORCE_INLINE BoolV BZMask()
+{
+ return BFFTF();
+}
+
+PX_FORCE_INLINE BoolV BWMask()
+{
+ return BFFFT();
+}
+
+PX_FORCE_INLINE BoolV BGetX(const BoolV f)
+{
+ const uint32x2_t fLow = vget_low_u32(f);
+ return vdupq_lane_u32(fLow, 0);
+}
+
+PX_FORCE_INLINE BoolV BGetY(const BoolV f)
+{
+ const uint32x2_t fLow = vget_low_u32(f);
+ return vdupq_lane_u32(fLow, 1);
+}
+
+PX_FORCE_INLINE BoolV BGetZ(const BoolV f)
+{
+ const uint32x2_t fHigh = vget_high_u32(f);
+ return vdupq_lane_u32(fHigh, 0);
+}
+
+PX_FORCE_INLINE BoolV BGetW(const BoolV f)
+{
+ const uint32x2_t fHigh = vget_high_u32(f);
+ return vdupq_lane_u32(fHigh, 1);
+}
+
+PX_FORCE_INLINE BoolV BSetX(const BoolV v, const BoolV f)
+{
+ return vbslq_u32(BFTTT(), v, f);
+}
+
+PX_FORCE_INLINE BoolV BSetY(const BoolV v, const BoolV f)
+{
+ return vbslq_u32(BTFTT(), v, f);
+}
+
+PX_FORCE_INLINE BoolV BSetZ(const BoolV v, const BoolV f)
+{
+ return vbslq_u32(BTTFT(), v, f);
+}
+
+PX_FORCE_INLINE BoolV BSetW(const BoolV v, const BoolV f)
+{
+ return vbslq_u32(BTTTF(), v, f);
+}
+
+PX_FORCE_INLINE BoolV BAnd(const BoolV a, const BoolV b)
+{
+ return vandq_u32(a, b);
+}
+
+PX_FORCE_INLINE BoolV BNot(const BoolV a)
+{
+ return vmvnq_u32(a);
+}
+
+PX_FORCE_INLINE BoolV BAndNot(const BoolV a, const BoolV b)
+{
+ // return vbicq_u32(a, b);
+ return vandq_u32(a, vmvnq_u32(b));
+}
+
+PX_FORCE_INLINE BoolV BOr(const BoolV a, const BoolV b)
+{
+ return vorrq_u32(a, b);
+}
+
+PX_FORCE_INLINE BoolV BAllTrue4(const BoolV a)
+{
+ const uint32x2_t allTrue = vmov_n_u32(0xffffFFFF);
+ const uint16x4_t dHigh = vget_high_u16(vreinterpretq_u16_u32(a));
+ const uint16x4_t dLow = vmovn_u32(a);
+ uint16x8_t combined = vcombine_u16(dLow, dHigh);
+ const uint32x2_t finalReduce = vreinterpret_u32_u8(vmovn_u16(combined));
+ const uint32x2_t result = vceq_u32(finalReduce, allTrue);
+ return vdupq_lane_u32(result, 0);
+}
+
+PX_FORCE_INLINE BoolV BAnyTrue4(const BoolV a)
+{
+ const uint32x2_t allTrue = vmov_n_u32(0xffffFFFF);
+ const uint16x4_t dHigh = vget_high_u16(vreinterpretq_u16_u32(a));
+ const uint16x4_t dLow = vmovn_u32(a);
+ uint16x8_t combined = vcombine_u16(dLow, dHigh);
+ const uint32x2_t finalReduce = vreinterpret_u32_u8(vmovn_u16(combined));
+ const uint32x2_t result = vtst_u32(finalReduce, allTrue);
+ return vdupq_lane_u32(result, 0);
+}
+
+PX_FORCE_INLINE BoolV BAllTrue3(const BoolV a)
+{
+ const uint32x2_t allTrue3 = vmov_n_u32(0x00ffFFFF);
+ const uint16x4_t dHigh = vget_high_u16(vreinterpretq_u16_u32(a));
+ const uint16x4_t dLow = vmovn_u32(a);
+ uint16x8_t combined = vcombine_u16(dLow, dHigh);
+ const uint32x2_t finalReduce = vreinterpret_u32_u8(vmovn_u16(combined));
+ const uint32x2_t result = vceq_u32(vand_u32(finalReduce, allTrue3), allTrue3);
+ return vdupq_lane_u32(result, 0);
+}
+
+PX_FORCE_INLINE BoolV BAnyTrue3(const BoolV a)
+{
+ const uint32x2_t allTrue3 = vmov_n_u32(0x00ffFFFF);
+ const uint16x4_t dHigh = vget_high_u16(vreinterpretq_u16_u32(a));
+ const uint16x4_t dLow = vmovn_u32(a);
+ uint16x8_t combined = vcombine_u16(dLow, dHigh);
+ const uint32x2_t finalReduce = vreinterpret_u32_u8(vmovn_u16(combined));
+ const uint32x2_t result = vtst_u32(vand_u32(finalReduce, allTrue3), allTrue3);
+ return vdupq_lane_u32(result, 0);
+}
+
+PX_FORCE_INLINE PxU32 BAllEq(const BoolV a, const BoolV b)
+{
+ const BoolV bTest = vceqq_u32(a, b);
+ return internalUnitNeonSimd::BAllTrue4_R(bTest);
+}
+
+PX_FORCE_INLINE PxU32 BAllEqTTTT(const BoolV a)
+{
+ return BAllEq(a, BTTTT());
+}
+
+PX_FORCE_INLINE PxU32 BAllEqFFFF(const BoolV a)
+{
+ return BAllEq(a, BFFFF());
+}
+
+PX_FORCE_INLINE PxU32 BGetBitMask(const BoolV a)
+{
+ static PX_ALIGN(16, const PxU32) bitMaskData[4] = { 1, 2, 4, 8 };
+ const uint32x4_t bitMask = *(reinterpret_cast(bitMaskData));
+ const uint32x4_t t0 = vandq_u32(a, bitMask);
+ const uint32x2_t t1 = vpadd_u32(vget_low_u32(t0), vget_high_u32(t0)); // Pairwise add (0 + 1), (2 + 3)
+ return PxU32(vget_lane_u32(vpadd_u32(t1, t1), 0));
+}
+
+//////////////////////////////////
+// MAT33V
+//////////////////////////////////
+
+PX_FORCE_INLINE Vec3V M33MulV3(const Mat33V& a, const Vec3V b)
+{
+ const FloatV x = V3GetX(b);
+ const FloatV y = V3GetY(b);
+ const FloatV z = V3GetZ(b);
+ const Vec3V v0 = V3Scale(a.col0, x);
+ const Vec3V v1 = V3Scale(a.col1, y);
+ const Vec3V v2 = V3Scale(a.col2, z);
+ const Vec3V v0PlusV1 = V3Add(v0, v1);
+ return V3Add(v0PlusV1, v2);
+}
+
+PX_FORCE_INLINE Vec3V M33TrnspsMulV3(const Mat33V& a, const Vec3V b)
+{
+ const FloatV x = V3Dot(a.col0, b);
+ const FloatV y = V3Dot(a.col1, b);
+ const FloatV z = V3Dot(a.col2, b);
+ return V3Merge(x, y, z);
+}
+
+PX_FORCE_INLINE Vec3V M33MulV3AddV3(const Mat33V& A, const Vec3V b, const Vec3V c)
+{
+ const FloatV x = V3GetX(b);
+ const FloatV y = V3GetY(b);
+ const FloatV z = V3GetZ(b);
+ Vec3V result = V3ScaleAdd(A.col0, x, c);
+ result = V3ScaleAdd(A.col1, y, result);
+ return V3ScaleAdd(A.col2, z, result);
+}
+
+PX_FORCE_INLINE Mat33V M33MulM33(const Mat33V& a, const Mat33V& b)
+{
+ return Mat33V(M33MulV3(a, b.col0), M33MulV3(a, b.col1), M33MulV3(a, b.col2));
+}
+
+PX_FORCE_INLINE Mat33V M33Add(const Mat33V& a, const Mat33V& b)
+{
+ return Mat33V(V3Add(a.col0, b.col0), V3Add(a.col1, b.col1), V3Add(a.col2, b.col2));
+}
+
+PX_FORCE_INLINE Mat33V M33Scale(const Mat33V& a, const FloatV& b)
+{
+ return Mat33V(V3Scale(a.col0, b), V3Scale(a.col1, b), V3Scale(a.col2, b));
+}
+
+PX_FORCE_INLINE Mat33V M33Inverse(const Mat33V& a)
+{
+ const float32x2_t zeros = vreinterpret_f32_u32(vmov_n_u32(0));
+ const BoolV btttf = BTTTF();
+
+ const Vec3V cross01 = V3Cross(a.col0, a.col1);
+ const Vec3V cross12 = V3Cross(a.col1, a.col2);
+ const Vec3V cross20 = V3Cross(a.col2, a.col0);
+ const FloatV dot = V3Dot(cross01, a.col2);
+ const FloatV invDet = FRecipFast(dot);
+
+ const float32x4x2_t merge = vzipq_f32(cross12, cross01);
+ const float32x4_t mergeh = merge.val[0];
+ const float32x4_t mergel = merge.val[1];
+
+ // const Vec3V colInv0 = XMVectorPermute(mergeh,cross20,PxPermuteControl(0,4,1,7));
+ const float32x4_t colInv0_xxyy = vzipq_f32(mergeh, cross20).val[0];
+ const float32x4_t colInv0 = vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(colInv0_xxyy), btttf));
+
+ // const Vec3V colInv1 = XMVectorPermute(mergeh,cross20,PxPermuteControl(2,5,3,7));
+ const float32x2_t zw0 = vget_high_f32(mergeh);
+ const float32x2_t xy1 = vget_low_f32(cross20);
+ const float32x2_t yzero1 = vext_f32(xy1, zeros, 1);
+ const float32x2x2_t merge1 = vzip_f32(zw0, yzero1);
+ const float32x4_t colInv1 = vcombine_f32(merge1.val[0], merge1.val[1]);
+
+ // const Vec3V colInv2 = XMVectorPermute(mergel,cross20,PxPermuteControl(0,6,1,7));
+ const float32x2_t x0y0 = vget_low_f32(mergel);
+ const float32x2_t z1w1 = vget_high_f32(cross20);
+ const float32x2x2_t merge2 = vzip_f32(x0y0, z1w1);
+ const float32x4_t colInv2 = vcombine_f32(merge2.val[0], merge2.val[1]);
+
+ return Mat33V(vmulq_lane_f32(colInv0, invDet, 0), vmulq_lane_f32(colInv1, invDet, 0),
+ vmulq_lane_f32(colInv2, invDet, 0));
+}
+
+PX_FORCE_INLINE Mat33V M33Trnsps(const Mat33V& a)
+{
+ return Mat33V(V3Merge(V3GetX(a.col0), V3GetX(a.col1), V3GetX(a.col2)),
+ V3Merge(V3GetY(a.col0), V3GetY(a.col1), V3GetY(a.col2)),
+ V3Merge(V3GetZ(a.col0), V3GetZ(a.col1), V3GetZ(a.col2)));
+}
+
+PX_FORCE_INLINE Mat33V M33Identity()
+{
+ return Mat33V(V3UnitX(), V3UnitY(), V3UnitZ());
+}
+
+PX_FORCE_INLINE Mat33V M33Sub(const Mat33V& a, const Mat33V& b)
+{
+ return Mat33V(V3Sub(a.col0, b.col0), V3Sub(a.col1, b.col1), V3Sub(a.col2, b.col2));
+}
+
+PX_FORCE_INLINE Mat33V M33Neg(const Mat33V& a)
+{
+ return Mat33V(V3Neg(a.col0), V3Neg(a.col1), V3Neg(a.col2));
+}
+
+PX_FORCE_INLINE Mat33V M33Abs(const Mat33V& a)
+{
+ return Mat33V(V3Abs(a.col0), V3Abs(a.col1), V3Abs(a.col2));
+}
+
+PX_FORCE_INLINE Mat33V PromoteVec3V(const Vec3V v)
+{
+ const BoolV bTFFF = BTFFF();
+ const BoolV bFTFF = BFTFF();
+ const BoolV bFFTF = BTFTF();
+
+ const Vec3V zero = V3Zero();
+
+ return Mat33V(V3Sel(bTFFF, v, zero), V3Sel(bFTFF, v, zero), V3Sel(bFFTF, v, zero));
+}
+
+PX_FORCE_INLINE Mat33V M33Diagonal(const Vec3VArg d)
+{
+ const Vec3V x = V3Mul(V3UnitX(), d);
+ const Vec3V y = V3Mul(V3UnitY(), d);
+ const Vec3V z = V3Mul(V3UnitZ(), d);
+ return Mat33V(x, y, z);
+}
+
+//////////////////////////////////
+// MAT34V
+//////////////////////////////////
+
+PX_FORCE_INLINE Vec3V M34MulV3(const Mat34V& a, const Vec3V b)
+{
+ const FloatV x = V3GetX(b);
+ const FloatV y = V3GetY(b);
+ const FloatV z = V3GetZ(b);
+ const Vec3V v0 = V3Scale(a.col0, x);
+ const Vec3V v1 = V3Scale(a.col1, y);
+ const Vec3V v2 = V3Scale(a.col2, z);
+ const Vec3V v0PlusV1 = V3Add(v0, v1);
+ const Vec3V v0PlusV1Plusv2 = V3Add(v0PlusV1, v2);
+ return V3Add(v0PlusV1Plusv2, a.col3);
+}
+
+PX_FORCE_INLINE Vec3V M34Mul33V3(const Mat34V& a, const Vec3V b)
+{
+ const FloatV x = V3GetX(b);
+ const FloatV y = V3GetY(b);
+ const FloatV z = V3GetZ(b);
+ const Vec3V v0 = V3Scale(a.col0, x);
+ const Vec3V v1 = V3Scale(a.col1, y);
+ const Vec3V v2 = V3Scale(a.col2, z);
+ const Vec3V v0PlusV1 = V3Add(v0, v1);
+ return V3Add(v0PlusV1, v2);
+}
+
+PX_FORCE_INLINE Vec3V M34TrnspsMul33V3(const Mat34V& a, const Vec3V b)
+{
+ const FloatV x = V3Dot(a.col0, b);
+ const FloatV y = V3Dot(a.col1, b);
+ const FloatV z = V3Dot(a.col2, b);
+ return V3Merge(x, y, z);
+}
+
+PX_FORCE_INLINE Mat34V M34MulM34(const Mat34V& a, const Mat34V& b)
+{
+ return Mat34V(M34Mul33V3(a, b.col0), M34Mul33V3(a, b.col1), M34Mul33V3(a, b.col2), M34MulV3(a, b.col3));
+}
+
+PX_FORCE_INLINE Mat33V M34MulM33(const Mat34V& a, const Mat33V& b)
+{
+ return Mat33V(M34Mul33V3(a, b.col0), M34Mul33V3(a, b.col1), M34Mul33V3(a, b.col2));
+}
+
+PX_FORCE_INLINE Mat33V M34Mul33MM34(const Mat34V& a, const Mat34V& b)
+{
+ return Mat33V(M34Mul33V3(a, b.col0), M34Mul33V3(a, b.col1), M34Mul33V3(a, b.col2));
+}
+
+PX_FORCE_INLINE Mat34V M34Add(const Mat34V& a, const Mat34V& b)
+{
+ return Mat34V(V3Add(a.col0, b.col0), V3Add(a.col1, b.col1), V3Add(a.col2, b.col2), V3Add(a.col3, b.col3));
+}
+
+PX_FORCE_INLINE Mat33V M34Trnsps33(const Mat34V& a)
+{
+ return Mat33V(V3Merge(V3GetX(a.col0), V3GetX(a.col1), V3GetX(a.col2)),
+ V3Merge(V3GetY(a.col0), V3GetY(a.col1), V3GetY(a.col2)),
+ V3Merge(V3GetZ(a.col0), V3GetZ(a.col1), V3GetZ(a.col2)));
+}
+
+//////////////////////////////////
+// MAT44V
+//////////////////////////////////
+
+PX_FORCE_INLINE Vec4V M44MulV4(const Mat44V& a, const Vec4V b)
+{
+ const FloatV x = V4GetX(b);
+ const FloatV y = V4GetY(b);
+ const FloatV z = V4GetZ(b);
+ const FloatV w = V4GetW(b);
+
+ const Vec4V v0 = V4Scale(a.col0, x);
+ const Vec4V v1 = V4Scale(a.col1, y);
+ const Vec4V v2 = V4Scale(a.col2, z);
+ const Vec4V v3 = V4Scale(a.col3, w);
+ const Vec4V v0PlusV1 = V4Add(v0, v1);
+ const Vec4V v0PlusV1Plusv2 = V4Add(v0PlusV1, v2);
+ return V4Add(v0PlusV1Plusv2, v3);
+}
+
+PX_FORCE_INLINE Vec4V M44TrnspsMulV4(const Mat44V& a, const Vec4V b)
+{
+ return V4Merge(V4Dot(a.col0, b), V4Dot(a.col1, b), V4Dot(a.col2, b), V4Dot(a.col3, b));
+}
+
+PX_FORCE_INLINE Mat44V M44MulM44(const Mat44V& a, const Mat44V& b)
+{
+ return Mat44V(M44MulV4(a, b.col0), M44MulV4(a, b.col1), M44MulV4(a, b.col2), M44MulV4(a, b.col3));
+}
+
+PX_FORCE_INLINE Mat44V M44Add(const Mat44V& a, const Mat44V& b)
+{
+ return Mat44V(V4Add(a.col0, b.col0), V4Add(a.col1, b.col1), V4Add(a.col2, b.col2), V4Add(a.col3, b.col3));
+}
+
+PX_FORCE_INLINE Mat44V M44Trnsps(const Mat44V& a)
+{
+ // asm volatile(
+ // "vzip.f32 %q0, %q2 \n\t"
+ // "vzip.f32 %q1, %q3 \n\t"
+ // "vzip.f32 %q0, %q1 \n\t"
+ // "vzip.f32 %q2, %q3 \n\t"
+ // : "+w" (a.col0), "+w" (a.col1), "+w" (a.col2), "+w" a.col3));
+
+ const float32x4x2_t v0v1 = vzipq_f32(a.col0, a.col2);
+ const float32x4x2_t v2v3 = vzipq_f32(a.col1, a.col3);
+ const float32x4x2_t zip0 = vzipq_f32(v0v1.val[0], v2v3.val[0]);
+ const float32x4x2_t zip1 = vzipq_f32(v0v1.val[1], v2v3.val[1]);
+
+ return Mat44V(zip0.val[0], zip0.val[1], zip1.val[0], zip1.val[1]);
+}
+
+PX_FORCE_INLINE Mat44V M44Inverse(const Mat44V& a)
+{
+ float32x4_t minor0, minor1, minor2, minor3;
+ float32x4_t row0, row1, row2, row3;
+ float32x4_t det, tmp1;
+
+ tmp1 = vmovq_n_f32(0.0f);
+ row1 = vmovq_n_f32(0.0f);
+ row3 = vmovq_n_f32(0.0f);
+
+ row0 = a.col0;
+ row1 = vextq_f32(a.col1, a.col1, 2);
+ row2 = a.col2;
+ row3 = vextq_f32(a.col3, a.col3, 2);
+
+ tmp1 = vmulq_f32(row2, row3);
+ tmp1 = vrev64q_f32(tmp1);
+ minor0 = vmulq_f32(row1, tmp1);
+ minor1 = vmulq_f32(row0, tmp1);
+ tmp1 = vextq_f32(tmp1, tmp1, 2);
+ minor0 = vsubq_f32(vmulq_f32(row1, tmp1), minor0);
+ minor1 = vsubq_f32(vmulq_f32(row0, tmp1), minor1);
+ minor1 = vextq_f32(minor1, minor1, 2);
+
+ tmp1 = vmulq_f32(row1, row2);
+ tmp1 = vrev64q_f32(tmp1);
+ minor0 = vaddq_f32(vmulq_f32(row3, tmp1), minor0);
+ minor3 = vmulq_f32(row0, tmp1);
+ tmp1 = vextq_f32(tmp1, tmp1, 2);
+ minor0 = vsubq_f32(minor0, vmulq_f32(row3, tmp1));
+ minor3 = vsubq_f32(vmulq_f32(row0, tmp1), minor3);
+ minor3 = vextq_f32(minor3, minor3, 2);
+
+ tmp1 = vmulq_f32(vextq_f32(row1, row1, 2), row3);
+ tmp1 = vrev64q_f32(tmp1);
+ row2 = vextq_f32(row2, row2, 2);
+ minor0 = vaddq_f32(vmulq_f32(row2, tmp1), minor0);
+ minor2 = vmulq_f32(row0, tmp1);
+ tmp1 = vextq_f32(tmp1, tmp1, 2);
+ minor0 = vsubq_f32(minor0, vmulq_f32(row2, tmp1));
+ minor2 = vsubq_f32(vmulq_f32(row0, tmp1), minor2);
+ minor2 = vextq_f32(minor2, minor2, 2);
+
+ tmp1 = vmulq_f32(row0, row1);
+ tmp1 = vrev64q_f32(tmp1);
+ minor2 = vaddq_f32(vmulq_f32(row3, tmp1), minor2);
+ minor3 = vsubq_f32(vmulq_f32(row2, tmp1), minor3);
+ tmp1 = vextq_f32(tmp1, tmp1, 2);
+ minor2 = vsubq_f32(vmulq_f32(row3, tmp1), minor2);
+ minor3 = vsubq_f32(minor3, vmulq_f32(row2, tmp1));
+
+ tmp1 = vmulq_f32(row0, row3);
+ tmp1 = vrev64q_f32(tmp1);
+ minor1 = vsubq_f32(minor1, vmulq_f32(row2, tmp1));
+ minor2 = vaddq_f32(vmulq_f32(row1, tmp1), minor2);
+ tmp1 = vextq_f32(tmp1, tmp1, 2);
+ minor1 = vaddq_f32(vmulq_f32(row2, tmp1), minor1);
+ minor2 = vsubq_f32(minor2, vmulq_f32(row1, tmp1));
+
+ tmp1 = vmulq_f32(row0, row2);
+ tmp1 = vrev64q_f32(tmp1);
+ minor1 = vaddq_f32(vmulq_f32(row3, tmp1), minor1);
+ minor3 = vsubq_f32(minor3, vmulq_f32(row1, tmp1));
+ tmp1 = vextq_f32(tmp1, tmp1, 2);
+ minor1 = vsubq_f32(minor1, vmulq_f32(row3, tmp1));
+ minor3 = vaddq_f32(vmulq_f32(row1, tmp1), minor3);
+
+ det = vmulq_f32(row0, minor0);
+ det = vaddq_f32(vextq_f32(det, det, 2), det);
+ det = vaddq_f32(vrev64q_f32(det), det);
+ det = vdupq_lane_f32(VRECIPE(vget_low_f32(det)), 0);
+
+ minor0 = vmulq_f32(det, minor0);
+ minor1 = vmulq_f32(det, minor1);
+ minor2 = vmulq_f32(det, minor2);
+ minor3 = vmulq_f32(det, minor3);
+ Mat44V invTrans(minor0, minor1, minor2, minor3);
+ return M44Trnsps(invTrans);
+}
+
+PX_FORCE_INLINE Vec4V V4LoadXYZW(const PxF32& x, const PxF32& y, const PxF32& z, const PxF32& w)
+{
+ const float f4[4] = { x, y, z, w };
+ const float32x4_t ret = vld1q_f32(f4);
+ return ret;
+}
+
+/*
+PX_FORCE_INLINE VecU16V V4U32PK(VecU32V a, VecU32V b)
+{
+ return vcombine_u16(vqmovn_u32(a), vqmovn_u32(b));
+}
+*/
+
+PX_FORCE_INLINE VecU32V V4U32Sel(const BoolV c, const VecU32V a, const VecU32V b)
+{
+ return vbslq_u32(c, a, b);
+}
+
+PX_FORCE_INLINE VecU32V V4U32or(VecU32V a, VecU32V b)
+{
+ return vorrq_u32(a, b);
+}
+
+PX_FORCE_INLINE VecU32V V4U32xor(VecU32V a, VecU32V b)
+{
+ return veorq_u32(a, b);
+}
+
+PX_FORCE_INLINE VecU32V V4U32and(VecU32V a, VecU32V b)
+{
+ return vandq_u32(a, b);
+}
+
+PX_FORCE_INLINE VecU32V V4U32Andc(VecU32V a, VecU32V b)
+{
+ // return vbicq_u32(a, b); // creates gcc compiler bug in RTreeQueries.cpp
+ return vandq_u32(a, vmvnq_u32(b));
+}
+
+/*
+PX_FORCE_INLINE VecU16V V4U16Or(VecU16V a, VecU16V b)
+{
+ return vorrq_u16(a, b);
+}
+*/
+
+/*
+PX_FORCE_INLINE VecU16V V4U16And(VecU16V a, VecU16V b)
+{
+ return vandq_u16(a, b);
+}
+*/
+/*
+PX_FORCE_INLINE VecU16V V4U16Andc(VecU16V a, VecU16V b)
+{
+ return vbicq_u16(a, b);
+}
+*/
+
+PX_FORCE_INLINE VecI32V I4LoadXYZW(const PxI32& x, const PxI32& y, const PxI32& z, const PxI32& w)
+{
+ const int32_t i4[4] = { x, y, z, w };
+ const int32x4_t ret = vld1q_s32(i4);
+ return ret;
+}
+
+PX_FORCE_INLINE VecI32V I4Load(const PxI32 i)
+{
+ return vdupq_n_s32(i);
+}
+
+PX_FORCE_INLINE VecI32V I4LoadU(const PxI32* i)
+{
+ return vld1q_s32(i);
+}
+
+PX_FORCE_INLINE VecI32V I4LoadA(const PxI32* i)
+{
+ return vld1q_s32(i);
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_Add(const VecI32VArg a, const VecI32VArg b)
+{
+ return vaddq_s32(a, b);
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_Sub(const VecI32VArg a, const VecI32VArg b)
+{
+ return vsubq_s32(a, b);
+}
+
+PX_FORCE_INLINE BoolV VecI32V_IsGrtr(const VecI32VArg a, const VecI32VArg b)
+{
+ return vcgtq_s32(a, b);
+}
+
+PX_FORCE_INLINE BoolV VecI32V_IsEq(const VecI32VArg a, const VecI32VArg b)
+{
+ return vceqq_s32(a, b);
+}
+
+PX_FORCE_INLINE VecI32V V4I32Sel(const BoolV c, const VecI32V a, const VecI32V b)
+{
+ return vbslq_s32(c, a, b);
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_Zero()
+{
+ return vdupq_n_s32(0);
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_One()
+{
+ return vdupq_n_s32(1);
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_Two()
+{
+ return vdupq_n_s32(2);
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_MinusOne()
+{
+ return vdupq_n_s32(-1);
+}
+
+PX_FORCE_INLINE VecU32V U4Zero()
+{
+ return U4Load(0);
+}
+
+PX_FORCE_INLINE VecU32V U4One()
+{
+ return U4Load(1);
+}
+
+PX_FORCE_INLINE VecU32V U4Two()
+{
+ return U4Load(2);
+}
+
+PX_FORCE_INLINE VecShiftV VecI32V_PrepareShift(const VecI32VArg shift)
+{
+ return shift;
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_LeftShift(const VecI32VArg a, const VecShiftVArg count)
+{
+ return vshlq_s32(a, count);
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_RightShift(const VecI32VArg a, const VecShiftVArg count)
+{
+ return vshlq_s32(a, VecI32V_Sub(I4Load(0), count));
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_LeftShift(const VecI32VArg a, const PxU32 count)
+{
+ const PxI32 i = (PxI32)count;
+ const int32x4_t shiftCount = vld1q_dup_s32(&i);
+ return vshlq_s32(a, shiftCount);
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_RightShift(const VecI32VArg a, const PxU32 count)
+{
+ const PxI32 i = -(PxI32)count;
+ const int32x4_t shiftCount = vld1q_dup_s32(&i);
+ return vshlq_s32(a, shiftCount);
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_And(const VecI32VArg a, const VecI32VArg b)
+{
+ return vandq_s32(a, b);
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_Or(const VecI32VArg a, const VecI32VArg b)
+{
+ return vorrq_s32(a, b);
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_GetX(const VecI32VArg f)
+{
+ const int32x2_t fLow = vget_low_s32(f);
+ return vdupq_lane_s32(fLow, 0);
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_GetY(const VecI32VArg f)
+{
+ const int32x2_t fLow = vget_low_s32(f);
+ return vdupq_lane_s32(fLow, 1);
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_GetZ(const VecI32VArg f)
+{
+ const int32x2_t fHigh = vget_high_s32(f);
+ return vdupq_lane_s32(fHigh, 0);
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_GetW(const VecI32VArg f)
+{
+ const int32x2_t fHigh = vget_high_s32(f);
+ return vdupq_lane_s32(fHigh, 1);
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_Sel(const BoolV c, const VecI32VArg a, const VecI32VArg b)
+{
+ return vbslq_s32(c, a, b);
+}
+
+PX_FORCE_INLINE void PxI32_From_VecI32V(const VecI32VArg a, PxI32* i)
+{
+ *i = vgetq_lane_s32(a, 0);
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_Merge(const VecI32VArg a, const VecI32VArg b, const VecI32VArg c, const VecI32VArg d)
+{
+ const int32x2_t aLow = vget_low_s32(a);
+ const int32x2_t bLow = vget_low_s32(b);
+ const int32x2_t cLow = vget_low_s32(c);
+ const int32x2_t dLow = vget_low_s32(d);
+
+ const int32x2_t low = vext_s32(aLow, bLow, 1);
+ const int32x2_t high = vext_s32(cLow, dLow, 1);
+
+ return vcombine_s32(low, high);
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_From_BoolV(const BoolVArg a)
+{
+ return vreinterpretq_s32_u32(a);
+}
+
+PX_FORCE_INLINE VecU32V VecU32V_From_BoolV(const BoolVArg a)
+{
+ return a;
+}
+
+/*
+template PX_FORCE_INLINE VecI32V V4ISplat()
+{
+ return vdupq_n_s32(a);
+}
+
+template PX_FORCE_INLINE VecU32V V4USplat()
+{
+ return vdupq_n_u32(a);
+}
+*/
+
+/*
+PX_FORCE_INLINE void V4U16StoreAligned(VecU16V val, VecU16V* address)
+{
+ vst1q_u16((uint16_t*)address, val);
+}
+*/
+
+PX_FORCE_INLINE void V4U32StoreAligned(VecU32V val, VecU32V* address)
+{
+ vst1q_u32(reinterpret_cast(address), val);
+}
+
+PX_FORCE_INLINE Vec4V V4LoadAligned(Vec4V* addr)
+{
+ return vld1q_f32(reinterpret_cast(addr));
+}
+
+PX_FORCE_INLINE Vec4V V4LoadUnaligned(Vec4V* addr)
+{
+ return vld1q_f32(reinterpret_cast(addr));
+}
+
+PX_FORCE_INLINE Vec4V V4Andc(const Vec4V a, const VecU32V b)
+{
+ return vreinterpretq_f32_u32(V4U32Andc(vreinterpretq_u32_f32(a), b));
+}
+
+PX_FORCE_INLINE VecU32V V4IsGrtrV32u(const Vec4V a, const Vec4V b)
+{
+ return V4IsGrtr(a, b);
+}
+
+PX_FORCE_INLINE VecU16V V4U16LoadAligned(VecU16V* addr)
+{
+ return vld1q_u16(reinterpret_cast(addr));
+}
+
+PX_FORCE_INLINE VecU16V V4U16LoadUnaligned(VecU16V* addr)
+{
+ return vld1q_u16(reinterpret_cast(addr));
+}
+
+PX_FORCE_INLINE VecU16V V4U16CompareGt(VecU16V a, VecU16V b)
+{
+ return vcgtq_u16(a, b);
+}
+
+PX_FORCE_INLINE VecU16V V4I16CompareGt(VecI16V a, VecI16V b)
+{
+ return vcgtq_s16(a, b);
+}
+
+PX_FORCE_INLINE Vec4V Vec4V_From_VecU32V(VecU32V a)
+{
+ return vcvtq_f32_u32(a);
+}
+
+PX_FORCE_INLINE Vec4V Vec4V_From_VecI32V(VecI32V a)
+{
+ return vcvtq_f32_s32(a);
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_From_Vec4V(Vec4V a)
+{
+ return vcvtq_s32_f32(a);
+}
+
+PX_FORCE_INLINE Vec4V Vec4V_ReinterpretFrom_VecU32V(VecU32V a)
+{
+ return vreinterpretq_f32_u32(a);
+}
+
+PX_FORCE_INLINE Vec4V Vec4V_ReinterpretFrom_VecI32V(VecI32V a)
+{
+ return vreinterpretq_f32_s32(a);
+}
+
+PX_FORCE_INLINE VecU32V VecU32V_ReinterpretFrom_Vec4V(Vec4V a)
+{
+ return vreinterpretq_u32_f32(a);
+}
+
+PX_FORCE_INLINE VecI32V VecI32V_ReinterpretFrom_Vec4V(Vec4V a)
+{
+ return vreinterpretq_s32_f32(a);
+}
+
+#if !PX_SWITCH
+template
+PX_FORCE_INLINE BoolV BSplatElement(BoolV a)
+{
+ if(index < 2)
+ {
+ return vdupq_lane_u32(vget_low_u32(a), index);
+ }
+ else if(index == 2)
+ {
+ return vdupq_lane_u32(vget_high_u32(a), 0);
+ }
+ else if(index == 3)
+ {
+ return vdupq_lane_u32(vget_high_u32(a), 1);
+ }
+}
+#else
+//workaround for template compile issue
+template PX_FORCE_INLINE BoolV BSplatElement(BoolV a);
+template<> PX_FORCE_INLINE BoolV BSplatElement<0>(BoolV a) { return vdupq_lane_u32(vget_low_u32(a), 0); }
+template<> PX_FORCE_INLINE BoolV BSplatElement<1>(BoolV a) { return vdupq_lane_u32(vget_low_u32(a), 1); }
+template<> PX_FORCE_INLINE BoolV BSplatElement<2>(BoolV a) { return vdupq_lane_u32(vget_high_u32(a), 0); }
+template<> PX_FORCE_INLINE BoolV BSplatElement<3>(BoolV a) { return vdupq_lane_u32(vget_high_u32(a), 1); }
+#endif
+
+#if !PX_SWITCH
+template
+PX_FORCE_INLINE VecU32V V4U32SplatElement(VecU32V a)
+{
+ if(index < 2)
+ {
+ return vdupq_lane_u32(vget_low_u32(a), index);
+ }
+ else if(index == 2)
+ {
+ return vdupq_lane_u32(vget_high_u32(a), 0);
+ }
+ else if(index == 3)
+ {
+ return vdupq_lane_u32(vget_high_u32(a), 1);
+ }
+}
+#else
+//workaround for template compile issue
+template PX_FORCE_INLINE VecU32V V4U32SplatElement(VecU32V a);
+template <> PX_FORCE_INLINE VecU32V V4U32SplatElement<0>(VecU32V a) { return vdupq_lane_u32(vget_low_u32(a), 0); }
+template <> PX_FORCE_INLINE VecU32V V4U32SplatElement<1>(VecU32V a) { return vdupq_lane_u32(vget_low_u32(a), 1); }
+template <> PX_FORCE_INLINE VecU32V V4U32SplatElement<2>(VecU32V a) { return vdupq_lane_u32(vget_high_u32(a), 0); }
+template <> PX_FORCE_INLINE VecU32V V4U32SplatElement<3>(VecU32V a) { return vdupq_lane_u32(vget_high_u32(a), 1); }
+#endif
+
+#if !PX_SWITCH
+template
+PX_FORCE_INLINE Vec4V V4SplatElement(Vec4V a)
+{
+ if(index == 0)
+ {
+ return vdupq_lane_f32(vget_low_f32(a), 0);
+ }
+ else if (index == 1)
+ {
+ return vdupq_lane_f32(vget_low_f32(a), 1);
+ }
+ else if(index == 2)
+ {
+ return vdupq_lane_f32(vget_high_f32(a), 0);
+ }
+ else if(index == 3)
+ {
+ return vdupq_lane_f32(vget_high_f32(a), 1);
+ }
+}
+#else
+//workaround for template compile issue
+template PX_FORCE_INLINE Vec4V V4SplatElement(Vec4V a);
+template <> PX_FORCE_INLINE Vec4V V4SplatElement<0>(Vec4V a) { return vdupq_lane_f32(vget_low_f32(a), 0); }
+template <> PX_FORCE_INLINE Vec4V V4SplatElement<1>(Vec4V a) { return vdupq_lane_f32(vget_low_f32(a), 1); }
+template <> PX_FORCE_INLINE Vec4V V4SplatElement<2>(Vec4V a) { return vdupq_lane_f32(vget_high_f32(a), 0); }
+template <> PX_FORCE_INLINE Vec4V V4SplatElement<3>(Vec4V a) { return vdupq_lane_f32(vget_high_f32(a), 1); }
+#endif
+
+PX_FORCE_INLINE VecU32V U4LoadXYZW(PxU32 x, PxU32 y, PxU32 z, PxU32 w)
+{
+ const uint32_t u4[4] = { x, y, z, w };
+ const uint32x4_t ret = vld1q_u32(u4);
+ return ret;
+}
+
+PX_FORCE_INLINE VecU32V U4Load(const PxU32 i)
+{
+ return vdupq_n_u32(i);
+}
+
+PX_FORCE_INLINE VecU32V U4LoadU(const PxU32* i)
+{
+ return vld1q_u32(i);
+}
+
+PX_FORCE_INLINE VecU32V U4LoadA(const PxU32* i)
+{
+ return vld1q_u32(i);
+}
+
+PX_FORCE_INLINE Vec4V V4Ceil(const Vec4V in)
+{
+ const float32x4_t ones = vdupq_n_f32(1.0f);
+ const float32x4_t rdToZero = vcvtq_f32_s32(vcvtq_s32_f32(in));
+ const float32x4_t rdToZeroPlusOne = vaddq_f32(rdToZero, ones);
+ const uint32x4_t gt = vcgtq_f32(in, rdToZero);
+ return vbslq_f32(gt, rdToZeroPlusOne, rdToZero);
+}
+
+PX_FORCE_INLINE Vec4V V4Floor(const Vec4V in)
+{
+ const float32x4_t ones = vdupq_n_f32(1.0f);
+ const float32x4_t rdToZero = vcvtq_f32_s32(vcvtq_s32_f32(in));
+ const float32x4_t rdToZeroMinusOne = vsubq_f32(rdToZero, ones);
+ const uint32x4_t lt = vcltq_f32(in, rdToZero);
+ return vbslq_f32(lt, rdToZeroMinusOne, rdToZero);
+}
+
+PX_FORCE_INLINE VecU32V V4ConvertToU32VSaturate(const Vec4V in, PxU32 power)
+{
+ PX_ASSERT(power == 0 && "Non-zero power not supported in convertToU32VSaturate");
+ PX_UNUSED(power); // prevent warning in release builds
+
+ return vcvtq_u32_f32(in);
+}
+
+PX_FORCE_INLINE void QuatGetMat33V(const QuatVArg q, Vec3V& column0, Vec3V& column1, Vec3V& column2)
+{
+ const FloatV one = FOne();
+ const FloatV x = V4GetX(q);
+ const FloatV y = V4GetY(q);
+ const FloatV z = V4GetZ(q);
+ const FloatV w = V4GetW(q);
+
+ const FloatV x2 = FAdd(x, x);
+ const FloatV y2 = FAdd(y, y);
+ const FloatV z2 = FAdd(z, z);
+
+ const FloatV xx = FMul(x2, x);
+ const FloatV yy = FMul(y2, y);
+ const FloatV zz = FMul(z2, z);
+
+ const FloatV xy = FMul(x2, y);
+ const FloatV xz = FMul(x2, z);
+ const FloatV xw = FMul(x2, w);
+
+ const FloatV yz = FMul(y2, z);
+ const FloatV yw = FMul(y2, w);
+ const FloatV zw = FMul(z2, w);
+
+ const FloatV v = FSub(one, xx);
+
+ column0 = V3Merge(FSub(FSub(one, yy), zz), FAdd(xy, zw), FSub(xz, yw));
+ column1 = V3Merge(FSub(xy, zw), FSub(v, zz), FAdd(yz, xw));
+ column2 = V3Merge(FAdd(xz, yw), FSub(yz, xw), FSub(v, yy));
+}
+
+} // namespace aos
+} // namespace physx
+
+#endif // PXFOUNDATION_PXWINDOWSNEONINLINEAOS_H
diff --git a/Source/ThirdParty/PhysX/geomutils/PxContactPoint.h b/Source/ThirdParty/PhysX/geomutils/PxContactPoint.h
index 9630bf255..cdd884e21 100644
--- a/Source/ThirdParty/PhysX/geomutils/PxContactPoint.h
+++ b/Source/ThirdParty/PhysX/geomutils/PxContactPoint.h
@@ -31,6 +31,11 @@
#include "foundation/PxVec3.h"
+#if PX_VC
+#pragma warning(push)
+#pragma warning(disable : 4324) // structure was padded due to alignment specifier
+#endif
+
#if !PX_DOXYGEN
namespace physx
{
@@ -97,4 +102,8 @@ namespace physx
} // namespace physx
#endif
+#if PX_VC
+#pragma warning(pop)
+#endif
+
#endif
diff --git a/Source/ThirdParty/UVAtlas/LICENSE b/Source/ThirdParty/UVAtlas/LICENSE
index e8e78a94f..9e841e7a2 100644
--- a/Source/ThirdParty/UVAtlas/LICENSE
+++ b/Source/ThirdParty/UVAtlas/LICENSE
@@ -1,21 +1,21 @@
- The MIT License (MIT)
+ MIT License
-Copyright (c) 2014-2019 Microsoft Corp
+ Copyright (c) Microsoft Corporation.
-Permission is hereby granted, free of charge, to any person obtaining a copy of this
-software and associated documentation files (the "Software"), to deal in the Software
-without restriction, including without limitation the rights to use, copy, modify,
-merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to the following
-conditions:
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
-The above copyright notice and this permission notice shall be included in all copies
-or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/Source/ThirdParty/UVAtlas/UVAtlas.h b/Source/ThirdParty/UVAtlas/UVAtlas.h
index edd84f54c..41b53bf41 100644
--- a/Source/ThirdParty/UVAtlas/UVAtlas.h
+++ b/Source/ThirdParty/UVAtlas/UVAtlas.h
@@ -1,7 +1,7 @@
//-------------------------------------------------------------------------------------
// UVAtlas
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/?LinkID=512686
@@ -9,21 +9,41 @@
#pragma once
-#include
-
-#if defined(_XBOX_ONE) && defined(_TITLE)
-#include
+#ifdef _WIN32
+#ifdef _GAMING_XBOX_SCARLETT
+#pragma warning(push)
+#pragma warning(disable: 5204 5249)
+#include
+#pragma warning(pop)
+#elif defined(_GAMING_XBOX)
+#pragma warning(push)
+#pragma warning(disable: 5204)
+#include
+#pragma warning(pop)
+#elif defined(_XBOX_ONE) && defined(_TITLE)
+#error This library no longer supports legacy Xbox One XDK
+#else
+#include
+#ifdef USING_DIRECTX_HEADERS
+#include
#else
-#include
#include
#endif
+#endif
+#else // !WIN32
+#include
+#include
+#endif
-#include
-
+#include
+#include
#include
#include
-#define UVATLAS_VERSION 160
+#include
+
+#define UVATLAS_VERSION 187
+
namespace DirectX
{
@@ -37,28 +57,28 @@ namespace DirectX
// UVATLAS_IMT_WRAP_U means the texture wraps in the U direction
// UVATLAS_IMT_WRAP_V means the texture wraps in the V direction
// UVATLAS_IMT_WRAP_UV means the texture wraps in both directions
- enum UVATLAS_IMT
+ enum UVATLAS_IMT : unsigned int
{
UVATLAS_IMT_DEFAULT = 0x00,
UVATLAS_IMT_WRAP_U = 0x01,
UVATLAS_IMT_WRAP_V = 0x02,
UVATLAS_IMT_WRAP_UV = 0x03,
- UVATLAS_IMT_VALIDBITS = 0x03,
};
// These options are only valid for UVAtlasCreate and UVAtlasPartition
// UVATLAS_DEFAULT - Meshes with more than 25k faces go through fast, meshes with fewer than 25k faces go through quality
// UVATLAS_GEODESIC_FAST - Uses approximations to improve charting speed at the cost of added stretch or more charts.
// UVATLAS_GEODESIC_QUALITY - Provides better quality charts, but requires more time and memory than fast.
- enum UVATLAS
+ enum UVATLAS : unsigned int
{
UVATLAS_DEFAULT = 0x00,
UVATLAS_GEODESIC_FAST = 0x01,
UVATLAS_GEODESIC_QUALITY = 0x02,
- UVATLAS_PARTITIONVALIDBITS = 0x03,
+ UVATLAS_LIMIT_MERGE_STRETCH = 0x04,
+ UVATLAS_LIMIT_FACE_STRETCH = 0x08,
};
- static const float UVATLAS_DEFAULT_CALLBACK_FREQUENCY = 0.0001f;
+ constexpr float UVATLAS_DEFAULT_CALLBACK_FREQUENCY = 0.0001f;
//============================================================================
//
@@ -94,7 +114,7 @@ namespace DirectX
// integrated metric tensor for that face. This lets you control
// the way this triangle may be stretched in the atlas. The IMT
// passed in will be 3 floats (a,b,c) and specify a symmetric
- // matrix (a b) that, given a vector (s,t), specifies the
+ // matrix (a b) that, given a vector (s,t), specifies the
// (b c)
// distance between a vector v1 and a vector v2 = v1 + (s,t) as
// sqrt((s, t) * M * (s, t)^T).
@@ -129,8 +149,8 @@ namespace DirectX
HRESULT __cdecl UVAtlasCreate(
_In_reads_(nVerts) const XMFLOAT3* positions,
_In_ size_t nVerts,
- _When_(indexFormat == DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces*sizeof(uint16_t)))
- _When_(indexFormat != DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces*sizeof(uint32_t))) const void* indices,
+ _When_(indexFormat == DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces * 3 * sizeof(uint16_t)))
+ _When_(indexFormat != DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces * 3 * sizeof(uint32_t))) const void* indices,
_In_ DXGI_FORMAT indexFormat,
_In_ size_t nFaces,
_In_ size_t maxChartNumber,
@@ -138,18 +158,18 @@ namespace DirectX
_In_ size_t width,
_In_ size_t height,
_In_ float gutter,
- _In_reads_(nFaces*3) const uint32_t *adjacency,
- _In_reads_opt_(nFaces*3) const uint32_t *falseEdgeAdjacency,
- _In_reads_opt_(nFaces*3) const float *pIMTArray,
- _In_opt_ std::function statusCallBack,
+ _In_reads_(nFaces * 3) const uint32_t* adjacency,
+ _In_reads_opt_(nFaces * 3) const uint32_t* falseEdgeAdjacency,
+ _In_reads_opt_(nFaces * 3) const float* pIMTArray,
+ _In_ std::function statusCallBack,
_In_ float callbackFrequency,
- _In_ DWORD options,
+ _In_ UVATLAS options,
_Inout_ std::vector& vMeshOutVertexBuffer,
- _Inout_ std::vector& vMeshOutIndexBuffer,
- _Inout_opt_ std::vector* pvFacePartitioning = nullptr,
- _Inout_opt_ std::vector* pvVertexRemapArray = nullptr,
- _Out_opt_ float *maxStretchOut = nullptr,
- _Out_opt_ size_t *numChartsOut = nullptr);
+ _Inout_ std::vector& vMeshOutIndexBuffer,
+ _Inout_opt_ std::vector* pvFacePartitioning = nullptr,
+ _Inout_opt_ std::vector* pvVertexRemapArray = nullptr,
+ _Out_opt_ float* maxStretchOut = nullptr,
+ _Out_opt_ size_t* numChartsOut = nullptr);
// This has the same exact arguments as Create, except that it does not perform the
// final packing step. This method allows one to get a partitioning out, and possibly
@@ -178,25 +198,25 @@ namespace DirectX
HRESULT __cdecl UVAtlasPartition(
_In_reads_(nVerts) const XMFLOAT3* positions,
_In_ size_t nVerts,
- _When_(indexFormat == DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces*sizeof(uint16_t)))
- _When_(indexFormat != DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces*sizeof(uint32_t))) const void* indices,
+ _When_(indexFormat == DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces * 3 * sizeof(uint16_t)))
+ _When_(indexFormat != DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces * 3 * sizeof(uint32_t))) const void* indices,
_In_ DXGI_FORMAT indexFormat,
_In_ size_t nFaces,
_In_ size_t maxChartNumber,
_In_ float maxStretch,
- _In_reads_(nFaces*3) const uint32_t *adjacency,
- _In_reads_opt_(nFaces*3) const uint32_t *falseEdgeAdjacency,
- _In_reads_opt_(nFaces*3) const float *pIMTArray,
- _In_opt_ std::function statusCallBack,
+ _In_reads_(nFaces * 3) const uint32_t* adjacency,
+ _In_reads_opt_(nFaces * 3) const uint32_t* falseEdgeAdjacency,
+ _In_reads_opt_(nFaces * 3) const float* pIMTArray,
+ _In_ std::function statusCallBack,
_In_ float callbackFrequency,
- _In_ DWORD options,
+ _In_ UVATLAS options,
_Inout_ std::vector& vMeshOutVertexBuffer,
_Inout_ std::vector& vMeshOutIndexBuffer,
_Inout_opt_ std::vector* pvFacePartitioning,
_Inout_opt_ std::vector* pvVertexRemapArray,
_Inout_ std::vector& vPartitionResultAdjacency,
- _Out_opt_ float *maxStretchOut = nullptr,
- _Out_opt_ size_t *numChartsOut = nullptr);
+ _Out_opt_ float* maxStretchOut = nullptr,
+ _Out_opt_ size_t* numChartsOut = nullptr);
// This takes the face partitioning result from Partition and packs it into an
// atlas of the given size. pPartitionResultAdjacency should be derived from
@@ -209,7 +229,7 @@ namespace DirectX
_In_ size_t height,
_In_ float gutter,
_In_ const std::vector& vPartitionResultAdjacency,
- _In_opt_ std::function statusCallBack,
+ _In_ std::function statusCallBack,
_In_ float callbackFrequency);
@@ -244,14 +264,14 @@ namespace DirectX
HRESULT __cdecl UVAtlasComputeIMTFromPerVertexSignal(
_In_reads_(nVerts) const XMFLOAT3* positions,
_In_ size_t nVerts,
- _When_(indexFormat == DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces*sizeof(uint16_t)))
- _When_(indexFormat != DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces*sizeof(uint32_t))) const void* indices,
+ _When_(indexFormat == DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces * 3 * sizeof(uint16_t)))
+ _When_(indexFormat != DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces * 3 * sizeof(uint32_t))) const void* indices,
_In_ DXGI_FORMAT indexFormat,
_In_ size_t nFaces,
- _In_reads_(signalStride*nVerts) const float *pVertexSignal,
+ _In_reads_(signalStride* nVerts) const float* pVertexSignal,
_In_ size_t signalDimension,
_In_ size_t signalStride,
- _In_opt_ std::function statusCallBack,
+ _In_ std::function statusCallBack,
_Out_writes_(nFaces * 3) float* pIMTArray);
// This function is used to calculate the IMT from data that varies over the
@@ -275,16 +295,16 @@ namespace DirectX
_In_reads_(nVerts) const XMFLOAT3* positions,
_In_reads_(nVerts) const XMFLOAT2* texcoords,
_In_ size_t nVerts,
- _When_(indexFormat == DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces*sizeof(uint16_t)))
- _When_(indexFormat != DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces*sizeof(uint32_t))) const void* indices,
+ _When_(indexFormat == DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces * 3 * sizeof(uint16_t)))
+ _When_(indexFormat != DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces * 3 * sizeof(uint32_t))) const void* indices,
_In_ DXGI_FORMAT indexFormat,
_In_ size_t nFaces,
_In_ size_t signalDimension,
_In_ float maxUVDistance,
- _In_ std::function
- signalCallback,
- _In_opt_ void *userData,
- _In_opt_ std::function statusCallBack,
+ _In_ std::function
+ signalCallback,
+ _In_opt_ void* userData,
+ _In_ std::function statusCallBack,
_Out_writes_(nFaces * 3) float* pIMTArray);
// This function is used to calculate the IMT from texture data. Given a texture
@@ -300,15 +320,15 @@ namespace DirectX
_In_reads_(nVerts) const XMFLOAT3* positions,
_In_reads_(nVerts) const XMFLOAT2* texcoords,
_In_ size_t nVerts,
- _When_(indexFormat == DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces*sizeof(uint16_t)))
- _When_(indexFormat != DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces*sizeof(uint32_t))) const void* indices,
+ _When_(indexFormat == DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces * 3 * sizeof(uint16_t)))
+ _When_(indexFormat != DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces * 3 * sizeof(uint32_t))) const void* indices,
_In_ DXGI_FORMAT indexFormat,
_In_ size_t nFaces,
- _In_reads_(width*height*4) const float* pTexture,
+ _In_reads_(width* height * 4) const float* pTexture,
_In_ size_t width,
_In_ size_t height,
- _In_ DWORD options,
- _In_opt_ std::function statusCallBack,
+ _In_ UVATLAS_IMT options,
+ _In_ std::function statusCallBack,
_Out_writes_(nFaces * 3) float* pIMTArray);
// This function is very similar to UVAtlasComputeIMTFromTexture, but it can
@@ -325,17 +345,17 @@ namespace DirectX
_In_reads_(nVerts) const XMFLOAT3* positions,
_In_reads_(nVerts) const XMFLOAT2* texcoords,
_In_ size_t nVerts,
- _When_(indexFormat == DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces*sizeof(uint16_t)))
- _When_(indexFormat != DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces*sizeof(uint32_t))) const void* indices,
+ _When_(indexFormat == DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces * 3 * sizeof(uint16_t)))
+ _When_(indexFormat != DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces * 3 * sizeof(uint32_t))) const void* indices,
_In_ DXGI_FORMAT indexFormat,
_In_ size_t nFaces,
- _In_reads_(width*height*nComponents) const float *pTexelSignal,
+ _In_reads_(width* height* nComponents) const float* pTexelSignal,
_In_ size_t width,
_In_ size_t height,
_In_ size_t signalDimension,
_In_ size_t nComponents,
- _In_ DWORD options,
- _In_opt_ std::function statusCallBack,
+ _In_ UVATLAS_IMT options,
+ _In_ std::function statusCallBack,
_Out_writes_(nFaces * 3) float* pIMTArray);
// This function is for applying the a vertex remap array from UVAtlasCreate/UVAtlasPartition to a vertex buffer
@@ -344,10 +364,22 @@ namespace DirectX
// vbout - This is the output vertex buffer and is nNewVerts*stride in size
// nNewVerts - This should be >= nVerts
HRESULT __cdecl UVAtlasApplyRemap(
- _In_reads_bytes_(nVerts*stride) const void* vbin,
+ _In_reads_bytes_(nVerts* stride) const void* vbin,
_In_ size_t stride,
_In_ size_t nVerts,
_In_ size_t nNewVerts,
_In_reads_(nNewVerts) const uint32_t* vertexRemap,
- _Out_writes_bytes_(nNewVerts*stride) void* vbout );
-}
\ No newline at end of file
+ _Out_writes_bytes_(nNewVerts* stride) void* vbout) noexcept;
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-dynamic-exception-spec"
+#endif
+
+ DEFINE_ENUM_FLAG_OPERATORS(UVATLAS_IMT);
+ DEFINE_ENUM_FLAG_OPERATORS(UVATLAS);
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+}
diff --git a/Source/ThirdParty/WinPixEventRuntime/pix3.h b/Source/ThirdParty/WinPixEventRuntime/pix3.h
index 9d3ba301b..74f1338b7 100644
--- a/Source/ThirdParty/WinPixEventRuntime/pix3.h
+++ b/Source/ThirdParty/WinPixEventRuntime/pix3.h
@@ -18,7 +18,7 @@
#endif
#if !defined(USE_PIX_SUPPORTED_ARCHITECTURE)
-#if defined(_M_X64) || defined(USE_PIX_ON_ALL_ARCHITECTURES) || defined(_M_ARM64)
+#if defined(_M_X64) || defined(USE_PIX_ON_ALL_ARCHITECTURES) || defined(_M_ARM64) || defined(_M_ARM64EC)
#define USE_PIX_SUPPORTED_ARCHITECTURE
#endif
#endif
diff --git a/Source/ThirdParty/assimp/revision.h.in b/Source/ThirdParty/assimp/revision.h.in
deleted file mode 100644
index 939d2940f..000000000
--- a/Source/ThirdParty/assimp/revision.h.in
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef ASSIMP_REVISION_H_INC
-#define ASSIMP_REVISION_H_INC
-
-#define GitVersion 0x@GIT_COMMIT_HASH@
-#define GitBranch "@GIT_BRANCH@"
-
-#define VER_MAJOR @ASSIMP_VERSION_MAJOR@
-#define VER_MINOR @ASSIMP_VERSION_MINOR@
-#define VER_PATCH @ASSIMP_VERSION_PATCH@
-#define VER_BUILD @ASSIMP_PACKAGE_VERSION@
-
-#define STR_HELP(x) #x
-#define STR(x) STR_HELP(x)
-
-#define VER_FILEVERSION VER_MAJOR,VER_MINOR,VER_PATCH,VER_BUILD
-#if (GitVersion == 0)
-#define VER_FILEVERSION_STR STR(VER_MAJOR) "." STR(VER_MINOR) "." STR(VER_PATCH) "." STR(VER_BUILD)
-#else
-#define VER_FILEVERSION_STR STR(VER_MAJOR) "." STR(VER_MINOR) "." STR(VER_PATCH) "." STR(VER_BUILD) " (Commit @GIT_COMMIT_HASH@)"
-#endif
-#define VER_COPYRIGHT_STR "\xA9 2006-2023"
-
-#ifdef NDEBUG
-#define VER_ORIGINAL_FILENAME_STR "@CMAKE_SHARED_LIBRARY_PREFIX@assimp@LIBRARY_SUFFIX@.dll"
-#else
-#define VER_ORIGINAL_FILENAME_STR "@CMAKE_SHARED_LIBRARY_PREFIX@assimp@LIBRARY_SUFFIX@@CMAKE_DEBUG_POSTFIX@.dll"
-#endif // NDEBUG
-
-#endif // ASSIMP_REVISION_H_INC
diff --git a/Source/ThirdParty/curl/curl License.txt b/Source/ThirdParty/curl/curl License.txt
index 3528bd756..d1eab3eb9 100644
--- a/Source/ThirdParty/curl/curl License.txt
+++ b/Source/ThirdParty/curl/curl License.txt
@@ -1,6 +1,6 @@
COPYRIGHT AND PERMISSION NOTICE
-Copyright (c) 1996 - 2019, Daniel Stenberg, , and many
+Copyright (c) 1996 - 2023, Daniel Stenberg, , and many
contributors, see the THANKS file.
All rights reserved.
diff --git a/Source/ThirdParty/curl/curl.h b/Source/ThirdParty/curl/curl.h
index 86a24184a..8cc0b6ffe 100644
--- a/Source/ThirdParty/curl/curl.h
+++ b/Source/ThirdParty/curl/curl.h
@@ -1,5 +1,5 @@
-#ifndef __CURL_CURL_H
-#define __CURL_CURL_H
+#ifndef CURLINC_CURL_H
+#define CURLINC_CURL_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al.
+ * Copyright (C) Daniel Stenberg, , et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -20,37 +20,52 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
+ * SPDX-License-Identifier: curl
+ *
***************************************************************************/
/*
* If you have libcurl problems, all docs and details are found here:
- * https://curl.haxx.se/libcurl/
- *
- * curl-library mailing list subscription and unsubscription web interface:
- * https://cool.haxx.se/mailman/listinfo/curl-library/
+ * https://curl.se/libcurl/
*/
#ifdef CURL_NO_OLDIES
#define CURL_STRICTER
#endif
+/* Compile-time deprecation macros. */
+#if defined(__GNUC__) && (__GNUC__ >= 6) && \
+ !defined(__INTEL_COMPILER) && \
+ !defined(CURL_DISABLE_DEPRECATION) && !defined(BUILDING_LIBCURL)
+#define CURL_DEPRECATED(version, message) \
+ __attribute__((deprecated("since " # version ". " message)))
+#define CURL_IGNORE_DEPRECATION(statements) \
+ _Pragma("GCC diagnostic push") \
+ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
+ statements \
+ _Pragma("GCC diagnostic pop")
+#else
+#define CURL_DEPRECATED(version, message)
+#define CURL_IGNORE_DEPRECATION(statements) statements
+#endif
+
#include "curlver.h" /* libcurl version defines */
#include "system.h" /* determine things run-time */
/*
- * Define WIN32 when build target is Win32 API
+ * Define CURL_WIN32 when build target is Win32 API
*/
-#if (defined(_WIN32) || defined(__WIN32__)) && \
- !defined(WIN32) && !defined(__SYMBIAN32__)
-#define WIN32
+#if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && \
+ !defined(__SYMBIAN32__)
+#define CURL_WIN32
#endif
#include
#include
-#if defined(__FreeBSD__) && (__FreeBSD__ >= 2)
-/* Needed for __FreeBSD_version symbol definition */
+#if (defined(__FreeBSD__) && (__FreeBSD__ >= 2)) || defined(__MidnightBSD__)
+/* Needed for __FreeBSD_version or __MidnightBSD_version symbol definition */
#include
#endif
@@ -58,7 +73,7 @@
#include
#include
-#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
+#if defined(CURL_WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || \
defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H))
/* The check above prevents the winsock2 inclusion if winsock.h already was
@@ -74,23 +89,21 @@
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \
- defined(__CYGWIN__) || \
- (defined(__FreeBSD_version) && (__FreeBSD_version < 800000))
+ defined(__CYGWIN__) || defined(AMIGA) || defined(__NuttX__) || \
+ (defined(__FreeBSD_version) && (__FreeBSD_version < 800000)) || \
+ (defined(__MidnightBSD_version) && (__MidnightBSD_version < 100000)) || \
+ defined(__sun__) || defined(__serenity__)
#include
#endif
-#if !defined(WIN32) && !defined(_WIN32_WCE)
+#if !defined(CURL_WIN32) && !defined(_WIN32_WCE)
#include
#endif
-#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)
+#if !defined(CURL_WIN32)
#include
#endif
-#ifdef __BEOS__
-#include
-#endif
-
/* Compatibility for non-Clang compilers */
#ifndef __has_declspec_attribute
# define __has_declspec_attribute(x) 0
@@ -114,7 +127,7 @@ typedef void CURLSH;
#ifdef CURL_STATICLIB
# define CURL_EXTERN
-#elif defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__) || \
+#elif defined(CURL_WIN32) || defined(__SYMBIAN32__) || \
(__has_declspec_attribute(dllexport) && \
__has_declspec_attribute(dllimport))
# if defined(BUILDING_LIBCURL)
@@ -130,7 +143,7 @@ typedef void CURLSH;
#ifndef curl_socket_typedef
/* socket typedef */
-#if defined(WIN32) && !defined(__LWIP_OPT_H__) && !defined(LWIP_HDR_OPT_H)
+#if defined(CURL_WIN32) && !defined(__LWIP_OPT_H__) && !defined(LWIP_HDR_OPT_H)
typedef SOCKET curl_socket_t;
#define CURL_SOCKET_BAD INVALID_SOCKET
#else
@@ -148,13 +161,15 @@ typedef enum {
CURLSSLBACKEND_NSS = 3,
CURLSSLBACKEND_OBSOLETE4 = 4, /* Was QSOSSL. */
CURLSSLBACKEND_GSKIT = 5,
- CURLSSLBACKEND_POLARSSL = 6,
+ CURLSSLBACKEND_POLARSSL CURL_DEPRECATED(7.69.0, "") = 6,
CURLSSLBACKEND_WOLFSSL = 7,
CURLSSLBACKEND_SCHANNEL = 8,
CURLSSLBACKEND_SECURETRANSPORT = 9,
- CURLSSLBACKEND_AXTLS = 10, /* never used since 7.63.0 */
+ CURLSSLBACKEND_AXTLS CURL_DEPRECATED(7.61.0, "") = 10,
CURLSSLBACKEND_MBEDTLS = 11,
- CURLSSLBACKEND_MESALINK = 12
+ CURLSSLBACKEND_MESALINK CURL_DEPRECATED(7.82.0, "") = 12,
+ CURLSSLBACKEND_BEARSSL = 13,
+ CURLSSLBACKEND_RUSTLS = 14
} curl_sslbackend;
/* aliases for library clones and renames */
@@ -209,16 +224,22 @@ struct curl_httppost {
set. Added in 7.46.0 */
};
-/* This is the CURLOPT_PROGRESSFUNCTION callback proto. It is now considered
- deprecated but was the only choice up until 7.31.0 */
+
+/* This is a return code for the progress callback that, when returned, will
+ signal libcurl to continue executing the default progress function */
+#define CURL_PROGRESSFUNC_CONTINUE 0x10000001
+
+/* This is the CURLOPT_PROGRESSFUNCTION callback prototype. It is now
+ considered deprecated but was the only choice up until 7.31.0 */
typedef int (*curl_progress_callback)(void *clientp,
double dltotal,
double dlnow,
double ultotal,
double ulnow);
-/* This is the CURLOPT_XFERINFOFUNCTION callback proto. It was introduced in
- 7.32.0, it avoids floating point and provides more detailed information. */
+/* This is the CURLOPT_XFERINFOFUNCTION callback prototype. It was introduced
+ in 7.32.0, avoids the use of floating point numbers and provides more
+ detailed information. */
typedef int (*curl_xferinfo_callback)(void *clientp,
curl_off_t dltotal,
curl_off_t dlnow,
@@ -227,7 +248,7 @@ typedef int (*curl_xferinfo_callback)(void *clientp,
#ifndef CURL_MAX_READ_SIZE
/* The maximum receive buffer size configurable via CURLOPT_BUFFERSIZE. */
-#define CURL_MAX_READ_SIZE 524288
+#define CURL_MAX_READ_SIZE (10*1024*1024)
#endif
#ifndef CURL_MAX_WRITE_SIZE
@@ -251,6 +272,10 @@ typedef int (*curl_xferinfo_callback)(void *clientp,
will signal libcurl to pause receiving on the current transfer. */
#define CURL_WRITEFUNC_PAUSE 0x10000001
+/* This is a magic return code for the write callback that, when returned,
+ will signal an error from the callback. */
+#define CURL_WRITEFUNC_ERROR 0xFFFFFFFF
+
typedef size_t (*curl_write_callback)(char *buffer,
size_t size,
size_t nitems,
@@ -283,14 +308,11 @@ typedef enum {
#define CURLFINFOFLAG_KNOWN_SIZE (1<<6)
#define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1<<7)
-/* Content of this structure depends on information which is known and is
- achievable (e.g. by FTP LIST parsing). Please see the url_easy_setopt(3) man
- page for callbacks returning this structure -- some fields are mandatory,
- some others are optional. The FLAG field has special meaning. */
+/* Information about a single file, used when doing FTP wildcard matching */
struct curl_fileinfo {
char *filename;
curlfiletype filetype;
- time_t time;
+ time_t time; /* always zero! */
unsigned int perm;
int uid;
int gid;
@@ -366,7 +388,7 @@ typedef int (*curl_seek_callback)(void *instream,
#define CURL_READFUNC_PAUSE 0x10000001
/* Return code for when the trailing headers' callback has terminated
- without any errors*/
+ without any errors */
#define CURL_TRAILERFUNC_OK 0
/* Return code for when was an error in the trailing header's list and we
want to abort the request */
@@ -448,7 +470,7 @@ typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);
#define CURL_DID_MEMORY_FUNC_TYPEDEFS
#endif
-/* the kind of data that is passed to information_callback*/
+/* the kind of data that is passed to information_callback */
typedef enum {
CURLINFO_TEXT = 0,
CURLINFO_HEADER_IN, /* 1 */
@@ -467,6 +489,20 @@ typedef int (*curl_debug_callback)
size_t size, /* size of the data pointed to */
void *userptr); /* whatever the user please */
+/* This is the CURLOPT_PREREQFUNCTION callback prototype. */
+typedef int (*curl_prereq_callback)(void *clientp,
+ char *conn_primary_ip,
+ char *conn_local_ip,
+ int conn_primary_port,
+ int conn_local_port);
+
+/* Return code for when the pre-request callback has terminated without
+ any errors */
+#define CURL_PREREQFUNC_OK 0
+/* Return code for when the pre-request callback wants to abort the
+ request */
+#define CURL_PREREQFUNC_ABORT 1
+
/* All possible error codes from all sorts of curl functions. Future versions
may return other values, stay prepared.
@@ -511,10 +547,6 @@ typedef enum {
CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */
CURLE_READ_ERROR, /* 26 - couldn't open/read from file */
CURLE_OUT_OF_MEMORY, /* 27 */
- /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
- instead of a memory allocation error if CURL_DOES_CONVERSIONS
- is defined
- */
CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */
CURLE_OBSOLETE29, /* 29 - NOT USED */
CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */
@@ -536,7 +568,7 @@ typedef enum {
CURLE_OBSOLETE46, /* 46 - NOT USED */
CURLE_TOO_MANY_REDIRECTS, /* 47 - catch endless re-direct loops */
CURLE_UNKNOWN_OPTION, /* 48 - User specified an unknown option */
- CURLE_TELNET_OPTION_SYNTAX, /* 49 - Malformed telnet option */
+ CURLE_SETOPT_OPTION_SYNTAX, /* 49 - Malformed setopt option */
CURLE_OBSOLETE50, /* 50 - NOT USED */
CURLE_OBSOLETE51, /* 51 - NOT USED */
CURLE_GOT_NOTHING, /* 52 - when this is a specific error */
@@ -551,7 +583,7 @@ typedef enum {
CURLE_PEER_FAILED_VERIFICATION, /* 60 - peer's certificate or fingerprint
wasn't verified fine */
CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */
- CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
+ CURLE_OBSOLETE62, /* 62 - NOT IN USE since 7.82.0 */
CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind
@@ -566,12 +598,8 @@ typedef enum {
CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */
CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */
CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */
- CURLE_CONV_FAILED, /* 75 - conversion failed */
- CURLE_CONV_REQD, /* 76 - caller must register conversion
- callbacks using curl_easy_setopt options
- CURLOPT_CONV_FROM_NETWORK_FUNCTION,
- CURLOPT_CONV_TO_NETWORK_FUNCTION, and
- CURLOPT_CONV_FROM_UTF8_FUNCTION */
+ CURLE_OBSOLETE75, /* 75 - NOT IN USE since 7.82.0 */
+ CURLE_OBSOLETE76, /* 76 - NOT IN USE since 7.82.0 */
CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing
or wrong format */
CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */
@@ -602,6 +630,13 @@ typedef enum {
*/
CURLE_RECURSIVE_API_CALL, /* 93 - an api function was called from
inside a callback */
+ CURLE_AUTH_ERROR, /* 94 - an authentication function returned an
+ error */
+ CURLE_HTTP3, /* 95 - An HTTP/3 layer problem */
+ CURLE_QUIC_CONNECT_ERROR, /* 96 - QUIC connection error */
+ CURLE_PROXY, /* 97 - proxy handshake error */
+ CURLE_SSL_CLIENTCERT, /* 98 - client-side certificate required */
+ CURLE_UNRECOVERABLE_POLL, /* 99 - poll/select returned fatal error */
CURL_LAST /* never use! */
} CURLcode;
@@ -625,6 +660,9 @@ typedef enum {
/* The following were added in 7.21.5, April 2011 */
#define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION
+/* Added for 7.78.0 */
+#define CURLE_TELNET_OPTION_SYNTAX CURLE_SETOPT_OPTION_SYNTAX
+
/* The following were added in 7.17.1 */
/* These are scheduled to disappear by 2009 */
#define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION
@@ -656,13 +694,14 @@ typedef enum {
/* The following were added earlier */
#define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT
-
#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR
#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED
#define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED
-
#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE
#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME
+#define CURLE_LDAP_INVALID_URL CURLE_OBSOLETE62
+#define CURLE_CONV_REQD CURLE_OBSOLETE76
+#define CURLE_CONV_FAILED CURLE_OBSOLETE75
/* This was the error code 50 in 7.7.3 and a few earlier versions, this
is no longer used by libcurl but is instead #defined here only to not
@@ -679,14 +718,58 @@ typedef enum {
#define CURLOPT_WRITEINFO CURLOPT_OBSOLETE40
#define CURLOPT_CLOSEPOLICY CURLOPT_OBSOLETE72
-#endif /*!CURL_NO_OLDIES*/
+#endif /* !CURL_NO_OLDIES */
+
+/*
+ * Proxy error codes. Returned in CURLINFO_PROXY_ERROR if CURLE_PROXY was
+ * return for the transfers.
+ */
+typedef enum {
+ CURLPX_OK,
+ CURLPX_BAD_ADDRESS_TYPE,
+ CURLPX_BAD_VERSION,
+ CURLPX_CLOSED,
+ CURLPX_GSSAPI,
+ CURLPX_GSSAPI_PERMSG,
+ CURLPX_GSSAPI_PROTECTION,
+ CURLPX_IDENTD,
+ CURLPX_IDENTD_DIFFER,
+ CURLPX_LONG_HOSTNAME,
+ CURLPX_LONG_PASSWD,
+ CURLPX_LONG_USER,
+ CURLPX_NO_AUTH,
+ CURLPX_RECV_ADDRESS,
+ CURLPX_RECV_AUTH,
+ CURLPX_RECV_CONNECT,
+ CURLPX_RECV_REQACK,
+ CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED,
+ CURLPX_REPLY_COMMAND_NOT_SUPPORTED,
+ CURLPX_REPLY_CONNECTION_REFUSED,
+ CURLPX_REPLY_GENERAL_SERVER_FAILURE,
+ CURLPX_REPLY_HOST_UNREACHABLE,
+ CURLPX_REPLY_NETWORK_UNREACHABLE,
+ CURLPX_REPLY_NOT_ALLOWED,
+ CURLPX_REPLY_TTL_EXPIRED,
+ CURLPX_REPLY_UNASSIGNED,
+ CURLPX_REQUEST_FAILED,
+ CURLPX_RESOLVE_HOST,
+ CURLPX_SEND_AUTH,
+ CURLPX_SEND_CONNECT,
+ CURLPX_SEND_REQUEST,
+ CURLPX_UNKNOWN_FAIL,
+ CURLPX_UNKNOWN_MODE,
+ CURLPX_USER_REJECTED,
+ CURLPX_LAST /* never use */
+} CURLproxycode;
/* This prototype applies to all conversion callbacks */
typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);
typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */
- void *ssl_ctx, /* actually an
- OpenSSL SSL_CTX */
+ void *ssl_ctx, /* actually an OpenSSL
+ or WolfSSL SSL_CTX,
+ or an mbedTLS
+ mbedtls_ssl_config */
void *userptr);
typedef enum {
@@ -734,6 +817,7 @@ typedef enum {
#define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4)
#define CURLAUTH_NTLM_WB (((unsigned long)1)<<5)
#define CURLAUTH_BEARER (((unsigned long)1)<<6)
+#define CURLAUTH_AWS_SIGV4 (((unsigned long)1)<<7)
#define CURLAUTH_ONLY (((unsigned long)1)<<31)
#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)
#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
@@ -764,7 +848,7 @@ enum curl_khtype {
};
struct curl_khkey {
- const char *key; /* points to a zero-terminated string encoded with base64
+ const char *key; /* points to a null-terminated string encoded with base64
if len is zero, otherwise to the "raw" data */
size_t len;
enum curl_khtype keytype;
@@ -776,9 +860,10 @@ enum curl_khstat {
CURLKHSTAT_FINE_ADD_TO_FILE,
CURLKHSTAT_FINE,
CURLKHSTAT_REJECT, /* reject the connection, return an error */
- CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so
- this causes a CURLE_DEFER error but otherwise the
+ CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now.
+ Causes a CURLE_PEER_FAILED_VERIFICATION error but the
connection will be left intact etc */
+ CURLKHSTAT_FINE_REPLACE, /* accept and replace the wrong key */
CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */
};
@@ -795,7 +880,18 @@ typedef int
const struct curl_khkey *knownkey, /* known */
const struct curl_khkey *foundkey, /* found */
enum curl_khmatch, /* libcurl's view on the keys */
- void *clientp); /* custom pointer passed from app */
+ void *clientp); /* custom pointer passed with */
+ /* CURLOPT_SSH_KEYDATA */
+
+typedef int
+ (*curl_sshhostkeycallback) (void *clientp,/* custom pointer passed */
+ /* with CURLOPT_SSH_HOSTKEYDATA */
+ int keytype, /* CURLKHTYPE */
+ const char *key, /* hostkey to check */
+ size_t keylen); /* length of the key */
+ /* return CURLE_OK to accept */
+ /* or something else to refuse */
+
/* parameter for the CURLOPT_USE_SSL option */
typedef enum {
@@ -819,6 +915,23 @@ typedef enum {
SSL backends where such behavior is present. */
#define CURLSSLOPT_NO_REVOKE (1<<1)
+/* - NO_PARTIALCHAIN tells libcurl to *NOT* accept a partial certificate chain
+ if possible. The OpenSSL backend has this ability. */
+#define CURLSSLOPT_NO_PARTIALCHAIN (1<<2)
+
+/* - REVOKE_BEST_EFFORT tells libcurl to ignore certificate revocation offline
+ checks and ignore missing revocation list for those SSL backends where such
+ behavior is present. */
+#define CURLSSLOPT_REVOKE_BEST_EFFORT (1<<3)
+
+/* - CURLSSLOPT_NATIVE_CA tells libcurl to use standard certificate store of
+ operating system. Currently implemented under MS-Windows. */
+#define CURLSSLOPT_NATIVE_CA (1<<4)
+
+/* - CURLSSLOPT_AUTO_CLIENT_CERT tells libcurl to automatically locate and use
+ a client certificate for authentication. (Schannel) */
+#define CURLSSLOPT_AUTO_CLIENT_CERT (1<<5)
+
/* The default connection attempt delay in milliseconds for happy eyeballs.
CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 and happy-eyeballs-timeout-ms.d document
this value, keep them in sync. */
@@ -839,7 +952,7 @@ typedef enum {
#define CURLFTPSSL_ALL CURLUSESSL_ALL
#define CURLFTPSSL_LAST CURLUSESSL_LAST
#define curl_ftpssl curl_usessl
-#endif /*!CURL_NO_OLDIES*/
+#endif /* !CURL_NO_OLDIES */
/* parameter for the CURLOPT_FTP_SSL_CCC option */
typedef enum {
@@ -882,14 +995,44 @@ typedef enum {
#define CURLHEADER_SEPARATE (1<<0)
/* CURLALTSVC_* are bits for the CURLOPT_ALTSVC_CTRL option */
-#define CURLALTSVC_IMMEDIATELY (1<<0)
-#define CURLALTSVC_ALTUSED (1<<1)
#define CURLALTSVC_READONLYFILE (1<<2)
#define CURLALTSVC_H1 (1<<3)
#define CURLALTSVC_H2 (1<<4)
#define CURLALTSVC_H3 (1<<5)
-/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */
+
+struct curl_hstsentry {
+ char *name;
+ size_t namelen;
+ unsigned int includeSubDomains:1;
+ char expire[18]; /* YYYYMMDD HH:MM:SS [null-terminated] */
+};
+
+struct curl_index {
+ size_t index; /* the provided entry's "index" or count */
+ size_t total; /* total number of entries to save */
+};
+
+typedef enum {
+ CURLSTS_OK,
+ CURLSTS_DONE,
+ CURLSTS_FAIL
+} CURLSTScode;
+
+typedef CURLSTScode (*curl_hstsread_callback)(CURL *easy,
+ struct curl_hstsentry *e,
+ void *userp);
+typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy,
+ struct curl_hstsentry *e,
+ struct curl_index *i,
+ void *userp);
+
+/* CURLHSTS_* are bits for the CURLOPT_HSTS option */
+#define CURLHSTS_ENABLE (long)(1<<0)
+#define CURLHSTS_READONLYFILE (long)(1<<1)
+
+/* The CURLPROTO_ defines below are for the **deprecated** CURLOPT_*PROTOCOLS
+ options. Do not use. */
#define CURLPROTO_HTTP (1<<0)
#define CURLPROTO_HTTPS (1<<1)
#define CURLPROTO_FTP (1<<2)
@@ -918,87 +1061,86 @@ typedef enum {
#define CURLPROTO_GOPHER (1<<25)
#define CURLPROTO_SMB (1<<26)
#define CURLPROTO_SMBS (1<<27)
+#define CURLPROTO_MQTT (1<<28)
+#define CURLPROTO_GOPHERS (1<<29)
#define CURLPROTO_ALL (~0) /* enable everything */
/* long may be 32 or 64 bits, but we should never depend on anything else
but 32 */
#define CURLOPTTYPE_LONG 0
#define CURLOPTTYPE_OBJECTPOINT 10000
-#define CURLOPTTYPE_STRINGPOINT 10000
#define CURLOPTTYPE_FUNCTIONPOINT 20000
#define CURLOPTTYPE_OFF_T 30000
+#define CURLOPTTYPE_BLOB 40000
/* *STRINGPOINT is an alias for OBJECTPOINT to allow tools to extract the
string options from the header file */
-/* name is uppercase CURLOPT_,
- type is one of the defined CURLOPTTYPE_
- number is unique identifier */
-#ifdef CINIT
-#undef CINIT
-#endif
-#ifdef CURL_ISOCPP
-#define CINIT(na,t,nu) CURLOPT_ ## na = CURLOPTTYPE_ ## t + nu
-#else
-/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
-#define LONG CURLOPTTYPE_LONG
-#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
-#define STRINGPOINT CURLOPTTYPE_OBJECTPOINT
-#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
-#define OFF_T CURLOPTTYPE_OFF_T
-#define CINIT(name,type,number) CURLOPT_/**/name = type + number
-#endif
+#define CURLOPT(na,t,nu) na = t + nu
+#define CURLOPTDEPRECATED(na,t,nu,v,m) na CURL_DEPRECATED(v,m) = t + nu
+
+/* CURLOPT aliases that make no run-time difference */
+
+/* 'char *' argument to a string with a trailing zero */
+#define CURLOPTTYPE_STRINGPOINT CURLOPTTYPE_OBJECTPOINT
+
+/* 'struct curl_slist *' argument */
+#define CURLOPTTYPE_SLISTPOINT CURLOPTTYPE_OBJECTPOINT
+
+/* 'void *' argument passed untouched to callback */
+#define CURLOPTTYPE_CBPOINT CURLOPTTYPE_OBJECTPOINT
+
+/* 'long' argument with a set of values/bitmask */
+#define CURLOPTTYPE_VALUES CURLOPTTYPE_LONG
/*
- * This macro-mania below setups the CURLOPT_[what] enum, to be used with
- * curl_easy_setopt(). The first argument in the CINIT() macro is the [what]
- * word.
+ * All CURLOPT_* values.
*/
typedef enum {
/* This is the FILE * or void * the regular output should be written to. */
- CINIT(WRITEDATA, OBJECTPOINT, 1),
+ CURLOPT(CURLOPT_WRITEDATA, CURLOPTTYPE_CBPOINT, 1),
/* The full URL to get/put */
- CINIT(URL, STRINGPOINT, 2),
+ CURLOPT(CURLOPT_URL, CURLOPTTYPE_STRINGPOINT, 2),
/* Port number to connect to, if other than default. */
- CINIT(PORT, LONG, 3),
+ CURLOPT(CURLOPT_PORT, CURLOPTTYPE_LONG, 3),
/* Name of proxy to use. */
- CINIT(PROXY, STRINGPOINT, 4),
+ CURLOPT(CURLOPT_PROXY, CURLOPTTYPE_STRINGPOINT, 4),
/* "user:password;options" to use when fetching. */
- CINIT(USERPWD, STRINGPOINT, 5),
+ CURLOPT(CURLOPT_USERPWD, CURLOPTTYPE_STRINGPOINT, 5),
/* "user:password" to use with proxy. */
- CINIT(PROXYUSERPWD, STRINGPOINT, 6),
+ CURLOPT(CURLOPT_PROXYUSERPWD, CURLOPTTYPE_STRINGPOINT, 6),
/* Range to get, specified as an ASCII string. */
- CINIT(RANGE, STRINGPOINT, 7),
+ CURLOPT(CURLOPT_RANGE, CURLOPTTYPE_STRINGPOINT, 7),
/* not used */
/* Specified file stream to upload from (use as input): */
- CINIT(READDATA, OBJECTPOINT, 9),
+ CURLOPT(CURLOPT_READDATA, CURLOPTTYPE_CBPOINT, 9),
/* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
* bytes big. */
- CINIT(ERRORBUFFER, OBJECTPOINT, 10),
+ CURLOPT(CURLOPT_ERRORBUFFER, CURLOPTTYPE_OBJECTPOINT, 10),
/* Function that will be called to store the output (instead of fwrite). The
* parameters will use fwrite() syntax, make sure to follow them. */
- CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),
+ CURLOPT(CURLOPT_WRITEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 11),
/* Function that will be called to read the input (instead of fread). The
* parameters will use fread() syntax, make sure to follow them. */
- CINIT(READFUNCTION, FUNCTIONPOINT, 12),
+ CURLOPT(CURLOPT_READFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 12),
/* Time-out the read operation after this amount of seconds */
- CINIT(TIMEOUT, LONG, 13),
+ CURLOPT(CURLOPT_TIMEOUT, CURLOPTTYPE_LONG, 13),
- /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
+ /* If CURLOPT_READDATA is used, this can be used to inform libcurl about
* how large the file being sent really is. That allows better error
* checking and better verifies that the upload was successful. -1 means
* unknown size.
@@ -1007,20 +1149,20 @@ typedef enum {
* which takes an off_t type, allowing platforms with larger off_t
* sizes to handle larger files. See below for INFILESIZE_LARGE.
*/
- CINIT(INFILESIZE, LONG, 14),
+ CURLOPT(CURLOPT_INFILESIZE, CURLOPTTYPE_LONG, 14),
/* POST static input fields. */
- CINIT(POSTFIELDS, OBJECTPOINT, 15),
+ CURLOPT(CURLOPT_POSTFIELDS, CURLOPTTYPE_OBJECTPOINT, 15),
/* Set the referrer page (needed by some CGIs) */
- CINIT(REFERER, STRINGPOINT, 16),
+ CURLOPT(CURLOPT_REFERER, CURLOPTTYPE_STRINGPOINT, 16),
/* Set the FTP PORT string (interface name, named or numerical IP address)
Use i.e '-' to use default address. */
- CINIT(FTPPORT, STRINGPOINT, 17),
+ CURLOPT(CURLOPT_FTPPORT, CURLOPTTYPE_STRINGPOINT, 17),
/* Set the User-Agent string (examined by some CGIs) */
- CINIT(USERAGENT, STRINGPOINT, 18),
+ CURLOPT(CURLOPT_USERAGENT, CURLOPTTYPE_STRINGPOINT, 18),
/* If the download receives less than "low speed limit" bytes/second
* during "low speed time" seconds, the operations is aborted.
@@ -1029,10 +1171,10 @@ typedef enum {
*/
/* Set the "low speed limit" */
- CINIT(LOW_SPEED_LIMIT, LONG, 19),
+ CURLOPT(CURLOPT_LOW_SPEED_LIMIT, CURLOPTTYPE_LONG, 19),
/* Set the "low speed time" */
- CINIT(LOW_SPEED_TIME, LONG, 20),
+ CURLOPT(CURLOPT_LOW_SPEED_TIME, CURLOPTTYPE_LONG, 20),
/* Set the continuation offset.
*
@@ -1040,48 +1182,49 @@ typedef enum {
* off_t types, allowing for large file offsets on platforms which
* use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
*/
- CINIT(RESUME_FROM, LONG, 21),
+ CURLOPT(CURLOPT_RESUME_FROM, CURLOPTTYPE_LONG, 21),
/* Set cookie in request: */
- CINIT(COOKIE, STRINGPOINT, 22),
+ CURLOPT(CURLOPT_COOKIE, CURLOPTTYPE_STRINGPOINT, 22),
/* This points to a linked list of headers, struct curl_slist kind. This
list is also used for RTSP (in spite of its name) */
- CINIT(HTTPHEADER, OBJECTPOINT, 23),
+ CURLOPT(CURLOPT_HTTPHEADER, CURLOPTTYPE_SLISTPOINT, 23),
/* This points to a linked list of post entries, struct curl_httppost */
- CINIT(HTTPPOST, OBJECTPOINT, 24),
+ CURLOPTDEPRECATED(CURLOPT_HTTPPOST, CURLOPTTYPE_OBJECTPOINT, 24,
+ 7.56.0, "Use CURLOPT_MIMEPOST"),
/* name of the file keeping your private SSL-certificate */
- CINIT(SSLCERT, STRINGPOINT, 25),
+ CURLOPT(CURLOPT_SSLCERT, CURLOPTTYPE_STRINGPOINT, 25),
/* password for the SSL or SSH private key */
- CINIT(KEYPASSWD, STRINGPOINT, 26),
+ CURLOPT(CURLOPT_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 26),
/* send TYPE parameter? */
- CINIT(CRLF, LONG, 27),
+ CURLOPT(CURLOPT_CRLF, CURLOPTTYPE_LONG, 27),
/* send linked-list of QUOTE commands */
- CINIT(QUOTE, OBJECTPOINT, 28),
+ CURLOPT(CURLOPT_QUOTE, CURLOPTTYPE_SLISTPOINT, 28),
/* send FILE * or void * to store headers to, if you use a callback it
is simply passed to the callback unmodified */
- CINIT(HEADERDATA, OBJECTPOINT, 29),
+ CURLOPT(CURLOPT_HEADERDATA, CURLOPTTYPE_CBPOINT, 29),
/* point to a file to read the initial cookies from, also enables
"cookie awareness" */
- CINIT(COOKIEFILE, STRINGPOINT, 31),
+ CURLOPT(CURLOPT_COOKIEFILE, CURLOPTTYPE_STRINGPOINT, 31),
/* What version to specifically try to use.
See CURL_SSLVERSION defines below. */
- CINIT(SSLVERSION, LONG, 32),
+ CURLOPT(CURLOPT_SSLVERSION, CURLOPTTYPE_VALUES, 32),
/* What kind of HTTP time condition to use, see defines */
- CINIT(TIMECONDITION, LONG, 33),
+ CURLOPT(CURLOPT_TIMECONDITION, CURLOPTTYPE_VALUES, 33),
/* Time to use with the above condition. Specified in number of seconds
since 1 Jan 1970 */
- CINIT(TIMEVALUE, LONG, 34),
+ CURLOPT(CURLOPT_TIMEVALUE, CURLOPTTYPE_LONG, 34),
/* 35 = OBSOLETE */
@@ -1089,37 +1232,59 @@ typedef enum {
HTTP: DELETE, TRACE and others
FTP: to use a different list command
*/
- CINIT(CUSTOMREQUEST, STRINGPOINT, 36),
+ CURLOPT(CURLOPT_CUSTOMREQUEST, CURLOPTTYPE_STRINGPOINT, 36),
/* FILE handle to use instead of stderr */
- CINIT(STDERR, OBJECTPOINT, 37),
+ CURLOPT(CURLOPT_STDERR, CURLOPTTYPE_OBJECTPOINT, 37),
/* 38 is not used */
/* send linked-list of post-transfer QUOTE commands */
- CINIT(POSTQUOTE, OBJECTPOINT, 39),
+ CURLOPT(CURLOPT_POSTQUOTE, CURLOPTTYPE_SLISTPOINT, 39),
- CINIT(OBSOLETE40, OBJECTPOINT, 40), /* OBSOLETE, do not use! */
+ /* OBSOLETE, do not use! */
+ CURLOPT(CURLOPT_OBSOLETE40, CURLOPTTYPE_OBJECTPOINT, 40),
- CINIT(VERBOSE, LONG, 41), /* talk a lot */
- CINIT(HEADER, LONG, 42), /* throw the header out too */
- CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */
- CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */
- CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 400 */
- CINIT(UPLOAD, LONG, 46), /* this is an upload */
- CINIT(POST, LONG, 47), /* HTTP POST method */
- CINIT(DIRLISTONLY, LONG, 48), /* bare names when listing directories */
+ /* talk a lot */
+ CURLOPT(CURLOPT_VERBOSE, CURLOPTTYPE_LONG, 41),
- CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */
+ /* throw the header out too */
+ CURLOPT(CURLOPT_HEADER, CURLOPTTYPE_LONG, 42),
+
+ /* shut off the progress meter */
+ CURLOPT(CURLOPT_NOPROGRESS, CURLOPTTYPE_LONG, 43),
+
+ /* use HEAD to get http document */
+ CURLOPT(CURLOPT_NOBODY, CURLOPTTYPE_LONG, 44),
+
+ /* no output on http error codes >= 400 */
+ CURLOPT(CURLOPT_FAILONERROR, CURLOPTTYPE_LONG, 45),
+
+ /* this is an upload */
+ CURLOPT(CURLOPT_UPLOAD, CURLOPTTYPE_LONG, 46),
+
+ /* HTTP POST method */
+ CURLOPT(CURLOPT_POST, CURLOPTTYPE_LONG, 47),
+
+ /* bare names when listing directories */
+ CURLOPT(CURLOPT_DIRLISTONLY, CURLOPTTYPE_LONG, 48),
+
+ /* Append instead of overwrite on upload! */
+ CURLOPT(CURLOPT_APPEND, CURLOPTTYPE_LONG, 50),
/* Specify whether to read the user+password from the .netrc or the URL.
* This must be one of the CURL_NETRC_* enums below. */
- CINIT(NETRC, LONG, 51),
+ CURLOPT(CURLOPT_NETRC, CURLOPTTYPE_VALUES, 51),
- CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */
+ /* use Location: Luke! */
+ CURLOPT(CURLOPT_FOLLOWLOCATION, CURLOPTTYPE_LONG, 52),
- CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */
- CINIT(PUT, LONG, 54), /* HTTP PUT */
+ /* transfer data in text/ASCII format */
+ CURLOPT(CURLOPT_TRANSFERTEXT, CURLOPTTYPE_LONG, 53),
+
+ /* HTTP PUT */
+ CURLOPTDEPRECATED(CURLOPT_PUT, CURLOPTTYPE_LONG, 54,
+ 7.12.1, "Use CURLOPT_UPLOAD"),
/* 55 = OBSOLETE */
@@ -1127,265 +1292,270 @@ typedef enum {
* Function that will be called instead of the internal progress display
* function. This function should be defined as the curl_progress_callback
* prototype defines. */
- CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),
+ CURLOPTDEPRECATED(CURLOPT_PROGRESSFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 56,
+ 7.32.0, "Use CURLOPT_XFERINFOFUNCTION"),
/* Data passed to the CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION
callbacks */
- CINIT(PROGRESSDATA, OBJECTPOINT, 57),
-#define CURLOPT_XFERINFODATA CURLOPT_PROGRESSDATA
+ CURLOPT(CURLOPT_XFERINFODATA, CURLOPTTYPE_CBPOINT, 57),
+#define CURLOPT_PROGRESSDATA CURLOPT_XFERINFODATA
/* We want the referrer field set automatically when following locations */
- CINIT(AUTOREFERER, LONG, 58),
+ CURLOPT(CURLOPT_AUTOREFERER, CURLOPTTYPE_LONG, 58),
/* Port of the proxy, can be set in the proxy string as well with:
"[host]:[port]" */
- CINIT(PROXYPORT, LONG, 59),
+ CURLOPT(CURLOPT_PROXYPORT, CURLOPTTYPE_LONG, 59),
/* size of the POST input data, if strlen() is not good to use */
- CINIT(POSTFIELDSIZE, LONG, 60),
+ CURLOPT(CURLOPT_POSTFIELDSIZE, CURLOPTTYPE_LONG, 60),
- /* tunnel non-http operations through a HTTP proxy */
- CINIT(HTTPPROXYTUNNEL, LONG, 61),
+ /* tunnel non-http operations through an HTTP proxy */
+ CURLOPT(CURLOPT_HTTPPROXYTUNNEL, CURLOPTTYPE_LONG, 61),
/* Set the interface string to use as outgoing network interface */
- CINIT(INTERFACE, STRINGPOINT, 62),
+ CURLOPT(CURLOPT_INTERFACE, CURLOPTTYPE_STRINGPOINT, 62),
/* Set the krb4/5 security level, this also enables krb4/5 awareness. This
* is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
* is set but doesn't match one of these, 'private' will be used. */
- CINIT(KRBLEVEL, STRINGPOINT, 63),
+ CURLOPT(CURLOPT_KRBLEVEL, CURLOPTTYPE_STRINGPOINT, 63),
/* Set if we should verify the peer in ssl handshake, set 1 to verify. */
- CINIT(SSL_VERIFYPEER, LONG, 64),
+ CURLOPT(CURLOPT_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 64),
/* The CApath or CAfile used to validate the peer certificate
this option is used only if SSL_VERIFYPEER is true */
- CINIT(CAINFO, STRINGPOINT, 65),
+ CURLOPT(CURLOPT_CAINFO, CURLOPTTYPE_STRINGPOINT, 65),
/* 66 = OBSOLETE */
/* 67 = OBSOLETE */
/* Maximum number of http redirects to follow */
- CINIT(MAXREDIRS, LONG, 68),
+ CURLOPT(CURLOPT_MAXREDIRS, CURLOPTTYPE_LONG, 68),
/* Pass a long set to 1 to get the date of the requested document (if
possible)! Pass a zero to shut it off. */
- CINIT(FILETIME, LONG, 69),
+ CURLOPT(CURLOPT_FILETIME, CURLOPTTYPE_LONG, 69),
/* This points to a linked list of telnet options */
- CINIT(TELNETOPTIONS, OBJECTPOINT, 70),
+ CURLOPT(CURLOPT_TELNETOPTIONS, CURLOPTTYPE_SLISTPOINT, 70),
/* Max amount of cached alive connections */
- CINIT(MAXCONNECTS, LONG, 71),
+ CURLOPT(CURLOPT_MAXCONNECTS, CURLOPTTYPE_LONG, 71),
- CINIT(OBSOLETE72, LONG, 72), /* OBSOLETE, do not use! */
+ /* OBSOLETE, do not use! */
+ CURLOPT(CURLOPT_OBSOLETE72, CURLOPTTYPE_LONG, 72),
/* 73 = OBSOLETE */
/* Set to explicitly use a new connection for the upcoming transfer.
Do not use this unless you're absolutely sure of this, as it makes the
operation slower and is less friendly for the network. */
- CINIT(FRESH_CONNECT, LONG, 74),
+ CURLOPT(CURLOPT_FRESH_CONNECT, CURLOPTTYPE_LONG, 74),
/* Set to explicitly forbid the upcoming transfer's connection to be re-used
when done. Do not use this unless you're absolutely sure of this, as it
makes the operation slower and is less friendly for the network. */
- CINIT(FORBID_REUSE, LONG, 75),
+ CURLOPT(CURLOPT_FORBID_REUSE, CURLOPTTYPE_LONG, 75),
/* Set to a file name that contains random data for libcurl to use to
seed the random engine when doing SSL connects. */
- CINIT(RANDOM_FILE, STRINGPOINT, 76),
+ CURLOPTDEPRECATED(CURLOPT_RANDOM_FILE, CURLOPTTYPE_STRINGPOINT, 76,
+ 7.84.0, "Serves no purpose anymore"),
/* Set to the Entropy Gathering Daemon socket pathname */
- CINIT(EGDSOCKET, STRINGPOINT, 77),
+ CURLOPTDEPRECATED(CURLOPT_EGDSOCKET, CURLOPTTYPE_STRINGPOINT, 77,
+ 7.84.0, "Serves no purpose anymore"),
/* Time-out connect operations after this amount of seconds, if connects are
OK within this time, then fine... This only aborts the connect phase. */
- CINIT(CONNECTTIMEOUT, LONG, 78),
+ CURLOPT(CURLOPT_CONNECTTIMEOUT, CURLOPTTYPE_LONG, 78),
/* Function that will be called to store headers (instead of fwrite). The
* parameters will use fwrite() syntax, make sure to follow them. */
- CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79),
+ CURLOPT(CURLOPT_HEADERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 79),
/* Set this to force the HTTP request to get back to GET. Only really usable
if POST, PUT or a custom request have been used first.
*/
- CINIT(HTTPGET, LONG, 80),
+ CURLOPT(CURLOPT_HTTPGET, CURLOPTTYPE_LONG, 80),
/* Set if we should verify the Common name from the peer certificate in ssl
* handshake, set 1 to check existence, 2 to ensure that it matches the
* provided hostname. */
- CINIT(SSL_VERIFYHOST, LONG, 81),
+ CURLOPT(CURLOPT_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 81),
/* Specify which file name to write all known cookies in after completed
operation. Set file name to "-" (dash) to make it go to stdout. */
- CINIT(COOKIEJAR, STRINGPOINT, 82),
+ CURLOPT(CURLOPT_COOKIEJAR, CURLOPTTYPE_STRINGPOINT, 82),
/* Specify which SSL ciphers to use */
- CINIT(SSL_CIPHER_LIST, STRINGPOINT, 83),
+ CURLOPT(CURLOPT_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 83),
/* Specify which HTTP version to use! This must be set to one of the
CURL_HTTP_VERSION* enums set below. */
- CINIT(HTTP_VERSION, LONG, 84),
+ CURLOPT(CURLOPT_HTTP_VERSION, CURLOPTTYPE_VALUES, 84),
/* Specifically switch on or off the FTP engine's use of the EPSV command. By
default, that one will always be attempted before the more traditional
PASV command. */
- CINIT(FTP_USE_EPSV, LONG, 85),
+ CURLOPT(CURLOPT_FTP_USE_EPSV, CURLOPTTYPE_LONG, 85),
/* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
- CINIT(SSLCERTTYPE, STRINGPOINT, 86),
+ CURLOPT(CURLOPT_SSLCERTTYPE, CURLOPTTYPE_STRINGPOINT, 86),
/* name of the file keeping your private SSL-key */
- CINIT(SSLKEY, STRINGPOINT, 87),
+ CURLOPT(CURLOPT_SSLKEY, CURLOPTTYPE_STRINGPOINT, 87),
/* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
- CINIT(SSLKEYTYPE, STRINGPOINT, 88),
+ CURLOPT(CURLOPT_SSLKEYTYPE, CURLOPTTYPE_STRINGPOINT, 88),
/* crypto engine for the SSL-sub system */
- CINIT(SSLENGINE, STRINGPOINT, 89),
+ CURLOPT(CURLOPT_SSLENGINE, CURLOPTTYPE_STRINGPOINT, 89),
/* set the crypto engine for the SSL-sub system as default
the param has no meaning...
*/
- CINIT(SSLENGINE_DEFAULT, LONG, 90),
+ CURLOPT(CURLOPT_SSLENGINE_DEFAULT, CURLOPTTYPE_LONG, 90),
/* Non-zero value means to use the global dns cache */
- CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* DEPRECATED, do not use! */
+ /* DEPRECATED, do not use! */
+ CURLOPTDEPRECATED(CURLOPT_DNS_USE_GLOBAL_CACHE, CURLOPTTYPE_LONG, 91,
+ 7.11.1, "Use CURLOPT_SHARE"),
/* DNS cache timeout */
- CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
+ CURLOPT(CURLOPT_DNS_CACHE_TIMEOUT, CURLOPTTYPE_LONG, 92),
/* send linked-list of pre-transfer QUOTE commands */
- CINIT(PREQUOTE, OBJECTPOINT, 93),
+ CURLOPT(CURLOPT_PREQUOTE, CURLOPTTYPE_SLISTPOINT, 93),
/* set the debug function */
- CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),
+ CURLOPT(CURLOPT_DEBUGFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 94),
/* set the data for the debug function */
- CINIT(DEBUGDATA, OBJECTPOINT, 95),
+ CURLOPT(CURLOPT_DEBUGDATA, CURLOPTTYPE_CBPOINT, 95),
/* mark this as start of a cookie session */
- CINIT(COOKIESESSION, LONG, 96),
+ CURLOPT(CURLOPT_COOKIESESSION, CURLOPTTYPE_LONG, 96),
/* The CApath directory used to validate the peer certificate
this option is used only if SSL_VERIFYPEER is true */
- CINIT(CAPATH, STRINGPOINT, 97),
+ CURLOPT(CURLOPT_CAPATH, CURLOPTTYPE_STRINGPOINT, 97),
/* Instruct libcurl to use a smaller receive buffer */
- CINIT(BUFFERSIZE, LONG, 98),
+ CURLOPT(CURLOPT_BUFFERSIZE, CURLOPTTYPE_LONG, 98),
/* Instruct libcurl to not use any signal/alarm handlers, even when using
timeouts. This option is useful for multi-threaded applications.
See libcurl-the-guide for more background information. */
- CINIT(NOSIGNAL, LONG, 99),
+ CURLOPT(CURLOPT_NOSIGNAL, CURLOPTTYPE_LONG, 99),
/* Provide a CURLShare for mutexing non-ts data */
- CINIT(SHARE, OBJECTPOINT, 100),
+ CURLOPT(CURLOPT_SHARE, CURLOPTTYPE_OBJECTPOINT, 100),
/* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
CURLPROXY_HTTPS, CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and
CURLPROXY_SOCKS5. */
- CINIT(PROXYTYPE, LONG, 101),
+ CURLOPT(CURLOPT_PROXYTYPE, CURLOPTTYPE_VALUES, 101),
/* Set the Accept-Encoding string. Use this to tell a server you would like
the response to be compressed. Before 7.21.6, this was known as
CURLOPT_ENCODING */
- CINIT(ACCEPT_ENCODING, STRINGPOINT, 102),
+ CURLOPT(CURLOPT_ACCEPT_ENCODING, CURLOPTTYPE_STRINGPOINT, 102),
/* Set pointer to private data */
- CINIT(PRIVATE, OBJECTPOINT, 103),
+ CURLOPT(CURLOPT_PRIVATE, CURLOPTTYPE_OBJECTPOINT, 103),
/* Set aliases for HTTP 200 in the HTTP Response header */
- CINIT(HTTP200ALIASES, OBJECTPOINT, 104),
+ CURLOPT(CURLOPT_HTTP200ALIASES, CURLOPTTYPE_SLISTPOINT, 104),
/* Continue to send authentication (user+password) when following locations,
even when hostname changed. This can potentially send off the name
and password to whatever host the server decides. */
- CINIT(UNRESTRICTED_AUTH, LONG, 105),
+ CURLOPT(CURLOPT_UNRESTRICTED_AUTH, CURLOPTTYPE_LONG, 105),
/* Specifically switch on or off the FTP engine's use of the EPRT command (
it also disables the LPRT attempt). By default, those ones will always be
attempted before the good old traditional PORT command. */
- CINIT(FTP_USE_EPRT, LONG, 106),
+ CURLOPT(CURLOPT_FTP_USE_EPRT, CURLOPTTYPE_LONG, 106),
/* Set this to a bitmask value to enable the particular authentications
methods you like. Use this in combination with CURLOPT_USERPWD.
Note that setting multiple bits may cause extra network round-trips. */
- CINIT(HTTPAUTH, LONG, 107),
+ CURLOPT(CURLOPT_HTTPAUTH, CURLOPTTYPE_VALUES, 107),
- /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx
- in second argument. The function must be matching the
- curl_ssl_ctx_callback proto. */
- CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108),
+ /* Set the ssl context callback function, currently only for OpenSSL or
+ WolfSSL ssl_ctx, or mbedTLS mbedtls_ssl_config in the second argument.
+ The function must match the curl_ssl_ctx_callback prototype. */
+ CURLOPT(CURLOPT_SSL_CTX_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 108),
/* Set the userdata for the ssl context callback function's third
argument */
- CINIT(SSL_CTX_DATA, OBJECTPOINT, 109),
+ CURLOPT(CURLOPT_SSL_CTX_DATA, CURLOPTTYPE_CBPOINT, 109),
/* FTP Option that causes missing dirs to be created on the remote server.
In 7.19.4 we introduced the convenience enums for this option using the
CURLFTP_CREATE_DIR prefix.
*/
- CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110),
+ CURLOPT(CURLOPT_FTP_CREATE_MISSING_DIRS, CURLOPTTYPE_LONG, 110),
/* Set this to a bitmask value to enable the particular authentications
methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
Note that setting multiple bits may cause extra network round-trips. */
- CINIT(PROXYAUTH, LONG, 111),
+ CURLOPT(CURLOPT_PROXYAUTH, CURLOPTTYPE_VALUES, 111),
- /* FTP option that changes the timeout, in seconds, associated with
- getting a response. This is different from transfer timeout time and
- essentially places a demand on the FTP server to acknowledge commands
- in a timely manner. */
- CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),
-#define CURLOPT_SERVER_RESPONSE_TIMEOUT CURLOPT_FTP_RESPONSE_TIMEOUT
+ /* Option that changes the timeout, in seconds, associated with getting a
+ response. This is different from transfer timeout time and essentially
+ places a demand on the server to acknowledge commands in a timely
+ manner. For FTP, SMTP, IMAP and POP3. */
+ CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT, CURLOPTTYPE_LONG, 112),
/* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
- tell libcurl to resolve names to those IP versions only. This only has
- affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */
- CINIT(IPRESOLVE, LONG, 113),
+ tell libcurl to use those IP versions only. This only has effect on
+ systems with support for more than one, i.e IPv4 _and_ IPv6. */
+ CURLOPT(CURLOPT_IPRESOLVE, CURLOPTTYPE_VALUES, 113),
/* Set this option to limit the size of a file that will be downloaded from
an HTTP or FTP server.
Note there is also _LARGE version which adds large file support for
platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
- CINIT(MAXFILESIZE, LONG, 114),
+ CURLOPT(CURLOPT_MAXFILESIZE, CURLOPTTYPE_LONG, 114),
/* See the comment for INFILESIZE above, but in short, specifies
* the size of the file being uploaded. -1 means unknown.
*/
- CINIT(INFILESIZE_LARGE, OFF_T, 115),
+ CURLOPT(CURLOPT_INFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 115),
- /* Sets the continuation offset. There is also a LONG version of this;
- * look above for RESUME_FROM.
+ /* Sets the continuation offset. There is also a CURLOPTTYPE_LONG version
+ * of this; look above for RESUME_FROM.
*/
- CINIT(RESUME_FROM_LARGE, OFF_T, 116),
+ CURLOPT(CURLOPT_RESUME_FROM_LARGE, CURLOPTTYPE_OFF_T, 116),
/* Sets the maximum size of data that will be downloaded from
* an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
*/
- CINIT(MAXFILESIZE_LARGE, OFF_T, 117),
+ CURLOPT(CURLOPT_MAXFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 117),
/* Set this option to the file name of your .netrc file you want libcurl
to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
a poor attempt to find the user's home directory and check for a .netrc
file in there. */
- CINIT(NETRC_FILE, STRINGPOINT, 118),
+ CURLOPT(CURLOPT_NETRC_FILE, CURLOPTTYPE_STRINGPOINT, 118),
/* Enable SSL/TLS for FTP, pick one of:
CURLUSESSL_TRY - try using SSL, proceed anyway otherwise
CURLUSESSL_CONTROL - SSL for the control connection or fail
CURLUSESSL_ALL - SSL for all communication or fail
*/
- CINIT(USE_SSL, LONG, 119),
+ CURLOPT(CURLOPT_USE_SSL, CURLOPTTYPE_VALUES, 119),
/* The _LARGE version of the standard POSTFIELDSIZE option */
- CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),
+ CURLOPT(CURLOPT_POSTFIELDSIZE_LARGE, CURLOPTTYPE_OFF_T, 120),
/* Enable/disable the TCP Nagle algorithm */
- CINIT(TCP_NODELAY, LONG, 121),
+ CURLOPT(CURLOPT_TCP_NODELAY, CURLOPTTYPE_LONG, 121),
/* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
/* 123 OBSOLETE. Gone in 7.16.0 */
@@ -1405,143 +1575,151 @@ typedef enum {
CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS
CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL
*/
- CINIT(FTPSSLAUTH, LONG, 129),
+ CURLOPT(CURLOPT_FTPSSLAUTH, CURLOPTTYPE_VALUES, 129),
- CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),
- CINIT(IOCTLDATA, OBJECTPOINT, 131),
+ CURLOPTDEPRECATED(CURLOPT_IOCTLFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 130,
+ 7.18.0, "Use CURLOPT_SEEKFUNCTION"),
+ CURLOPTDEPRECATED(CURLOPT_IOCTLDATA, CURLOPTTYPE_CBPOINT, 131,
+ 7.18.0, "Use CURLOPT_SEEKDATA"),
/* 132 OBSOLETE. Gone in 7.16.0 */
/* 133 OBSOLETE. Gone in 7.16.0 */
- /* zero terminated string for pass on to the FTP server when asked for
+ /* null-terminated string for pass on to the FTP server when asked for
"account" info */
- CINIT(FTP_ACCOUNT, STRINGPOINT, 134),
+ CURLOPT(CURLOPT_FTP_ACCOUNT, CURLOPTTYPE_STRINGPOINT, 134),
/* feed cookie into cookie engine */
- CINIT(COOKIELIST, STRINGPOINT, 135),
+ CURLOPT(CURLOPT_COOKIELIST, CURLOPTTYPE_STRINGPOINT, 135),
/* ignore Content-Length */
- CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),
+ CURLOPT(CURLOPT_IGNORE_CONTENT_LENGTH, CURLOPTTYPE_LONG, 136),
/* Set to non-zero to skip the IP address received in a 227 PASV FTP server
response. Typically used for FTP-SSL purposes but is not restricted to
that. libcurl will then instead use the same IP address it used for the
control connection. */
- CINIT(FTP_SKIP_PASV_IP, LONG, 137),
+ CURLOPT(CURLOPT_FTP_SKIP_PASV_IP, CURLOPTTYPE_LONG, 137),
/* Select "file method" to use when doing FTP, see the curl_ftpmethod
above. */
- CINIT(FTP_FILEMETHOD, LONG, 138),
+ CURLOPT(CURLOPT_FTP_FILEMETHOD, CURLOPTTYPE_VALUES, 138),
/* Local port number to bind the socket to */
- CINIT(LOCALPORT, LONG, 139),
+ CURLOPT(CURLOPT_LOCALPORT, CURLOPTTYPE_LONG, 139),
/* Number of ports to try, including the first one set with LOCALPORT.
Thus, setting it to 1 will make no additional attempts but the first.
*/
- CINIT(LOCALPORTRANGE, LONG, 140),
+ CURLOPT(CURLOPT_LOCALPORTRANGE, CURLOPTTYPE_LONG, 140),
/* no transfer, set up connection and let application use the socket by
extracting it with CURLINFO_LASTSOCKET */
- CINIT(CONNECT_ONLY, LONG, 141),
+ CURLOPT(CURLOPT_CONNECT_ONLY, CURLOPTTYPE_LONG, 141),
/* Function that will be called to convert from the
network encoding (instead of using the iconv calls in libcurl) */
- CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),
+ CURLOPTDEPRECATED(CURLOPT_CONV_FROM_NETWORK_FUNCTION,
+ CURLOPTTYPE_FUNCTIONPOINT, 142,
+ 7.82.0, "Serves no purpose anymore"),
/* Function that will be called to convert to the
network encoding (instead of using the iconv calls in libcurl) */
- CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),
+ CURLOPTDEPRECATED(CURLOPT_CONV_TO_NETWORK_FUNCTION,
+ CURLOPTTYPE_FUNCTIONPOINT, 143,
+ 7.82.0, "Serves no purpose anymore"),
/* Function that will be called to convert from UTF8
(instead of using the iconv calls in libcurl)
Note that this is used only for SSL certificate processing */
- CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),
+ CURLOPTDEPRECATED(CURLOPT_CONV_FROM_UTF8_FUNCTION,
+ CURLOPTTYPE_FUNCTIONPOINT, 144,
+ 7.82.0, "Serves no purpose anymore"),
/* if the connection proceeds too quickly then need to slow it down */
/* limit-rate: maximum number of bytes per second to send or receive */
- CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),
- CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
+ CURLOPT(CURLOPT_MAX_SEND_SPEED_LARGE, CURLOPTTYPE_OFF_T, 145),
+ CURLOPT(CURLOPT_MAX_RECV_SPEED_LARGE, CURLOPTTYPE_OFF_T, 146),
/* Pointer to command string to send if USER/PASS fails. */
- CINIT(FTP_ALTERNATIVE_TO_USER, STRINGPOINT, 147),
+ CURLOPT(CURLOPT_FTP_ALTERNATIVE_TO_USER, CURLOPTTYPE_STRINGPOINT, 147),
/* callback function for setting socket options */
- CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),
- CINIT(SOCKOPTDATA, OBJECTPOINT, 149),
+ CURLOPT(CURLOPT_SOCKOPTFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 148),
+ CURLOPT(CURLOPT_SOCKOPTDATA, CURLOPTTYPE_CBPOINT, 149),
/* set to 0 to disable session ID re-use for this transfer, default is
enabled (== 1) */
- CINIT(SSL_SESSIONID_CACHE, LONG, 150),
+ CURLOPT(CURLOPT_SSL_SESSIONID_CACHE, CURLOPTTYPE_LONG, 150),
/* allowed SSH authentication methods */
- CINIT(SSH_AUTH_TYPES, LONG, 151),
+ CURLOPT(CURLOPT_SSH_AUTH_TYPES, CURLOPTTYPE_VALUES, 151),
/* Used by scp/sftp to do public/private key authentication */
- CINIT(SSH_PUBLIC_KEYFILE, STRINGPOINT, 152),
- CINIT(SSH_PRIVATE_KEYFILE, STRINGPOINT, 153),
+ CURLOPT(CURLOPT_SSH_PUBLIC_KEYFILE, CURLOPTTYPE_STRINGPOINT, 152),
+ CURLOPT(CURLOPT_SSH_PRIVATE_KEYFILE, CURLOPTTYPE_STRINGPOINT, 153),
/* Send CCC (Clear Command Channel) after authentication */
- CINIT(FTP_SSL_CCC, LONG, 154),
+ CURLOPT(CURLOPT_FTP_SSL_CCC, CURLOPTTYPE_LONG, 154),
/* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */
- CINIT(TIMEOUT_MS, LONG, 155),
- CINIT(CONNECTTIMEOUT_MS, LONG, 156),
+ CURLOPT(CURLOPT_TIMEOUT_MS, CURLOPTTYPE_LONG, 155),
+ CURLOPT(CURLOPT_CONNECTTIMEOUT_MS, CURLOPTTYPE_LONG, 156),
/* set to zero to disable the libcurl's decoding and thus pass the raw body
data to the application even when it is encoded/compressed */
- CINIT(HTTP_TRANSFER_DECODING, LONG, 157),
- CINIT(HTTP_CONTENT_DECODING, LONG, 158),
+ CURLOPT(CURLOPT_HTTP_TRANSFER_DECODING, CURLOPTTYPE_LONG, 157),
+ CURLOPT(CURLOPT_HTTP_CONTENT_DECODING, CURLOPTTYPE_LONG, 158),
/* Permission used when creating new files and directories on the remote
server for protocols that support it, SFTP/SCP/FILE */
- CINIT(NEW_FILE_PERMS, LONG, 159),
- CINIT(NEW_DIRECTORY_PERMS, LONG, 160),
+ CURLOPT(CURLOPT_NEW_FILE_PERMS, CURLOPTTYPE_LONG, 159),
+ CURLOPT(CURLOPT_NEW_DIRECTORY_PERMS, CURLOPTTYPE_LONG, 160),
- /* Set the behaviour of POST when redirecting. Values must be set to one
+ /* Set the behavior of POST when redirecting. Values must be set to one
of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */
- CINIT(POSTREDIR, LONG, 161),
+ CURLOPT(CURLOPT_POSTREDIR, CURLOPTTYPE_VALUES, 161),
/* used by scp/sftp to verify the host's public key */
- CINIT(SSH_HOST_PUBLIC_KEY_MD5, STRINGPOINT, 162),
+ CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, CURLOPTTYPE_STRINGPOINT, 162),
/* Callback function for opening socket (instead of socket(2)). Optionally,
callback is able change the address or refuse to connect returning
CURL_SOCKET_BAD. The callback should have type
curl_opensocket_callback */
- CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163),
- CINIT(OPENSOCKETDATA, OBJECTPOINT, 164),
+ CURLOPT(CURLOPT_OPENSOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 163),
+ CURLOPT(CURLOPT_OPENSOCKETDATA, CURLOPTTYPE_CBPOINT, 164),
/* POST volatile input fields. */
- CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165),
+ CURLOPT(CURLOPT_COPYPOSTFIELDS, CURLOPTTYPE_OBJECTPOINT, 165),
/* set transfer mode (;type=) when doing FTP via an HTTP proxy */
- CINIT(PROXY_TRANSFER_MODE, LONG, 166),
+ CURLOPT(CURLOPT_PROXY_TRANSFER_MODE, CURLOPTTYPE_LONG, 166),
/* Callback function for seeking in the input stream */
- CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167),
- CINIT(SEEKDATA, OBJECTPOINT, 168),
+ CURLOPT(CURLOPT_SEEKFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 167),
+ CURLOPT(CURLOPT_SEEKDATA, CURLOPTTYPE_CBPOINT, 168),
/* CRL file */
- CINIT(CRLFILE, STRINGPOINT, 169),
+ CURLOPT(CURLOPT_CRLFILE, CURLOPTTYPE_STRINGPOINT, 169),
/* Issuer certificate */
- CINIT(ISSUERCERT, STRINGPOINT, 170),
+ CURLOPT(CURLOPT_ISSUERCERT, CURLOPTTYPE_STRINGPOINT, 170),
/* (IPv6) Address scope */
- CINIT(ADDRESS_SCOPE, LONG, 171),
+ CURLOPT(CURLOPT_ADDRESS_SCOPE, CURLOPTTYPE_LONG, 171),
/* Collect certificate chain info and allow it to get retrievable with
CURLINFO_CERTINFO after the transfer is complete. */
- CINIT(CERTINFO, LONG, 172),
+ CURLOPT(CURLOPT_CERTINFO, CURLOPTTYPE_LONG, 172),
/* "name" and "pwd" to use when fetching. */
- CINIT(USERNAME, STRINGPOINT, 173),
- CINIT(PASSWORD, STRINGPOINT, 174),
+ CURLOPT(CURLOPT_USERNAME, CURLOPTTYPE_STRINGPOINT, 173),
+ CURLOPT(CURLOPT_PASSWORD, CURLOPTTYPE_STRINGPOINT, 174),
/* "name" and "pwd" to use with Proxy when fetching. */
- CINIT(PROXYUSERNAME, STRINGPOINT, 175),
- CINIT(PROXYPASSWORD, STRINGPOINT, 176),
+ CURLOPT(CURLOPT_PROXYUSERNAME, CURLOPTTYPE_STRINGPOINT, 175),
+ CURLOPT(CURLOPT_PROXYPASSWORD, CURLOPTTYPE_STRINGPOINT, 176),
/* Comma separated list of hostnames defining no-proxy zones. These should
match both hostnames directly, and hostnames within a domain. For
@@ -1550,103 +1728,107 @@ typedef enum {
implementations of this, .local.com will be considered to be the same as
local.com. A single * is the only valid wildcard, and effectively
disables the use of proxy. */
- CINIT(NOPROXY, STRINGPOINT, 177),
+ CURLOPT(CURLOPT_NOPROXY, CURLOPTTYPE_STRINGPOINT, 177),
/* block size for TFTP transfers */
- CINIT(TFTP_BLKSIZE, LONG, 178),
+ CURLOPT(CURLOPT_TFTP_BLKSIZE, CURLOPTTYPE_LONG, 178),
/* Socks Service */
- CINIT(SOCKS5_GSSAPI_SERVICE, STRINGPOINT, 179), /* DEPRECATED, do not use! */
+ /* DEPRECATED, do not use! */
+ CURLOPTDEPRECATED(CURLOPT_SOCKS5_GSSAPI_SERVICE,
+ CURLOPTTYPE_STRINGPOINT, 179,
+ 7.49.0, "Use CURLOPT_PROXY_SERVICE_NAME"),
/* Socks Service */
- CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),
+ CURLOPT(CURLOPT_SOCKS5_GSSAPI_NEC, CURLOPTTYPE_LONG, 180),
/* set the bitmask for the protocols that are allowed to be used for the
transfer, which thus helps the app which takes URLs from users or other
external inputs and want to restrict what protocol(s) to deal
with. Defaults to CURLPROTO_ALL. */
- CINIT(PROTOCOLS, LONG, 181),
+ CURLOPTDEPRECATED(CURLOPT_PROTOCOLS, CURLOPTTYPE_LONG, 181,
+ 7.85.0, "Use CURLOPT_PROTOCOLS_STR"),
/* set the bitmask for the protocols that libcurl is allowed to follow to,
as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
- to be set in both bitmasks to be allowed to get redirected to. Defaults
- to all protocols except FILE and SCP. */
- CINIT(REDIR_PROTOCOLS, LONG, 182),
+ to be set in both bitmasks to be allowed to get redirected to. */
+ CURLOPTDEPRECATED(CURLOPT_REDIR_PROTOCOLS, CURLOPTTYPE_LONG, 182,
+ 7.85.0, "Use CURLOPT_REDIR_PROTOCOLS_STR"),
/* set the SSH knownhost file name to use */
- CINIT(SSH_KNOWNHOSTS, STRINGPOINT, 183),
+ CURLOPT(CURLOPT_SSH_KNOWNHOSTS, CURLOPTTYPE_STRINGPOINT, 183),
/* set the SSH host key callback, must point to a curl_sshkeycallback
function */
- CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),
+ CURLOPT(CURLOPT_SSH_KEYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 184),
/* set the SSH host key callback custom pointer */
- CINIT(SSH_KEYDATA, OBJECTPOINT, 185),
+ CURLOPT(CURLOPT_SSH_KEYDATA, CURLOPTTYPE_CBPOINT, 185),
/* set the SMTP mail originator */
- CINIT(MAIL_FROM, STRINGPOINT, 186),
+ CURLOPT(CURLOPT_MAIL_FROM, CURLOPTTYPE_STRINGPOINT, 186),
/* set the list of SMTP mail receiver(s) */
- CINIT(MAIL_RCPT, OBJECTPOINT, 187),
+ CURLOPT(CURLOPT_MAIL_RCPT, CURLOPTTYPE_SLISTPOINT, 187),
/* FTP: send PRET before PASV */
- CINIT(FTP_USE_PRET, LONG, 188),
+ CURLOPT(CURLOPT_FTP_USE_PRET, CURLOPTTYPE_LONG, 188),
/* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */
- CINIT(RTSP_REQUEST, LONG, 189),
+ CURLOPT(CURLOPT_RTSP_REQUEST, CURLOPTTYPE_VALUES, 189),
/* The RTSP session identifier */
- CINIT(RTSP_SESSION_ID, STRINGPOINT, 190),
+ CURLOPT(CURLOPT_RTSP_SESSION_ID, CURLOPTTYPE_STRINGPOINT, 190),
/* The RTSP stream URI */
- CINIT(RTSP_STREAM_URI, STRINGPOINT, 191),
+ CURLOPT(CURLOPT_RTSP_STREAM_URI, CURLOPTTYPE_STRINGPOINT, 191),
/* The Transport: header to use in RTSP requests */
- CINIT(RTSP_TRANSPORT, STRINGPOINT, 192),
+ CURLOPT(CURLOPT_RTSP_TRANSPORT, CURLOPTTYPE_STRINGPOINT, 192),
/* Manually initialize the client RTSP CSeq for this handle */
- CINIT(RTSP_CLIENT_CSEQ, LONG, 193),
+ CURLOPT(CURLOPT_RTSP_CLIENT_CSEQ, CURLOPTTYPE_LONG, 193),
/* Manually initialize the server RTSP CSeq for this handle */
- CINIT(RTSP_SERVER_CSEQ, LONG, 194),
+ CURLOPT(CURLOPT_RTSP_SERVER_CSEQ, CURLOPTTYPE_LONG, 194),
/* The stream to pass to INTERLEAVEFUNCTION. */
- CINIT(INTERLEAVEDATA, OBJECTPOINT, 195),
+ CURLOPT(CURLOPT_INTERLEAVEDATA, CURLOPTTYPE_CBPOINT, 195),
/* Let the application define a custom write method for RTP data */
- CINIT(INTERLEAVEFUNCTION, FUNCTIONPOINT, 196),
+ CURLOPT(CURLOPT_INTERLEAVEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 196),
/* Turn on wildcard matching */
- CINIT(WILDCARDMATCH, LONG, 197),
+ CURLOPT(CURLOPT_WILDCARDMATCH, CURLOPTTYPE_LONG, 197),
/* Directory matching callback called before downloading of an
individual file (chunk) started */
- CINIT(CHUNK_BGN_FUNCTION, FUNCTIONPOINT, 198),
+ CURLOPT(CURLOPT_CHUNK_BGN_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 198),
/* Directory matching callback called after the file (chunk)
was downloaded, or skipped */
- CINIT(CHUNK_END_FUNCTION, FUNCTIONPOINT, 199),
+ CURLOPT(CURLOPT_CHUNK_END_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 199),
/* Change match (fnmatch-like) callback for wildcard matching */
- CINIT(FNMATCH_FUNCTION, FUNCTIONPOINT, 200),
+ CURLOPT(CURLOPT_FNMATCH_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 200),
/* Let the application define custom chunk data pointer */
- CINIT(CHUNK_DATA, OBJECTPOINT, 201),
+ CURLOPT(CURLOPT_CHUNK_DATA, CURLOPTTYPE_CBPOINT, 201),
/* FNMATCH_FUNCTION user pointer */
- CINIT(FNMATCH_DATA, OBJECTPOINT, 202),
+ CURLOPT(CURLOPT_FNMATCH_DATA, CURLOPTTYPE_CBPOINT, 202),
/* send linked-list of name:port:address sets */
- CINIT(RESOLVE, OBJECTPOINT, 203),
+ CURLOPT(CURLOPT_RESOLVE, CURLOPTTYPE_SLISTPOINT, 203),
/* Set a username for authenticated TLS */
- CINIT(TLSAUTH_USERNAME, STRINGPOINT, 204),
+ CURLOPT(CURLOPT_TLSAUTH_USERNAME, CURLOPTTYPE_STRINGPOINT, 204),
/* Set a password for authenticated TLS */
- CINIT(TLSAUTH_PASSWORD, STRINGPOINT, 205),
+ CURLOPT(CURLOPT_TLSAUTH_PASSWORD, CURLOPTTYPE_STRINGPOINT, 205),
/* Set authentication type for authenticated TLS */
- CINIT(TLSAUTH_TYPE, STRINGPOINT, 206),
+ CURLOPT(CURLOPT_TLSAUTH_TYPE, CURLOPTTYPE_STRINGPOINT, 206),
/* Set to 1 to enable the "TE:" header in HTTP requests to ask for
compressed transfer-encoded responses. Set to 0 to disable the use of TE:
@@ -1658,265 +1840,368 @@ typedef enum {
option is set to 1.
*/
- CINIT(TRANSFER_ENCODING, LONG, 207),
+ CURLOPT(CURLOPT_TRANSFER_ENCODING, CURLOPTTYPE_LONG, 207),
/* Callback function for closing socket (instead of close(2)). The callback
should have type curl_closesocket_callback */
- CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208),
- CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209),
+ CURLOPT(CURLOPT_CLOSESOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 208),
+ CURLOPT(CURLOPT_CLOSESOCKETDATA, CURLOPTTYPE_CBPOINT, 209),
/* allow GSSAPI credential delegation */
- CINIT(GSSAPI_DELEGATION, LONG, 210),
+ CURLOPT(CURLOPT_GSSAPI_DELEGATION, CURLOPTTYPE_VALUES, 210),
/* Set the name servers to use for DNS resolution */
- CINIT(DNS_SERVERS, STRINGPOINT, 211),
+ CURLOPT(CURLOPT_DNS_SERVERS, CURLOPTTYPE_STRINGPOINT, 211),
/* Time-out accept operations (currently for FTP only) after this amount
of milliseconds. */
- CINIT(ACCEPTTIMEOUT_MS, LONG, 212),
+ CURLOPT(CURLOPT_ACCEPTTIMEOUT_MS, CURLOPTTYPE_LONG, 212),
/* Set TCP keepalive */
- CINIT(TCP_KEEPALIVE, LONG, 213),
+ CURLOPT(CURLOPT_TCP_KEEPALIVE, CURLOPTTYPE_LONG, 213),
/* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */
- CINIT(TCP_KEEPIDLE, LONG, 214),
- CINIT(TCP_KEEPINTVL, LONG, 215),
+ CURLOPT(CURLOPT_TCP_KEEPIDLE, CURLOPTTYPE_LONG, 214),
+ CURLOPT(CURLOPT_TCP_KEEPINTVL, CURLOPTTYPE_LONG, 215),
/* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */
- CINIT(SSL_OPTIONS, LONG, 216),
+ CURLOPT(CURLOPT_SSL_OPTIONS, CURLOPTTYPE_VALUES, 216),
/* Set the SMTP auth originator */
- CINIT(MAIL_AUTH, STRINGPOINT, 217),
+ CURLOPT(CURLOPT_MAIL_AUTH, CURLOPTTYPE_STRINGPOINT, 217),
/* Enable/disable SASL initial response */
- CINIT(SASL_IR, LONG, 218),
+ CURLOPT(CURLOPT_SASL_IR, CURLOPTTYPE_LONG, 218),
/* Function that will be called instead of the internal progress display
* function. This function should be defined as the curl_xferinfo_callback
* prototype defines. (Deprecates CURLOPT_PROGRESSFUNCTION) */
- CINIT(XFERINFOFUNCTION, FUNCTIONPOINT, 219),
+ CURLOPT(CURLOPT_XFERINFOFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 219),
/* The XOAUTH2 bearer token */
- CINIT(XOAUTH2_BEARER, STRINGPOINT, 220),
+ CURLOPT(CURLOPT_XOAUTH2_BEARER, CURLOPTTYPE_STRINGPOINT, 220),
/* Set the interface string to use as outgoing network
* interface for DNS requests.
* Only supported by the c-ares DNS backend */
- CINIT(DNS_INTERFACE, STRINGPOINT, 221),
+ CURLOPT(CURLOPT_DNS_INTERFACE, CURLOPTTYPE_STRINGPOINT, 221),
/* Set the local IPv4 address to use for outgoing DNS requests.
* Only supported by the c-ares DNS backend */
- CINIT(DNS_LOCAL_IP4, STRINGPOINT, 222),
+ CURLOPT(CURLOPT_DNS_LOCAL_IP4, CURLOPTTYPE_STRINGPOINT, 222),
/* Set the local IPv6 address to use for outgoing DNS requests.
* Only supported by the c-ares DNS backend */
- CINIT(DNS_LOCAL_IP6, STRINGPOINT, 223),
+ CURLOPT(CURLOPT_DNS_LOCAL_IP6, CURLOPTTYPE_STRINGPOINT, 223),
/* Set authentication options directly */
- CINIT(LOGIN_OPTIONS, STRINGPOINT, 224),
+ CURLOPT(CURLOPT_LOGIN_OPTIONS, CURLOPTTYPE_STRINGPOINT, 224),
/* Enable/disable TLS NPN extension (http2 over ssl might fail without) */
- CINIT(SSL_ENABLE_NPN, LONG, 225),
+ CURLOPTDEPRECATED(CURLOPT_SSL_ENABLE_NPN, CURLOPTTYPE_LONG, 225,
+ 7.86.0, "Has no function"),
/* Enable/disable TLS ALPN extension (http2 over ssl might fail without) */
- CINIT(SSL_ENABLE_ALPN, LONG, 226),
+ CURLOPT(CURLOPT_SSL_ENABLE_ALPN, CURLOPTTYPE_LONG, 226),
- /* Time to wait for a response to a HTTP request containing an
+ /* Time to wait for a response to an HTTP request containing an
* Expect: 100-continue header before sending the data anyway. */
- CINIT(EXPECT_100_TIMEOUT_MS, LONG, 227),
+ CURLOPT(CURLOPT_EXPECT_100_TIMEOUT_MS, CURLOPTTYPE_LONG, 227),
/* This points to a linked list of headers used for proxy requests only,
struct curl_slist kind */
- CINIT(PROXYHEADER, OBJECTPOINT, 228),
+ CURLOPT(CURLOPT_PROXYHEADER, CURLOPTTYPE_SLISTPOINT, 228),
/* Pass in a bitmask of "header options" */
- CINIT(HEADEROPT, LONG, 229),
+ CURLOPT(CURLOPT_HEADEROPT, CURLOPTTYPE_VALUES, 229),
/* The public key in DER form used to validate the peer public key
this option is used only if SSL_VERIFYPEER is true */
- CINIT(PINNEDPUBLICKEY, STRINGPOINT, 230),
+ CURLOPT(CURLOPT_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 230),
/* Path to Unix domain socket */
- CINIT(UNIX_SOCKET_PATH, STRINGPOINT, 231),
+ CURLOPT(CURLOPT_UNIX_SOCKET_PATH, CURLOPTTYPE_STRINGPOINT, 231),
/* Set if we should verify the certificate status. */
- CINIT(SSL_VERIFYSTATUS, LONG, 232),
+ CURLOPT(CURLOPT_SSL_VERIFYSTATUS, CURLOPTTYPE_LONG, 232),
/* Set if we should enable TLS false start. */
- CINIT(SSL_FALSESTART, LONG, 233),
+ CURLOPT(CURLOPT_SSL_FALSESTART, CURLOPTTYPE_LONG, 233),
/* Do not squash dot-dot sequences */
- CINIT(PATH_AS_IS, LONG, 234),
+ CURLOPT(CURLOPT_PATH_AS_IS, CURLOPTTYPE_LONG, 234),
/* Proxy Service Name */
- CINIT(PROXY_SERVICE_NAME, STRINGPOINT, 235),
+ CURLOPT(CURLOPT_PROXY_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 235),
/* Service Name */
- CINIT(SERVICE_NAME, STRINGPOINT, 236),
+ CURLOPT(CURLOPT_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 236),
/* Wait/don't wait for pipe/mutex to clarify */
- CINIT(PIPEWAIT, LONG, 237),
+ CURLOPT(CURLOPT_PIPEWAIT, CURLOPTTYPE_LONG, 237),
/* Set the protocol used when curl is given a URL without a protocol */
- CINIT(DEFAULT_PROTOCOL, STRINGPOINT, 238),
+ CURLOPT(CURLOPT_DEFAULT_PROTOCOL, CURLOPTTYPE_STRINGPOINT, 238),
/* Set stream weight, 1 - 256 (default is 16) */
- CINIT(STREAM_WEIGHT, LONG, 239),
+ CURLOPT(CURLOPT_STREAM_WEIGHT, CURLOPTTYPE_LONG, 239),
/* Set stream dependency on another CURL handle */
- CINIT(STREAM_DEPENDS, OBJECTPOINT, 240),
+ CURLOPT(CURLOPT_STREAM_DEPENDS, CURLOPTTYPE_OBJECTPOINT, 240),
/* Set E-xclusive stream dependency on another CURL handle */
- CINIT(STREAM_DEPENDS_E, OBJECTPOINT, 241),
+ CURLOPT(CURLOPT_STREAM_DEPENDS_E, CURLOPTTYPE_OBJECTPOINT, 241),
/* Do not send any tftp option requests to the server */
- CINIT(TFTP_NO_OPTIONS, LONG, 242),
+ CURLOPT(CURLOPT_TFTP_NO_OPTIONS, CURLOPTTYPE_LONG, 242),
/* Linked-list of host:port:connect-to-host:connect-to-port,
overrides the URL's host:port (only for the network layer) */
- CINIT(CONNECT_TO, OBJECTPOINT, 243),
+ CURLOPT(CURLOPT_CONNECT_TO, CURLOPTTYPE_SLISTPOINT, 243),
/* Set TCP Fast Open */
- CINIT(TCP_FASTOPEN, LONG, 244),
+ CURLOPT(CURLOPT_TCP_FASTOPEN, CURLOPTTYPE_LONG, 244),
/* Continue to send data if the server responds early with an
* HTTP status code >= 300 */
- CINIT(KEEP_SENDING_ON_ERROR, LONG, 245),
+ CURLOPT(CURLOPT_KEEP_SENDING_ON_ERROR, CURLOPTTYPE_LONG, 245),
/* The CApath or CAfile used to validate the proxy certificate
this option is used only if PROXY_SSL_VERIFYPEER is true */
- CINIT(PROXY_CAINFO, STRINGPOINT, 246),
+ CURLOPT(CURLOPT_PROXY_CAINFO, CURLOPTTYPE_STRINGPOINT, 246),
/* The CApath directory used to validate the proxy certificate
this option is used only if PROXY_SSL_VERIFYPEER is true */
- CINIT(PROXY_CAPATH, STRINGPOINT, 247),
+ CURLOPT(CURLOPT_PROXY_CAPATH, CURLOPTTYPE_STRINGPOINT, 247),
/* Set if we should verify the proxy in ssl handshake,
set 1 to verify. */
- CINIT(PROXY_SSL_VERIFYPEER, LONG, 248),
+ CURLOPT(CURLOPT_PROXY_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 248),
/* Set if we should verify the Common name from the proxy certificate in ssl
* handshake, set 1 to check existence, 2 to ensure that it matches
* the provided hostname. */
- CINIT(PROXY_SSL_VERIFYHOST, LONG, 249),
+ CURLOPT(CURLOPT_PROXY_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 249),
/* What version to specifically try to use for proxy.
See CURL_SSLVERSION defines below. */
- CINIT(PROXY_SSLVERSION, LONG, 250),
+ CURLOPT(CURLOPT_PROXY_SSLVERSION, CURLOPTTYPE_VALUES, 250),
/* Set a username for authenticated TLS for proxy */
- CINIT(PROXY_TLSAUTH_USERNAME, STRINGPOINT, 251),
+ CURLOPT(CURLOPT_PROXY_TLSAUTH_USERNAME, CURLOPTTYPE_STRINGPOINT, 251),
/* Set a password for authenticated TLS for proxy */
- CINIT(PROXY_TLSAUTH_PASSWORD, STRINGPOINT, 252),
+ CURLOPT(CURLOPT_PROXY_TLSAUTH_PASSWORD, CURLOPTTYPE_STRINGPOINT, 252),
/* Set authentication type for authenticated TLS for proxy */
- CINIT(PROXY_TLSAUTH_TYPE, STRINGPOINT, 253),
+ CURLOPT(CURLOPT_PROXY_TLSAUTH_TYPE, CURLOPTTYPE_STRINGPOINT, 253),
/* name of the file keeping your private SSL-certificate for proxy */
- CINIT(PROXY_SSLCERT, STRINGPOINT, 254),
+ CURLOPT(CURLOPT_PROXY_SSLCERT, CURLOPTTYPE_STRINGPOINT, 254),
/* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") for
proxy */
- CINIT(PROXY_SSLCERTTYPE, STRINGPOINT, 255),
+ CURLOPT(CURLOPT_PROXY_SSLCERTTYPE, CURLOPTTYPE_STRINGPOINT, 255),
/* name of the file keeping your private SSL-key for proxy */
- CINIT(PROXY_SSLKEY, STRINGPOINT, 256),
+ CURLOPT(CURLOPT_PROXY_SSLKEY, CURLOPTTYPE_STRINGPOINT, 256),
/* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") for
proxy */
- CINIT(PROXY_SSLKEYTYPE, STRINGPOINT, 257),
+ CURLOPT(CURLOPT_PROXY_SSLKEYTYPE, CURLOPTTYPE_STRINGPOINT, 257),
/* password for the SSL private key for proxy */
- CINIT(PROXY_KEYPASSWD, STRINGPOINT, 258),
+ CURLOPT(CURLOPT_PROXY_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 258),
/* Specify which SSL ciphers to use for proxy */
- CINIT(PROXY_SSL_CIPHER_LIST, STRINGPOINT, 259),
+ CURLOPT(CURLOPT_PROXY_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 259),
/* CRL file for proxy */
- CINIT(PROXY_CRLFILE, STRINGPOINT, 260),
+ CURLOPT(CURLOPT_PROXY_CRLFILE, CURLOPTTYPE_STRINGPOINT, 260),
/* Enable/disable specific SSL features with a bitmask for proxy, see
CURLSSLOPT_* */
- CINIT(PROXY_SSL_OPTIONS, LONG, 261),
+ CURLOPT(CURLOPT_PROXY_SSL_OPTIONS, CURLOPTTYPE_LONG, 261),
/* Name of pre proxy to use. */
- CINIT(PRE_PROXY, STRINGPOINT, 262),
+ CURLOPT(CURLOPT_PRE_PROXY, CURLOPTTYPE_STRINGPOINT, 262),
/* The public key in DER form used to validate the proxy public key
this option is used only if PROXY_SSL_VERIFYPEER is true */
- CINIT(PROXY_PINNEDPUBLICKEY, STRINGPOINT, 263),
+ CURLOPT(CURLOPT_PROXY_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 263),
/* Path to an abstract Unix domain socket */
- CINIT(ABSTRACT_UNIX_SOCKET, STRINGPOINT, 264),
+ CURLOPT(CURLOPT_ABSTRACT_UNIX_SOCKET, CURLOPTTYPE_STRINGPOINT, 264),
/* Suppress proxy CONNECT response headers from user callbacks */
- CINIT(SUPPRESS_CONNECT_HEADERS, LONG, 265),
+ CURLOPT(CURLOPT_SUPPRESS_CONNECT_HEADERS, CURLOPTTYPE_LONG, 265),
/* The request target, instead of extracted from the URL */
- CINIT(REQUEST_TARGET, STRINGPOINT, 266),
+ CURLOPT(CURLOPT_REQUEST_TARGET, CURLOPTTYPE_STRINGPOINT, 266),
/* bitmask of allowed auth methods for connections to SOCKS5 proxies */
- CINIT(SOCKS5_AUTH, LONG, 267),
+ CURLOPT(CURLOPT_SOCKS5_AUTH, CURLOPTTYPE_LONG, 267),
/* Enable/disable SSH compression */
- CINIT(SSH_COMPRESSION, LONG, 268),
+ CURLOPT(CURLOPT_SSH_COMPRESSION, CURLOPTTYPE_LONG, 268),
/* Post MIME data. */
- CINIT(MIMEPOST, OBJECTPOINT, 269),
+ CURLOPT(CURLOPT_MIMEPOST, CURLOPTTYPE_OBJECTPOINT, 269),
/* Time to use with the CURLOPT_TIMECONDITION. Specified in number of
seconds since 1 Jan 1970. */
- CINIT(TIMEVALUE_LARGE, OFF_T, 270),
+ CURLOPT(CURLOPT_TIMEVALUE_LARGE, CURLOPTTYPE_OFF_T, 270),
/* Head start in milliseconds to give happy eyeballs. */
- CINIT(HAPPY_EYEBALLS_TIMEOUT_MS, LONG, 271),
+ CURLOPT(CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, CURLOPTTYPE_LONG, 271),
/* Function that will be called before a resolver request is made */
- CINIT(RESOLVER_START_FUNCTION, FUNCTIONPOINT, 272),
+ CURLOPT(CURLOPT_RESOLVER_START_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 272),
/* User data to pass to the resolver start callback. */
- CINIT(RESOLVER_START_DATA, OBJECTPOINT, 273),
+ CURLOPT(CURLOPT_RESOLVER_START_DATA, CURLOPTTYPE_CBPOINT, 273),
/* send HAProxy PROXY protocol header? */
- CINIT(HAPROXYPROTOCOL, LONG, 274),
+ CURLOPT(CURLOPT_HAPROXYPROTOCOL, CURLOPTTYPE_LONG, 274),
/* shuffle addresses before use when DNS returns multiple */
- CINIT(DNS_SHUFFLE_ADDRESSES, LONG, 275),
+ CURLOPT(CURLOPT_DNS_SHUFFLE_ADDRESSES, CURLOPTTYPE_LONG, 275),
/* Specify which TLS 1.3 ciphers suites to use */
- CINIT(TLS13_CIPHERS, STRINGPOINT, 276),
- CINIT(PROXY_TLS13_CIPHERS, STRINGPOINT, 277),
+ CURLOPT(CURLOPT_TLS13_CIPHERS, CURLOPTTYPE_STRINGPOINT, 276),
+ CURLOPT(CURLOPT_PROXY_TLS13_CIPHERS, CURLOPTTYPE_STRINGPOINT, 277),
/* Disallow specifying username/login in URL. */
- CINIT(DISALLOW_USERNAME_IN_URL, LONG, 278),
+ CURLOPT(CURLOPT_DISALLOW_USERNAME_IN_URL, CURLOPTTYPE_LONG, 278),
/* DNS-over-HTTPS URL */
- CINIT(DOH_URL, STRINGPOINT, 279),
+ CURLOPT(CURLOPT_DOH_URL, CURLOPTTYPE_STRINGPOINT, 279),
/* Preferred buffer size to use for uploads */
- CINIT(UPLOAD_BUFFERSIZE, LONG, 280),
+ CURLOPT(CURLOPT_UPLOAD_BUFFERSIZE, CURLOPTTYPE_LONG, 280),
/* Time in ms between connection upkeep calls for long-lived connections. */
- CINIT(UPKEEP_INTERVAL_MS, LONG, 281),
+ CURLOPT(CURLOPT_UPKEEP_INTERVAL_MS, CURLOPTTYPE_LONG, 281),
/* Specify URL using CURL URL API. */
- CINIT(CURLU, OBJECTPOINT, 282),
+ CURLOPT(CURLOPT_CURLU, CURLOPTTYPE_OBJECTPOINT, 282),
/* add trailing data just after no more data is available */
- CINIT(TRAILERFUNCTION, FUNCTIONPOINT, 283),
+ CURLOPT(CURLOPT_TRAILERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 283),
/* pointer to be passed to HTTP_TRAILER_FUNCTION */
- CINIT(TRAILERDATA, OBJECTPOINT, 284),
+ CURLOPT(CURLOPT_TRAILERDATA, CURLOPTTYPE_CBPOINT, 284),
/* set this to 1L to allow HTTP/0.9 responses or 0L to disallow */
- CINIT(HTTP09_ALLOWED, LONG, 285),
+ CURLOPT(CURLOPT_HTTP09_ALLOWED, CURLOPTTYPE_LONG, 285),
/* alt-svc control bitmask */
- CINIT(ALTSVC_CTRL, LONG, 286),
+ CURLOPT(CURLOPT_ALTSVC_CTRL, CURLOPTTYPE_LONG, 286),
/* alt-svc cache file name to possibly read from/write to */
- CINIT(ALTSVC, STRINGPOINT, 287),
+ CURLOPT(CURLOPT_ALTSVC, CURLOPTTYPE_STRINGPOINT, 287),
+
+ /* maximum age (idle time) of a connection to consider it for reuse
+ * (in seconds) */
+ CURLOPT(CURLOPT_MAXAGE_CONN, CURLOPTTYPE_LONG, 288),
+
+ /* SASL authorization identity */
+ CURLOPT(CURLOPT_SASL_AUTHZID, CURLOPTTYPE_STRINGPOINT, 289),
+
+ /* allow RCPT TO command to fail for some recipients */
+ CURLOPT(CURLOPT_MAIL_RCPT_ALLLOWFAILS, CURLOPTTYPE_LONG, 290),
+
+ /* the private SSL-certificate as a "blob" */
+ CURLOPT(CURLOPT_SSLCERT_BLOB, CURLOPTTYPE_BLOB, 291),
+ CURLOPT(CURLOPT_SSLKEY_BLOB, CURLOPTTYPE_BLOB, 292),
+ CURLOPT(CURLOPT_PROXY_SSLCERT_BLOB, CURLOPTTYPE_BLOB, 293),
+ CURLOPT(CURLOPT_PROXY_SSLKEY_BLOB, CURLOPTTYPE_BLOB, 294),
+ CURLOPT(CURLOPT_ISSUERCERT_BLOB, CURLOPTTYPE_BLOB, 295),
+
+ /* Issuer certificate for proxy */
+ CURLOPT(CURLOPT_PROXY_ISSUERCERT, CURLOPTTYPE_STRINGPOINT, 296),
+ CURLOPT(CURLOPT_PROXY_ISSUERCERT_BLOB, CURLOPTTYPE_BLOB, 297),
+
+ /* the EC curves requested by the TLS client (RFC 8422, 5.1);
+ * OpenSSL support via 'set_groups'/'set_curves':
+ * https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_groups.html
+ */
+ CURLOPT(CURLOPT_SSL_EC_CURVES, CURLOPTTYPE_STRINGPOINT, 298),
+
+ /* HSTS bitmask */
+ CURLOPT(CURLOPT_HSTS_CTRL, CURLOPTTYPE_LONG, 299),
+ /* HSTS file name */
+ CURLOPT(CURLOPT_HSTS, CURLOPTTYPE_STRINGPOINT, 300),
+
+ /* HSTS read callback */
+ CURLOPT(CURLOPT_HSTSREADFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 301),
+ CURLOPT(CURLOPT_HSTSREADDATA, CURLOPTTYPE_CBPOINT, 302),
+
+ /* HSTS write callback */
+ CURLOPT(CURLOPT_HSTSWRITEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 303),
+ CURLOPT(CURLOPT_HSTSWRITEDATA, CURLOPTTYPE_CBPOINT, 304),
+
+ /* Parameters for V4 signature */
+ CURLOPT(CURLOPT_AWS_SIGV4, CURLOPTTYPE_STRINGPOINT, 305),
+
+ /* Same as CURLOPT_SSL_VERIFYPEER but for DoH (DNS-over-HTTPS) servers. */
+ CURLOPT(CURLOPT_DOH_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 306),
+
+ /* Same as CURLOPT_SSL_VERIFYHOST but for DoH (DNS-over-HTTPS) servers. */
+ CURLOPT(CURLOPT_DOH_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 307),
+
+ /* Same as CURLOPT_SSL_VERIFYSTATUS but for DoH (DNS-over-HTTPS) servers. */
+ CURLOPT(CURLOPT_DOH_SSL_VERIFYSTATUS, CURLOPTTYPE_LONG, 308),
+
+ /* The CA certificates as "blob" used to validate the peer certificate
+ this option is used only if SSL_VERIFYPEER is true */
+ CURLOPT(CURLOPT_CAINFO_BLOB, CURLOPTTYPE_BLOB, 309),
+
+ /* The CA certificates as "blob" used to validate the proxy certificate
+ this option is used only if PROXY_SSL_VERIFYPEER is true */
+ CURLOPT(CURLOPT_PROXY_CAINFO_BLOB, CURLOPTTYPE_BLOB, 310),
+
+ /* used by scp/sftp to verify the host's public key */
+ CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256, CURLOPTTYPE_STRINGPOINT, 311),
+
+ /* Function that will be called immediately before the initial request
+ is made on a connection (after any protocol negotiation step). */
+ CURLOPT(CURLOPT_PREREQFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 312),
+
+ /* Data passed to the CURLOPT_PREREQFUNCTION callback */
+ CURLOPT(CURLOPT_PREREQDATA, CURLOPTTYPE_CBPOINT, 313),
+
+ /* maximum age (since creation) of a connection to consider it for reuse
+ * (in seconds) */
+ CURLOPT(CURLOPT_MAXLIFETIME_CONN, CURLOPTTYPE_LONG, 314),
+
+ /* Set MIME option flags. */
+ CURLOPT(CURLOPT_MIME_OPTIONS, CURLOPTTYPE_LONG, 315),
+
+ /* set the SSH host key callback, must point to a curl_sshkeycallback
+ function */
+ CURLOPT(CURLOPT_SSH_HOSTKEYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 316),
+
+ /* set the SSH host key callback custom pointer */
+ CURLOPT(CURLOPT_SSH_HOSTKEYDATA, CURLOPTTYPE_CBPOINT, 317),
+
+ /* specify which protocols that are allowed to be used for the transfer,
+ which thus helps the app which takes URLs from users or other external
+ inputs and want to restrict what protocol(s) to deal with. Defaults to
+ all built-in protocols. */
+ CURLOPT(CURLOPT_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 318),
+
+ /* specify which protocols that libcurl is allowed to follow directs to */
+ CURLOPT(CURLOPT_REDIR_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 319),
+
+ /* websockets options */
+ CURLOPT(CURLOPT_WS_OPTIONS, CURLOPTTYPE_LONG, 320),
+
+ /* CA cache timeout */
+ CURLOPT(CURLOPT_CA_CACHE_TIMEOUT, CURLOPTTYPE_LONG, 321),
+
+ /* Can leak things, gonna exit() soon */
+ CURLOPT(CURLOPT_QUICK_EXIT, CURLOPTTYPE_LONG, 322),
CURLOPT_LASTENTRY /* the last unused */
} CURLoption;
@@ -1943,6 +2228,9 @@ typedef enum {
#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD
#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL
+/* */
+#define CURLOPT_FTP_RESPONSE_TIMEOUT CURLOPT_SERVER_RESPONSE_TIMEOUT
+
#else
/* This is set if CURL_NO_OLDIES is defined at compile-time */
#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */
@@ -1952,12 +2240,12 @@ typedef enum {
/* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
name resolves addresses using more than one IP protocol version, this
option might be handy to force libcurl to use a specific IP version. */
-#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP
+#define CURL_IPRESOLVE_WHATEVER 0 /* default, uses addresses to all IP
versions that your system allows */
-#define CURL_IPRESOLVE_V4 1 /* resolve to IPv4 addresses */
-#define CURL_IPRESOLVE_V6 2 /* resolve to IPv6 addresses */
+#define CURL_IPRESOLVE_V4 1 /* uses only IPv4 addresses/connections */
+#define CURL_IPRESOLVE_V6 2 /* uses only IPv6 addresses/connections */
- /* three convenient "aliases" that follow the name scheme better */
+ /* Convenient "aliases" */
#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER
/* These enums are for use with the CURLOPT_HTTP_VERSION option. */
@@ -1971,6 +2259,12 @@ enum {
CURL_HTTP_VERSION_2TLS, /* use version 2 for HTTPS, version 1.1 for HTTP */
CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE, /* please use HTTP 2 without HTTP/1.1
Upgrade */
+ CURL_HTTP_VERSION_3 = 30, /* Use HTTP/3, fallback to HTTP/2 or HTTP/1 if
+ needed. For HTTPS only. For HTTP, this option
+ makes libcurl return error. */
+ CURL_HTTP_VERSION_3ONLY = 31, /* Use HTTP/3 without fallback. For HTTPS
+ only. For HTTP, this makes libcurl
+ return error. */
CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
};
@@ -2064,7 +2358,7 @@ typedef enum {
CURL_TIMECOND_LAST
} curl_TimeCond;
-/* Special size_t value signaling a zero-terminated string. */
+/* Special size_t value signaling a null-terminated string. */
#define CURL_ZERO_TERMINATED ((size_t) -1)
/* curl_strequal() and curl_strnequal() are subject for removal in a future
@@ -2073,8 +2367,11 @@ CURL_EXTERN int curl_strequal(const char *s1, const char *s2);
CURL_EXTERN int curl_strnequal(const char *s1, const char *s2, size_t n);
/* Mime/form handling support. */
-typedef struct curl_mime_s curl_mime; /* Mime context. */
-typedef struct curl_mimepart_s curl_mimepart; /* Mime part context. */
+typedef struct curl_mime curl_mime; /* Mime context. */
+typedef struct curl_mimepart curl_mimepart; /* Mime part context. */
+
+/* CURLMIMEOPT_ defines are for the CURLOPT_MIME_OPTIONS option. */
+#define CURLMIMEOPT_FORMESCAPE (1<<0) /* Use backslash-escaping for forms. */
/*
* NAME curl_mime_init()
@@ -2197,52 +2494,37 @@ CURL_EXTERN CURLcode curl_mime_headers(curl_mimepart *part,
struct curl_slist *headers,
int take_ownership);
-/* Old form API. */
-/* name is uppercase CURLFORM_ */
-#ifdef CFINIT
-#undef CFINIT
-#endif
-
-#ifdef CURL_ISOCPP
-#define CFINIT(name) CURLFORM_ ## name
-#else
-/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
-#define CFINIT(name) CURLFORM_/**/name
-#endif
-
typedef enum {
- CFINIT(NOTHING), /********* the first one is unused ************/
+ /********* the first one is unused ************/
+ CURLFORM_NOTHING CURL_DEPRECATED(7.56.0, ""),
+ CURLFORM_COPYNAME CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"),
+ CURLFORM_PTRNAME CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"),
+ CURLFORM_NAMELENGTH CURL_DEPRECATED(7.56.0, ""),
+ CURLFORM_COPYCONTENTS CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
+ CURLFORM_PTRCONTENTS CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
+ CURLFORM_CONTENTSLENGTH CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
+ CURLFORM_FILECONTENT CURL_DEPRECATED(7.56.0, "Use curl_mime_data_cb()"),
+ CURLFORM_ARRAY CURL_DEPRECATED(7.56.0, ""),
+ CURLFORM_OBSOLETE,
+ CURLFORM_FILE CURL_DEPRECATED(7.56.0, "Use curl_mime_filedata()"),
- /* */
- CFINIT(COPYNAME),
- CFINIT(PTRNAME),
- CFINIT(NAMELENGTH),
- CFINIT(COPYCONTENTS),
- CFINIT(PTRCONTENTS),
- CFINIT(CONTENTSLENGTH),
- CFINIT(FILECONTENT),
- CFINIT(ARRAY),
- CFINIT(OBSOLETE),
- CFINIT(FILE),
+ CURLFORM_BUFFER CURL_DEPRECATED(7.56.0, "Use curl_mime_filename()"),
+ CURLFORM_BUFFERPTR CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
+ CURLFORM_BUFFERLENGTH CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
- CFINIT(BUFFER),
- CFINIT(BUFFERPTR),
- CFINIT(BUFFERLENGTH),
+ CURLFORM_CONTENTTYPE CURL_DEPRECATED(7.56.0, "Use curl_mime_type()"),
+ CURLFORM_CONTENTHEADER CURL_DEPRECATED(7.56.0, "Use curl_mime_headers()"),
+ CURLFORM_FILENAME CURL_DEPRECATED(7.56.0, "Use curl_mime_filename()"),
+ CURLFORM_END,
+ CURLFORM_OBSOLETE2,
- CFINIT(CONTENTTYPE),
- CFINIT(CONTENTHEADER),
- CFINIT(FILENAME),
- CFINIT(END),
- CFINIT(OBSOLETE2),
-
- CFINIT(STREAM),
- CFINIT(CONTENTLEN), /* added in 7.46.0, provide a curl_off_t length */
+ CURLFORM_STREAM CURL_DEPRECATED(7.56.0, "Use curl_mime_data_cb()"),
+ CURLFORM_CONTENTLEN /* added in 7.46.0, provide a curl_off_t length */
+ CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
CURLFORM_LASTENTRY /* the last unused */
} CURLformoption;
-#undef CFINIT /* done */
-
/* structure to be used as parameter for CURLFORM_ARRAY */
struct curl_forms {
CURLformoption option;
@@ -2266,15 +2548,16 @@ struct curl_forms {
*
***************************************************************************/
typedef enum {
- CURL_FORMADD_OK, /* first, no error */
+ CURL_FORMADD_OK CURL_DEPRECATED(7.56.0, ""), /* 1st, no error */
- CURL_FORMADD_MEMORY,
- CURL_FORMADD_OPTION_TWICE,
- CURL_FORMADD_NULL,
- CURL_FORMADD_UNKNOWN_OPTION,
- CURL_FORMADD_INCOMPLETE,
- CURL_FORMADD_ILLEGAL_ARRAY,
- CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */
+ CURL_FORMADD_MEMORY CURL_DEPRECATED(7.56.0, ""),
+ CURL_FORMADD_OPTION_TWICE CURL_DEPRECATED(7.56.0, ""),
+ CURL_FORMADD_NULL CURL_DEPRECATED(7.56.0, ""),
+ CURL_FORMADD_UNKNOWN_OPTION CURL_DEPRECATED(7.56.0, ""),
+ CURL_FORMADD_INCOMPLETE CURL_DEPRECATED(7.56.0, ""),
+ CURL_FORMADD_ILLEGAL_ARRAY CURL_DEPRECATED(7.56.0, ""),
+ /* libcurl was built with form api disabled */
+ CURL_FORMADD_DISABLED CURL_DEPRECATED(7.56.0, ""),
CURL_FORMADD_LAST /* last */
} CURLFORMcode;
@@ -2288,9 +2571,10 @@ typedef enum {
* adds one part that together construct a full post. Then use
* CURLOPT_HTTPPOST to send it off to libcurl.
*/
-CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,
- struct curl_httppost **last_post,
- ...);
+CURL_EXTERN CURLFORMcode CURL_DEPRECATED(7.56.0, "Use curl_mime_init()")
+curl_formadd(struct curl_httppost **httppost,
+ struct curl_httppost **last_post,
+ ...);
/*
* callback function for curl_formget()
@@ -2313,8 +2597,9 @@ typedef size_t (*curl_formget_callback)(void *arg, const char *buf,
* the curl_formget_callback function.
* Returns 0 on success.
*/
-CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg,
- curl_formget_callback append);
+CURL_EXTERN int CURL_DEPRECATED(7.56.0, "")
+curl_formget(struct curl_httppost *form, void *arg,
+ curl_formget_callback append);
/*
* NAME curl_formfree()
*
@@ -2322,7 +2607,8 @@ CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg,
*
* Free a multipart formpost previously built with curl_formadd().
*/
-CURL_EXTERN void curl_formfree(struct curl_httppost *form);
+CURL_EXTERN void CURL_DEPRECATED(7.56.0, "Use curl_mime_free()")
+curl_formfree(struct curl_httppost *form);
/*
* NAME curl_getenv()
@@ -2398,8 +2684,10 @@ CURL_EXTERN void curl_free(void *p);
*
* curl_global_init() should be invoked exactly once for each application that
* uses libcurl and before any call of other libcurl functions.
- *
- * This function is not thread-safe!
+
+ * This function is thread-safe if CURL_VERSION_THREADSAFE is set in the
+ * curl_version_info_data.features flag (fetch by curl_version_info()).
+
*/
CURL_EXTERN CURLcode curl_global_init(long flags);
@@ -2413,7 +2701,7 @@ CURL_EXTERN CURLcode curl_global_init(long flags);
* initialize libcurl and set user defined memory management callback
* functions. Users can implement memory management routines to check for
* memory leaks, check for mis-use of the curl library etc. User registered
- * callback routines with be invoked by this library instead of the system
+ * callback routines will be invoked by this library instead of the system
* memory management routines like malloc, free etc.
*/
CURL_EXTERN CURLcode curl_global_init_mem(long flags,
@@ -2465,10 +2753,11 @@ struct curl_slist {
* subsequent attempt to change it will result in a CURLSSLSET_TOO_LATE.
*/
-typedef struct {
+struct curl_ssl_backend {
curl_sslbackend id;
const char *name;
-} curl_ssl_backend;
+};
+typedef struct curl_ssl_backend curl_ssl_backend;
typedef enum {
CURLSSLSET_OK = 0,
@@ -2488,8 +2777,8 @@ CURL_EXTERN CURLsslset curl_global_sslset(curl_sslbackend id, const char *name,
* Appends a string to a linked list. If no list exists, it will be created
* first. Returns the new list, after appending.
*/
-CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,
- const char *);
+CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *list,
+ const char *data);
/*
* NAME curl_slist_free_all()
@@ -2498,7 +2787,7 @@ CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,
*
* free a previously built curl_slist.
*/
-CURL_EXTERN void curl_slist_free_all(struct curl_slist *);
+CURL_EXTERN void curl_slist_free_all(struct curl_slist *list);
/*
* NAME curl_getdate()
@@ -2511,8 +2800,8 @@ CURL_EXTERN void curl_slist_free_all(struct curl_slist *);
*/
CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);
-/* info about the certificate chain, only for OpenSSL builds. Asked
- for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
+/* info about the certificate chain, only for OpenSSL, GnuTLS, Schannel, NSS
+ and GSKit builds. Asked for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
struct curl_certinfo {
int num_of_certs; /* number of certificates with information */
struct curl_slist **certinfo; /* for each index in this array, there's a
@@ -2546,22 +2835,35 @@ typedef enum {
CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4,
CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5,
CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
- CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7,
+ CURLINFO_SIZE_UPLOAD CURL_DEPRECATED(7.55.0, "Use CURLINFO_SIZE_UPLOAD_T")
+ = CURLINFO_DOUBLE + 7,
CURLINFO_SIZE_UPLOAD_T = CURLINFO_OFF_T + 7,
- CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8,
+ CURLINFO_SIZE_DOWNLOAD
+ CURL_DEPRECATED(7.55.0, "Use CURLINFO_SIZE_DOWNLOAD_T")
+ = CURLINFO_DOUBLE + 8,
CURLINFO_SIZE_DOWNLOAD_T = CURLINFO_OFF_T + 8,
- CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9,
+ CURLINFO_SPEED_DOWNLOAD
+ CURL_DEPRECATED(7.55.0, "Use CURLINFO_SPEED_DOWNLOAD_T")
+ = CURLINFO_DOUBLE + 9,
CURLINFO_SPEED_DOWNLOAD_T = CURLINFO_OFF_T + 9,
- CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10,
+ CURLINFO_SPEED_UPLOAD
+ CURL_DEPRECATED(7.55.0, "Use CURLINFO_SPEED_UPLOAD_T")
+ = CURLINFO_DOUBLE + 10,
CURLINFO_SPEED_UPLOAD_T = CURLINFO_OFF_T + 10,
CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11,
CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12,
CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13,
CURLINFO_FILETIME = CURLINFO_LONG + 14,
CURLINFO_FILETIME_T = CURLINFO_OFF_T + 14,
- CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15,
+ CURLINFO_CONTENT_LENGTH_DOWNLOAD
+ CURL_DEPRECATED(7.55.0,
+ "Use CURLINFO_CONTENT_LENGTH_DOWNLOAD_T")
+ = CURLINFO_DOUBLE + 15,
CURLINFO_CONTENT_LENGTH_DOWNLOAD_T = CURLINFO_OFF_T + 15,
- CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16,
+ CURLINFO_CONTENT_LENGTH_UPLOAD
+ CURL_DEPRECATED(7.55.0,
+ "Use CURLINFO_CONTENT_LENGTH_UPLOAD_T")
+ = CURLINFO_DOUBLE + 16,
CURLINFO_CONTENT_LENGTH_UPLOAD_T = CURLINFO_OFF_T + 16,
CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18,
@@ -2575,7 +2877,8 @@ typedef enum {
CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26,
CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27,
CURLINFO_COOKIELIST = CURLINFO_SLIST + 28,
- CURLINFO_LASTSOCKET = CURLINFO_LONG + 29,
+ CURLINFO_LASTSOCKET CURL_DEPRECATED(7.45.0, "Use CURLINFO_ACTIVESOCKET")
+ = CURLINFO_LONG + 29,
CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30,
CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31,
CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32,
@@ -2589,17 +2892,15 @@ typedef enum {
CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40,
CURLINFO_LOCAL_IP = CURLINFO_STRING + 41,
CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42,
- CURLINFO_TLS_SESSION = CURLINFO_PTR + 43,
+ CURLINFO_TLS_SESSION CURL_DEPRECATED(7.48.0, "Use CURLINFO_TLS_SSL_PTR")
+ = CURLINFO_PTR + 43,
CURLINFO_ACTIVESOCKET = CURLINFO_SOCKET + 44,
CURLINFO_TLS_SSL_PTR = CURLINFO_PTR + 45,
CURLINFO_HTTP_VERSION = CURLINFO_LONG + 46,
CURLINFO_PROXY_SSL_VERIFYRESULT = CURLINFO_LONG + 47,
- CURLINFO_PROTOCOL = CURLINFO_LONG + 48,
+ CURLINFO_PROTOCOL CURL_DEPRECATED(7.85.0, "Use CURLINFO_SCHEME")
+ = CURLINFO_LONG + 48,
CURLINFO_SCHEME = CURLINFO_STRING + 49,
- /* Fill in new entries below here! */
-
- /* Preferably these would be defined conditionally based on the
- sizeof curl_off_t being 64-bits */
CURLINFO_TOTAL_TIME_T = CURLINFO_OFF_T + 50,
CURLINFO_NAMELOOKUP_TIME_T = CURLINFO_OFF_T + 51,
CURLINFO_CONNECT_TIME_T = CURLINFO_OFF_T + 52,
@@ -2607,8 +2908,13 @@ typedef enum {
CURLINFO_STARTTRANSFER_TIME_T = CURLINFO_OFF_T + 54,
CURLINFO_REDIRECT_TIME_T = CURLINFO_OFF_T + 55,
CURLINFO_APPCONNECT_TIME_T = CURLINFO_OFF_T + 56,
-
- CURLINFO_LASTONE = 56
+ CURLINFO_RETRY_AFTER = CURLINFO_OFF_T + 57,
+ CURLINFO_EFFECTIVE_METHOD = CURLINFO_STRING + 58,
+ CURLINFO_PROXY_ERROR = CURLINFO_LONG + 59,
+ CURLINFO_REFERER = CURLINFO_STRING + 60,
+ CURLINFO_CAINFO = CURLINFO_STRING + 61,
+ CURLINFO_CAPATH = CURLINFO_STRING + 62,
+ CURLINFO_LASTONE = 62
} CURLINFO;
/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
@@ -2627,7 +2933,7 @@ typedef enum {
CURLCLOSEPOLICY_LAST /* last, never use this */
} curl_closepolicy;
-#define CURL_GLOBAL_SSL (1<<0) /* no purpose since since 7.57.0 */
+#define CURL_GLOBAL_SSL (1<<0) /* no purpose since 7.57.0 */
#define CURL_GLOBAL_WIN32 (1<<1)
#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)
#define CURL_GLOBAL_NOTHING 0
@@ -2652,6 +2958,7 @@ typedef enum {
CURL_LOCK_DATA_SSL_SESSION,
CURL_LOCK_DATA_CONNECT,
CURL_LOCK_DATA_PSL,
+ CURL_LOCK_DATA_HSTS,
CURL_LOCK_DATA_LAST
} curl_lock_data;
@@ -2694,8 +3001,9 @@ typedef enum {
} CURLSHoption;
CURL_EXTERN CURLSH *curl_share_init(void);
-CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...);
-CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *);
+CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *share, CURLSHoption option,
+ ...);
+CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *share);
/****************************************************************************
* Structures for querying information about the curl library at runtime.
@@ -2707,6 +3015,12 @@ typedef enum {
CURLVERSION_THIRD,
CURLVERSION_FOURTH,
CURLVERSION_FIFTH,
+ CURLVERSION_SIXTH,
+ CURLVERSION_SEVENTH,
+ CURLVERSION_EIGHTH,
+ CURLVERSION_NINTH,
+ CURLVERSION_TENTH,
+ CURLVERSION_ELEVENTH,
CURLVERSION_LAST /* never actually use this */
} CURLversion;
@@ -2715,9 +3029,9 @@ typedef enum {
meant to be a built-in version number for what kind of struct the caller
expects. If the struct ever changes, we redefine the NOW to another enum
from above. */
-#define CURLVERSION_NOW CURLVERSION_FIFTH
+#define CURLVERSION_NOW CURLVERSION_ELEVENTH
-typedef struct {
+struct curl_version_info_data {
CURLversion age; /* age of the returned struct */
const char *version; /* LIBCURL_VERSION */
unsigned int version_num; /* LIBCURL_VERSION_NUM */
@@ -2744,12 +3058,39 @@ typedef struct {
const char *libssh_version; /* human readable string */
/* These fields were added in CURLVERSION_FIFTH */
-
unsigned int brotli_ver_num; /* Numeric Brotli version
(MAJOR << 24) | (MINOR << 12) | PATCH */
const char *brotli_version; /* human readable string. */
-} curl_version_info_data;
+ /* These fields were added in CURLVERSION_SIXTH */
+ unsigned int nghttp2_ver_num; /* Numeric nghttp2 version
+ (MAJOR << 16) | (MINOR << 8) | PATCH */
+ const char *nghttp2_version; /* human readable string. */
+ const char *quic_version; /* human readable quic (+ HTTP/3) library +
+ version or NULL */
+
+ /* These fields were added in CURLVERSION_SEVENTH */
+ const char *cainfo; /* the built-in default CURLOPT_CAINFO, might
+ be NULL */
+ const char *capath; /* the built-in default CURLOPT_CAPATH, might
+ be NULL */
+
+ /* These fields were added in CURLVERSION_EIGHTH */
+ unsigned int zstd_ver_num; /* Numeric Zstd version
+ (MAJOR << 24) | (MINOR << 12) | PATCH */
+ const char *zstd_version; /* human readable string. */
+
+ /* These fields were added in CURLVERSION_NINTH */
+ const char *hyper_version; /* human readable string. */
+
+ /* These fields were added in CURLVERSION_TENTH */
+ const char *gsasl_version; /* human readable string. */
+
+ /* These fields were added in CURLVERSION_ELEVENTH */
+ /* feature_names is terminated by an entry with a NULL feature name */
+ const char * const *feature_names;
+};
+typedef struct curl_version_info_data curl_version_info_data;
#define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */
#define CURL_VERSION_KERBEROS4 (1<<1) /* Kerberos V4 auth is supported
@@ -2781,6 +3122,12 @@ typedef struct {
#define CURL_VERSION_MULTI_SSL (1<<22) /* Multiple SSL backends available */
#define CURL_VERSION_BROTLI (1<<23) /* Brotli features are present. */
#define CURL_VERSION_ALTSVC (1<<24) /* Alt-Svc handling built-in */
+#define CURL_VERSION_HTTP3 (1<<25) /* HTTP3 support built-in */
+#define CURL_VERSION_ZSTD (1<<26) /* zstd features are present */
+#define CURL_VERSION_UNICODE (1<<27) /* Unicode support on Windows */
+#define CURL_VERSION_HSTS (1<<28) /* HSTS is supported */
+#define CURL_VERSION_GSASL (1<<29) /* libgsasl is supported */
+#define CURL_VERSION_THREADSAFE (1<<30) /* libcurl API is thread-safe */
/*
* NAME curl_version_info()
@@ -2835,7 +3182,7 @@ CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
#define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT)
#ifdef __cplusplus
-}
+} /* end of extern "C" */
#endif
/* unfortunately, the easy.h and multi.h include files need options and info
@@ -2843,6 +3190,9 @@ CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
#include "easy.h" /* nothing in curl is fun without the easy stuff */
#include "multi.h"
#include "urlapi.h"
+#include "options.h"
+#include "header.h"
+#include "websockets.h"
/* the typechecker doesn't work in C++ (yet) */
#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \
@@ -2859,6 +3209,6 @@ CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
#endif /* __STDC__ >= 1 */
-#endif /* gcc >= 4.3 && !__cplusplus */
+#endif /* gcc >= 4.3 && !__cplusplus && !CURL_DISABLE_TYPECHECK */
-#endif /* __CURL_CURL_H */
+#endif /* CURLINC_CURL_H */
diff --git a/Source/ThirdParty/curl/curlver.h b/Source/ThirdParty/curl/curlver.h
index 9a4b9b02d..d59537120 100644
--- a/Source/ThirdParty/curl/curlver.h
+++ b/Source/ThirdParty/curl/curlver.h
@@ -1,5 +1,5 @@
-#ifndef __CURL_CURLVER_H
-#define __CURL_CURLVER_H
+#ifndef CURLINC_CURLVER_H
+#define CURLINC_CURLVER_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al.
+ * Copyright (C) Daniel Stenberg, , et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -20,26 +20,28 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
+ * SPDX-License-Identifier: curl
+ *
***************************************************************************/
/* This header file contains nothing but libcurl version info, generated by
a script at release-time. This was made its own header file in 7.11.2 */
/* This is the global package copyright */
-#define LIBCURL_COPYRIGHT "1996 - 2019 Daniel Stenberg, ."
+#define LIBCURL_COPYRIGHT "Daniel Stenberg, ."
/* This is the version number of the libcurl package from which this header
file origins: */
-#define LIBCURL_VERSION "7.64.1"
+#define LIBCURL_VERSION "7.88.1"
/* The numeric version number is also available "in parts" by using these
defines: */
#define LIBCURL_VERSION_MAJOR 7
-#define LIBCURL_VERSION_MINOR 64
+#define LIBCURL_VERSION_MINOR 88
#define LIBCURL_VERSION_PATCH 1
/* This is the numeric version of the libcurl version number, meant for easier
- parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
+ parsing and comparisons by programs. The LIBCURL_VERSION_NUM define will
always follow this syntax:
0xXXYYZZ
@@ -57,7 +59,7 @@
CURL_VERSION_BITS() macro since curl's own configure script greps for it
and needs it to contain the full number.
*/
-#define LIBCURL_VERSION_NUM 0x074001
+#define LIBCURL_VERSION_NUM 0x075801
/*
* This is the date and time when the full source package was created. The
@@ -68,10 +70,10 @@
*
* "2007-11-23"
*/
-#define LIBCURL_TIMESTAMP "2019-03-27"
+#define LIBCURL_TIMESTAMP "2023-02-20"
-#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z)
+#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z))
#define CURL_AT_LEAST_VERSION(x,y,z) \
(LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
-#endif /* __CURL_CURLVER_H */
+#endif /* CURLINC_CURLVER_H */
diff --git a/Source/ThirdParty/curl/easy.h b/Source/ThirdParty/curl/easy.h
index f42a8a969..394668a8f 100644
--- a/Source/ThirdParty/curl/easy.h
+++ b/Source/ThirdParty/curl/easy.h
@@ -1,5 +1,5 @@
-#ifndef __CURL_EASY_H
-#define __CURL_EASY_H
+#ifndef CURLINC_EASY_H
+#define CURLINC_EASY_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
+ * Copyright (C) Daniel Stenberg, , et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -20,11 +20,24 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
+ * SPDX-License-Identifier: curl
+ *
***************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
+/* Flag bits in the curl_blob struct: */
+#define CURL_BLOB_COPY 1 /* tell libcurl to copy the data */
+#define CURL_BLOB_NOCOPY 0 /* tell libcurl to NOT copy the data */
+
+struct curl_blob {
+ void *data;
+ size_t len;
+ unsigned int flags; /* bit 0 is defined, the rest are reserved and should be
+ left zeroes */
+};
+
CURL_EXTERN CURL *curl_easy_init(void);
CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
@@ -106,7 +119,7 @@ CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
CURL_EXTERN CURLcode curl_easy_upkeep(CURL *curl);
#ifdef __cplusplus
-}
+} /* end of extern "C" */
#endif
#endif
diff --git a/Source/ThirdParty/curl/header.h b/Source/ThirdParty/curl/header.h
new file mode 100644
index 000000000..8df11e1e4
--- /dev/null
+++ b/Source/ThirdParty/curl/header.h
@@ -0,0 +1,74 @@
+#ifndef CURLINC_HEADER_H
+#define CURLINC_HEADER_H
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) Daniel Stenberg, , et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at https://curl.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ * SPDX-License-Identifier: curl
+ *
+ ***************************************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct curl_header {
+ char *name; /* this might not use the same case */
+ char *value;
+ size_t amount; /* number of headers using this name */
+ size_t index; /* ... of this instance, 0 or higher */
+ unsigned int origin; /* see bits below */
+ void *anchor; /* handle privately used by libcurl */
+};
+
+/* 'origin' bits */
+#define CURLH_HEADER (1<<0) /* plain server header */
+#define CURLH_TRAILER (1<<1) /* trailers */
+#define CURLH_CONNECT (1<<2) /* CONNECT headers */
+#define CURLH_1XX (1<<3) /* 1xx headers */
+#define CURLH_PSEUDO (1<<4) /* pseudo headers */
+
+typedef enum {
+ CURLHE_OK,
+ CURLHE_BADINDEX, /* header exists but not with this index */
+ CURLHE_MISSING, /* no such header exists */
+ CURLHE_NOHEADERS, /* no headers at all exist (yet) */
+ CURLHE_NOREQUEST, /* no request with this number was used */
+ CURLHE_OUT_OF_MEMORY, /* out of memory while processing */
+ CURLHE_BAD_ARGUMENT, /* a function argument was not okay */
+ CURLHE_NOT_BUILT_IN /* if API was disabled in the build */
+} CURLHcode;
+
+CURL_EXTERN CURLHcode curl_easy_header(CURL *easy,
+ const char *name,
+ size_t index,
+ unsigned int origin,
+ int request,
+ struct curl_header **hout);
+
+CURL_EXTERN struct curl_header *curl_easy_nextheader(CURL *easy,
+ unsigned int origin,
+ int request,
+ struct curl_header *prev);
+
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+
+#endif /* CURLINC_HEADER_H */
diff --git a/Source/ThirdParty/curl/mprintf.h b/Source/ThirdParty/curl/mprintf.h
index e20f546e1..e652a6520 100644
--- a/Source/ThirdParty/curl/mprintf.h
+++ b/Source/ThirdParty/curl/mprintf.h
@@ -1,5 +1,5 @@
-#ifndef __CURL_MPRINTF_H
-#define __CURL_MPRINTF_H
+#ifndef CURLINC_MPRINTF_H
+#define CURLINC_MPRINTF_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
+ * Copyright (C) Daniel Stenberg, , et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -20,6 +20,8 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
+ * SPDX-License-Identifier: curl
+ *
***************************************************************************/
#include
@@ -44,7 +46,7 @@ CURL_EXTERN char *curl_maprintf(const char *format, ...);
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
#ifdef __cplusplus
-}
+} /* end of extern "C" */
#endif
-#endif /* __CURL_MPRINTF_H */
+#endif /* CURLINC_MPRINTF_H */
diff --git a/Source/ThirdParty/curl/multi.h b/Source/ThirdParty/curl/multi.h
index b19dbaf79..30a3d9301 100644
--- a/Source/ThirdParty/curl/multi.h
+++ b/Source/ThirdParty/curl/multi.h
@@ -1,5 +1,5 @@
-#ifndef __CURL_MULTI_H
-#define __CURL_MULTI_H
+#ifndef CURLINC_MULTI_H
+#define CURLINC_MULTI_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al.
+ * Copyright (C) Daniel Stenberg, , et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -20,6 +20,8 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
+ * SPDX-License-Identifier: curl
+ *
***************************************************************************/
/*
This is an "external" header file. Don't give away any internals here!
@@ -72,6 +74,10 @@ typedef enum {
attempted to get added - again */
CURLM_RECURSIVE_API_CALL, /* an api function was called from inside a
callback */
+ CURLM_WAKEUP_FAILURE, /* wakeup is unavailable or failed */
+ CURLM_BAD_FUNCTION_ARGUMENT, /* function called with a bad parameter */
+ CURLM_ABORTED_BY_CALLBACK,
+ CURLM_UNRECOVERABLE_POLL,
CURLM_LAST
} CURLMcode;
@@ -118,7 +124,7 @@ struct curl_waitfd {
/*
* Name: curl_multi_init()
*
- * Desc: inititalize multi-style curl usage
+ * Desc: initialize multi-style curl usage
*
* Returns: a new CURLM handle to use in all 'curl_multi' functions.
*/
@@ -173,6 +179,29 @@ CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle,
int timeout_ms,
int *ret);
+/*
+ * Name: curl_multi_poll()
+ *
+ * Desc: Poll on all fds within a CURLM set as well as any
+ * additional fds passed to the function.
+ *
+ * Returns: CURLMcode type, general multi error code.
+ */
+CURL_EXTERN CURLMcode curl_multi_poll(CURLM *multi_handle,
+ struct curl_waitfd extra_fds[],
+ unsigned int extra_nfds,
+ int timeout_ms,
+ int *ret);
+
+/*
+ * Name: curl_multi_wakeup()
+ *
+ * Desc: wakes up a sleeping curl_multi_poll call.
+ *
+ * Returns: CURLMcode type, general multi error code.
+ */
+CURL_EXTERN CURLMcode curl_multi_wakeup(CURLM *multi_handle);
+
/*
* Name: curl_multi_perform()
*
@@ -242,7 +271,7 @@ CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
* value into the equivalent human readable error string. This is
* useful for printing meaningful error messages.
*
- * Returns: A pointer to a zero-terminated error message.
+ * Returns: A pointer to a null-terminated error message.
*/
CURL_EXTERN const char *curl_multi_strerror(CURLMcode);
@@ -289,16 +318,16 @@ typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */
void *userp); /* private callback
pointer */
-CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
- int *running_handles);
+CURL_EXTERN CURLMcode CURL_DEPRECATED(7.19.5, "Use curl_multi_socket_action()")
+curl_multi_socket(CURLM *multi_handle, curl_socket_t s, int *running_handles);
CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,
curl_socket_t s,
int ev_bitmask,
int *running_handles);
-CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
- int *running_handles);
+CURL_EXTERN CURLMcode CURL_DEPRECATED(7.19.5, "Use curl_multi_socket_action()")
+curl_multi_socket_all(CURLM *multi_handle, int *running_handles);
#ifndef CURL_ALLOW_OLD_MULTI_SOCKET
/* This macro below was added in 7.16.3 to push users who recompile to use
@@ -319,68 +348,56 @@ CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
long *milliseconds);
-#undef CINIT /* re-using the same name as in curl.h */
-
-#ifdef CURL_ISOCPP
-#define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num
-#else
-/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
-#define LONG CURLOPTTYPE_LONG
-#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
-#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
-#define OFF_T CURLOPTTYPE_OFF_T
-#define CINIT(name,type,number) CURLMOPT_/**/name = type + number
-#endif
-
typedef enum {
/* This is the socket callback function pointer */
- CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),
+ CURLOPT(CURLMOPT_SOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 1),
/* This is the argument passed to the socket callback */
- CINIT(SOCKETDATA, OBJECTPOINT, 2),
+ CURLOPT(CURLMOPT_SOCKETDATA, CURLOPTTYPE_OBJECTPOINT, 2),
/* set to 1 to enable pipelining for this multi handle */
- CINIT(PIPELINING, LONG, 3),
+ CURLOPT(CURLMOPT_PIPELINING, CURLOPTTYPE_LONG, 3),
/* This is the timer callback function pointer */
- CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),
+ CURLOPT(CURLMOPT_TIMERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 4),
/* This is the argument passed to the timer callback */
- CINIT(TIMERDATA, OBJECTPOINT, 5),
+ CURLOPT(CURLMOPT_TIMERDATA, CURLOPTTYPE_OBJECTPOINT, 5),
/* maximum number of entries in the connection cache */
- CINIT(MAXCONNECTS, LONG, 6),
+ CURLOPT(CURLMOPT_MAXCONNECTS, CURLOPTTYPE_LONG, 6),
/* maximum number of (pipelining) connections to one host */
- CINIT(MAX_HOST_CONNECTIONS, LONG, 7),
+ CURLOPT(CURLMOPT_MAX_HOST_CONNECTIONS, CURLOPTTYPE_LONG, 7),
/* maximum number of requests in a pipeline */
- CINIT(MAX_PIPELINE_LENGTH, LONG, 8),
+ CURLOPT(CURLMOPT_MAX_PIPELINE_LENGTH, CURLOPTTYPE_LONG, 8),
/* a connection with a content-length longer than this
will not be considered for pipelining */
- CINIT(CONTENT_LENGTH_PENALTY_SIZE, OFF_T, 9),
+ CURLOPT(CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE, CURLOPTTYPE_OFF_T, 9),
/* a connection with a chunk length longer than this
will not be considered for pipelining */
- CINIT(CHUNK_LENGTH_PENALTY_SIZE, OFF_T, 10),
+ CURLOPT(CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE, CURLOPTTYPE_OFF_T, 10),
- /* a list of site names(+port) that are blacklisted from
- pipelining */
- CINIT(PIPELINING_SITE_BL, OBJECTPOINT, 11),
+ /* a list of site names(+port) that are blocked from pipelining */
+ CURLOPT(CURLMOPT_PIPELINING_SITE_BL, CURLOPTTYPE_OBJECTPOINT, 11),
- /* a list of server types that are blacklisted from
- pipelining */
- CINIT(PIPELINING_SERVER_BL, OBJECTPOINT, 12),
+ /* a list of server types that are blocked from pipelining */
+ CURLOPT(CURLMOPT_PIPELINING_SERVER_BL, CURLOPTTYPE_OBJECTPOINT, 12),
/* maximum number of open connections in total */
- CINIT(MAX_TOTAL_CONNECTIONS, LONG, 13),
+ CURLOPT(CURLMOPT_MAX_TOTAL_CONNECTIONS, CURLOPTTYPE_LONG, 13),
/* This is the server push callback function pointer */
- CINIT(PUSHFUNCTION, FUNCTIONPOINT, 14),
+ CURLOPT(CURLMOPT_PUSHFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 14),
/* This is the argument passed to the server push callback */
- CINIT(PUSHDATA, OBJECTPOINT, 15),
+ CURLOPT(CURLMOPT_PUSHDATA, CURLOPTTYPE_OBJECTPOINT, 15),
+
+ /* maximum number of concurrent streams to support on a connection */
+ CURLOPT(CURLMOPT_MAX_CONCURRENT_STREAMS, CURLOPTTYPE_LONG, 16),
CURLMOPT_LASTENTRY /* the last unused */
} CURLMoption;
@@ -414,12 +431,14 @@ CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
* Name: curl_push_callback
*
* Desc: This callback gets called when a new stream is being pushed by the
- * server. It approves or denies the new stream.
+ * server. It approves or denies the new stream. It can also decide
+ * to completely fail the connection.
*
- * Returns: CURL_PUSH_OK or CURL_PUSH_DENY.
+ * Returns: CURL_PUSH_OK, CURL_PUSH_DENY or CURL_PUSH_ERROROUT
*/
-#define CURL_PUSH_OK 0
-#define CURL_PUSH_DENY 1
+#define CURL_PUSH_OK 0
+#define CURL_PUSH_DENY 1
+#define CURL_PUSH_ERROROUT 2 /* added in 7.72.0 */
struct curl_pushheaders; /* forward declaration only */
diff --git a/Source/ThirdParty/curl/options.h b/Source/ThirdParty/curl/options.h
new file mode 100644
index 000000000..1ed76a95c
--- /dev/null
+++ b/Source/ThirdParty/curl/options.h
@@ -0,0 +1,70 @@
+#ifndef CURLINC_OPTIONS_H
+#define CURLINC_OPTIONS_H
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) Daniel Stenberg, , et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at https://curl.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ * SPDX-License-Identifier: curl
+ *
+ ***************************************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+ CURLOT_LONG, /* long (a range of values) */
+ CURLOT_VALUES, /* (a defined set or bitmask) */
+ CURLOT_OFF_T, /* curl_off_t (a range of values) */
+ CURLOT_OBJECT, /* pointer (void *) */
+ CURLOT_STRING, /* (char * to null-terminated buffer) */
+ CURLOT_SLIST, /* (struct curl_slist *) */
+ CURLOT_CBPTR, /* (void * passed as-is to a callback) */
+ CURLOT_BLOB, /* blob (struct curl_blob *) */
+ CURLOT_FUNCTION /* function pointer */
+} curl_easytype;
+
+/* Flag bits */
+
+/* "alias" means it is provided for old programs to remain functional,
+ we prefer another name */
+#define CURLOT_FLAG_ALIAS (1<<0)
+
+/* The CURLOPTTYPE_* id ranges can still be used to figure out what type/size
+ to use for curl_easy_setopt() for the given id */
+struct curl_easyoption {
+ const char *name;
+ CURLoption id;
+ curl_easytype type;
+ unsigned int flags;
+};
+
+CURL_EXTERN const struct curl_easyoption *
+curl_easy_option_by_name(const char *name);
+
+CURL_EXTERN const struct curl_easyoption *
+curl_easy_option_by_id(CURLoption id);
+
+CURL_EXTERN const struct curl_easyoption *
+curl_easy_option_next(const struct curl_easyoption *prev);
+
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+#endif /* CURLINC_OPTIONS_H */
diff --git a/Source/ThirdParty/curl/stdcheaders.h b/Source/ThirdParty/curl/stdcheaders.h
index 027b6f421..7451aa305 100644
--- a/Source/ThirdParty/curl/stdcheaders.h
+++ b/Source/ThirdParty/curl/stdcheaders.h
@@ -1,5 +1,5 @@
-#ifndef __STDC_HEADERS_H
-#define __STDC_HEADERS_H
+#ifndef CURLINC_STDCHEADERS_H
+#define CURLINC_STDCHEADERS_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
+ * Copyright (C) Daniel Stenberg, , et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -20,6 +20,8 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
+ * SPDX-License-Identifier: curl
+ *
***************************************************************************/
#include
@@ -30,4 +32,4 @@ size_t fwrite(const void *, size_t, size_t, FILE *);
int strcasecmp(const char *, const char *);
int strncasecmp(const char *, const char *, size_t);
-#endif /* __STDC_HEADERS_H */
+#endif /* CURLINC_STDCHEADERS_H */
diff --git a/Source/ThirdParty/curl/system.h b/Source/ThirdParty/curl/system.h
index 1e555ec19..def773924 100644
--- a/Source/ThirdParty/curl/system.h
+++ b/Source/ThirdParty/curl/system.h
@@ -1,5 +1,5 @@
-#ifndef __CURL_SYSTEM_H
-#define __CURL_SYSTEM_H
+#ifndef CURLINC_SYSTEM_H
+#define CURLINC_SYSTEM_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al.
+ * Copyright (C) Daniel Stenberg, , et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -20,6 +20,8 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
+ * SPDX-License-Identifier: curl
+ *
***************************************************************************/
/*
@@ -98,22 +100,6 @@
# define CURL_SUFFIX_CURL_OFF_TU UL
# define CURL_TYPEOF_CURL_SOCKLEN_T int
-#elif defined(__WATCOMC__)
-# if defined(__386__)
-# define CURL_TYPEOF_CURL_OFF_T __int64
-# define CURL_FORMAT_CURL_OFF_T "I64d"
-# define CURL_FORMAT_CURL_OFF_TU "I64u"
-# define CURL_SUFFIX_CURL_OFF_T i64
-# define CURL_SUFFIX_CURL_OFF_TU ui64
-# else
-# define CURL_TYPEOF_CURL_OFF_T long
-# define CURL_FORMAT_CURL_OFF_T "ld"
-# define CURL_FORMAT_CURL_OFF_TU "lu"
-# define CURL_SUFFIX_CURL_OFF_T L
-# define CURL_SUFFIX_CURL_OFF_TU UL
-# endif
-# define CURL_TYPEOF_CURL_SOCKLEN_T int
-
#elif defined(__POCC__)
# if (__POCC__ < 280)
# define CURL_TYPEOF_CURL_OFF_T long
@@ -137,15 +123,26 @@
# define CURL_TYPEOF_CURL_SOCKLEN_T int
#elif defined(__LCC__)
-# define CURL_TYPEOF_CURL_OFF_T long
-# define CURL_FORMAT_CURL_OFF_T "ld"
-# define CURL_FORMAT_CURL_OFF_TU "lu"
-# define CURL_SUFFIX_CURL_OFF_T L
-# define CURL_SUFFIX_CURL_OFF_TU UL
-# define CURL_TYPEOF_CURL_SOCKLEN_T int
+# if defined(__MCST__) /* MCST eLbrus Compiler Collection */
+# define CURL_TYPEOF_CURL_OFF_T long
+# define CURL_FORMAT_CURL_OFF_T "ld"
+# define CURL_FORMAT_CURL_OFF_TU "lu"
+# define CURL_SUFFIX_CURL_OFF_T L
+# define CURL_SUFFIX_CURL_OFF_TU UL
+# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
+# define CURL_PULL_SYS_TYPES_H 1
+# define CURL_PULL_SYS_SOCKET_H 1
+# else /* Local (or Little) C Compiler */
+# define CURL_TYPEOF_CURL_OFF_T long
+# define CURL_FORMAT_CURL_OFF_T "ld"
+# define CURL_FORMAT_CURL_OFF_TU "lu"
+# define CURL_SUFFIX_CURL_OFF_T L
+# define CURL_SUFFIX_CURL_OFF_TU UL
+# define CURL_TYPEOF_CURL_SOCKLEN_T int
+# endif
#elif defined(__SYMBIAN32__)
-# if defined(__EABI__) /* Treat all ARM compilers equally */
+# if defined(__EABI__) /* Treat all ARM compilers equally */
# define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_FORMAT_CURL_OFF_TU "llu"
@@ -167,13 +164,33 @@
# endif
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
-#elif defined(__MWERKS__)
+#elif defined(macintosh)
+# include
+# if TYPE_LONGLONG
+# define CURL_TYPEOF_CURL_OFF_T long long
+# define CURL_FORMAT_CURL_OFF_T "lld"
+# define CURL_FORMAT_CURL_OFF_TU "llu"
+# define CURL_SUFFIX_CURL_OFF_T LL
+# define CURL_SUFFIX_CURL_OFF_TU ULL
+# else
+# define CURL_TYPEOF_CURL_OFF_T long
+# define CURL_FORMAT_CURL_OFF_T "ld"
+# define CURL_FORMAT_CURL_OFF_TU "lu"
+# define CURL_SUFFIX_CURL_OFF_T L
+# define CURL_SUFFIX_CURL_OFF_TU UL
+# endif
+# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
+
+#elif defined(__TANDEM)
+# if ! defined(__LP64)
+ /* Required for 32-bit NonStop builds only. */
# define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_FORMAT_CURL_OFF_TU "llu"
# define CURL_SUFFIX_CURL_OFF_T LL
# define CURL_SUFFIX_CURL_OFF_TU ULL
# define CURL_TYPEOF_CURL_SOCKLEN_T int
+# endif
#elif defined(_WIN32_WCE)
# define CURL_TYPEOF_CURL_OFF_T __int64
@@ -210,16 +227,14 @@
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
#elif defined(__OS400__)
-# if defined(__ILEC400__)
-# define CURL_TYPEOF_CURL_OFF_T long long
-# define CURL_FORMAT_CURL_OFF_T "lld"
-# define CURL_FORMAT_CURL_OFF_TU "llu"
-# define CURL_SUFFIX_CURL_OFF_T LL
-# define CURL_SUFFIX_CURL_OFF_TU ULL
-# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
-# define CURL_PULL_SYS_TYPES_H 1
-# define CURL_PULL_SYS_SOCKET_H 1
-# endif
+# define CURL_TYPEOF_CURL_OFF_T long long
+# define CURL_FORMAT_CURL_OFF_T "lld"
+# define CURL_FORMAT_CURL_OFF_TU "llu"
+# define CURL_SUFFIX_CURL_OFF_T LL
+# define CURL_SUFFIX_CURL_OFF_TU ULL
+# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
+# define CURL_PULL_SYS_TYPES_H 1
+# define CURL_PULL_SYS_SOCKET_H 1
#elif defined(__MVS__)
# if defined(__IBMC__) || defined(__IBMCPP__)
@@ -288,7 +303,6 @@
# define CURL_TYPEOF_CURL_SOCKLEN_T int
#elif defined(__TINYC__) /* also known as tcc */
-
# define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_FORMAT_CURL_OFF_TU "llu"
@@ -377,6 +391,7 @@
# define CURL_SUFFIX_CURL_OFF_TU ULL
# elif defined(__LP64__) || \
defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__) || \
+ defined(__e2k__) || \
(defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 8) || \
(defined(__LONG_MAX__) && __LONG_MAX__ == 9223372036854775807L)
# define CURL_TYPEOF_CURL_OFF_T long
@@ -473,21 +488,21 @@
*/
#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)
-# define __CURL_OFF_T_C_HLPR2(x) x
-# define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x)
-# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
- __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)
-# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
- __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)
+# define CURLINC_OFF_T_C_HLPR2(x) x
+# define CURLINC_OFF_T_C_HLPR1(x) CURLINC_OFF_T_C_HLPR2(x)
+# define CURL_OFF_T_C(Val) CURLINC_OFF_T_C_HLPR1(Val) ## \
+ CURLINC_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)
+# define CURL_OFF_TU_C(Val) CURLINC_OFF_T_C_HLPR1(Val) ## \
+ CURLINC_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)
#else
# ifdef CURL_ISOCPP
-# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix
+# define CURLINC_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix
# else
-# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix
+# define CURLINC_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix
# endif
-# define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix)
-# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
-# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
+# define CURLINC_OFF_T_C_HLPR1(Val,Suffix) CURLINC_OFF_T_C_HLPR2(Val,Suffix)
+# define CURL_OFF_T_C(Val) CURLINC_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
+# define CURL_OFF_TU_C(Val) CURLINC_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
#endif
-#endif /* __CURL_SYSTEM_H */
+#endif /* CURLINC_SYSTEM_H */
diff --git a/Source/ThirdParty/curl/typecheck-gcc.h b/Source/ThirdParty/curl/typecheck-gcc.h
index 8018ea37f..bc8d7a78c 100644
--- a/Source/ThirdParty/curl/typecheck-gcc.h
+++ b/Source/ThirdParty/curl/typecheck-gcc.h
@@ -1,5 +1,5 @@
-#ifndef __CURL_TYPECHECK_GCC_H
-#define __CURL_TYPECHECK_GCC_H
+#ifndef CURLINC_TYPECHECK_GCC_H
+#define CURLINC_TYPECHECK_GCC_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al.
+ * Copyright (C) Daniel Stenberg, , et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -20,15 +20,17 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
+ * SPDX-License-Identifier: curl
+ *
***************************************************************************/
/* wraps curl_easy_setopt() with typechecking */
/* To add a new kind of warning, add an
- * if(_curl_is_sometype_option(_curl_opt))
- * if(!_curl_is_sometype(value))
+ * if(curlcheck_sometype_option(_curl_opt))
+ * if(!curlcheck_sometype(value))
* _curl_easy_setopt_err_sometype();
- * block and define _curl_is_sometype_option, _curl_is_sometype and
+ * block and define curlcheck_sometype_option, curlcheck_sometype and
* _curl_easy_setopt_err_sometype below
*
* NOTE: We use two nested 'if' statements here instead of the && operator, in
@@ -38,117 +40,119 @@
* To add an option that uses the same type as an existing option, you'll just
* need to extend the appropriate _curl_*_option macro
*/
-#define curl_easy_setopt(handle, option, value) \
-__extension__ ({ \
- __typeof__(option) _curl_opt = option; \
- if(__builtin_constant_p(_curl_opt)) { \
- if(_curl_is_long_option(_curl_opt)) \
- if(!_curl_is_long(value)) \
- _curl_easy_setopt_err_long(); \
- if(_curl_is_off_t_option(_curl_opt)) \
- if(!_curl_is_off_t(value)) \
- _curl_easy_setopt_err_curl_off_t(); \
- if(_curl_is_string_option(_curl_opt)) \
- if(!_curl_is_string(value)) \
- _curl_easy_setopt_err_string(); \
- if(_curl_is_write_cb_option(_curl_opt)) \
- if(!_curl_is_write_cb(value)) \
- _curl_easy_setopt_err_write_callback(); \
- if((_curl_opt) == CURLOPT_RESOLVER_START_FUNCTION) \
- if(!_curl_is_resolver_start_callback(value)) \
- _curl_easy_setopt_err_resolver_start_callback(); \
- if((_curl_opt) == CURLOPT_READFUNCTION) \
- if(!_curl_is_read_cb(value)) \
- _curl_easy_setopt_err_read_cb(); \
- if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
- if(!_curl_is_ioctl_cb(value)) \
- _curl_easy_setopt_err_ioctl_cb(); \
- if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
- if(!_curl_is_sockopt_cb(value)) \
- _curl_easy_setopt_err_sockopt_cb(); \
- if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
- if(!_curl_is_opensocket_cb(value)) \
- _curl_easy_setopt_err_opensocket_cb(); \
- if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
- if(!_curl_is_progress_cb(value)) \
- _curl_easy_setopt_err_progress_cb(); \
- if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
- if(!_curl_is_debug_cb(value)) \
- _curl_easy_setopt_err_debug_cb(); \
- if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
- if(!_curl_is_ssl_ctx_cb(value)) \
- _curl_easy_setopt_err_ssl_ctx_cb(); \
- if(_curl_is_conv_cb_option(_curl_opt)) \
- if(!_curl_is_conv_cb(value)) \
- _curl_easy_setopt_err_conv_cb(); \
- if((_curl_opt) == CURLOPT_SEEKFUNCTION) \
- if(!_curl_is_seek_cb(value)) \
- _curl_easy_setopt_err_seek_cb(); \
- if(_curl_is_cb_data_option(_curl_opt)) \
- if(!_curl_is_cb_data(value)) \
- _curl_easy_setopt_err_cb_data(); \
- if((_curl_opt) == CURLOPT_ERRORBUFFER) \
- if(!_curl_is_error_buffer(value)) \
- _curl_easy_setopt_err_error_buffer(); \
- if((_curl_opt) == CURLOPT_STDERR) \
- if(!_curl_is_FILE(value)) \
- _curl_easy_setopt_err_FILE(); \
- if(_curl_is_postfields_option(_curl_opt)) \
- if(!_curl_is_postfields(value)) \
- _curl_easy_setopt_err_postfields(); \
- if((_curl_opt) == CURLOPT_HTTPPOST) \
- if(!_curl_is_arr((value), struct curl_httppost)) \
- _curl_easy_setopt_err_curl_httpost(); \
- if((_curl_opt) == CURLOPT_MIMEPOST) \
- if(!_curl_is_ptr((value), curl_mime)) \
- _curl_easy_setopt_err_curl_mimepost(); \
- if(_curl_is_slist_option(_curl_opt)) \
- if(!_curl_is_arr((value), struct curl_slist)) \
- _curl_easy_setopt_err_curl_slist(); \
- if((_curl_opt) == CURLOPT_SHARE) \
- if(!_curl_is_ptr((value), CURLSH)) \
- _curl_easy_setopt_err_CURLSH(); \
- } \
- curl_easy_setopt(handle, _curl_opt, value); \
-})
+#define curl_easy_setopt(handle, option, value) \
+ __extension__({ \
+ CURLoption _curl_opt = (option); \
+ if(__builtin_constant_p(_curl_opt)) { \
+ CURL_IGNORE_DEPRECATION( \
+ if(curlcheck_long_option(_curl_opt)) \
+ if(!curlcheck_long(value)) \
+ _curl_easy_setopt_err_long(); \
+ if(curlcheck_off_t_option(_curl_opt)) \
+ if(!curlcheck_off_t(value)) \
+ _curl_easy_setopt_err_curl_off_t(); \
+ if(curlcheck_string_option(_curl_opt)) \
+ if(!curlcheck_string(value)) \
+ _curl_easy_setopt_err_string(); \
+ if(curlcheck_write_cb_option(_curl_opt)) \
+ if(!curlcheck_write_cb(value)) \
+ _curl_easy_setopt_err_write_callback(); \
+ if((_curl_opt) == CURLOPT_RESOLVER_START_FUNCTION) \
+ if(!curlcheck_resolver_start_callback(value)) \
+ _curl_easy_setopt_err_resolver_start_callback(); \
+ if((_curl_opt) == CURLOPT_READFUNCTION) \
+ if(!curlcheck_read_cb(value)) \
+ _curl_easy_setopt_err_read_cb(); \
+ if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
+ if(!curlcheck_ioctl_cb(value)) \
+ _curl_easy_setopt_err_ioctl_cb(); \
+ if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
+ if(!curlcheck_sockopt_cb(value)) \
+ _curl_easy_setopt_err_sockopt_cb(); \
+ if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
+ if(!curlcheck_opensocket_cb(value)) \
+ _curl_easy_setopt_err_opensocket_cb(); \
+ if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
+ if(!curlcheck_progress_cb(value)) \
+ _curl_easy_setopt_err_progress_cb(); \
+ if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
+ if(!curlcheck_debug_cb(value)) \
+ _curl_easy_setopt_err_debug_cb(); \
+ if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
+ if(!curlcheck_ssl_ctx_cb(value)) \
+ _curl_easy_setopt_err_ssl_ctx_cb(); \
+ if(curlcheck_conv_cb_option(_curl_opt)) \
+ if(!curlcheck_conv_cb(value)) \
+ _curl_easy_setopt_err_conv_cb(); \
+ if((_curl_opt) == CURLOPT_SEEKFUNCTION) \
+ if(!curlcheck_seek_cb(value)) \
+ _curl_easy_setopt_err_seek_cb(); \
+ if(curlcheck_cb_data_option(_curl_opt)) \
+ if(!curlcheck_cb_data(value)) \
+ _curl_easy_setopt_err_cb_data(); \
+ if((_curl_opt) == CURLOPT_ERRORBUFFER) \
+ if(!curlcheck_error_buffer(value)) \
+ _curl_easy_setopt_err_error_buffer(); \
+ if((_curl_opt) == CURLOPT_STDERR) \
+ if(!curlcheck_FILE(value)) \
+ _curl_easy_setopt_err_FILE(); \
+ if(curlcheck_postfields_option(_curl_opt)) \
+ if(!curlcheck_postfields(value)) \
+ _curl_easy_setopt_err_postfields(); \
+ if((_curl_opt) == CURLOPT_HTTPPOST) \
+ if(!curlcheck_arr((value), struct curl_httppost)) \
+ _curl_easy_setopt_err_curl_httpost(); \
+ if((_curl_opt) == CURLOPT_MIMEPOST) \
+ if(!curlcheck_ptr((value), curl_mime)) \
+ _curl_easy_setopt_err_curl_mimepost(); \
+ if(curlcheck_slist_option(_curl_opt)) \
+ if(!curlcheck_arr((value), struct curl_slist)) \
+ _curl_easy_setopt_err_curl_slist(); \
+ if((_curl_opt) == CURLOPT_SHARE) \
+ if(!curlcheck_ptr((value), CURLSH)) \
+ _curl_easy_setopt_err_CURLSH(); \
+ ) \
+ } \
+ curl_easy_setopt(handle, _curl_opt, value); \
+ })
/* wraps curl_easy_getinfo() with typechecking */
-/* FIXME: don't allow const pointers */
-#define curl_easy_getinfo(handle, info, arg) \
-__extension__ ({ \
- __typeof__(info) _curl_info = info; \
- if(__builtin_constant_p(_curl_info)) { \
- if(_curl_is_string_info(_curl_info)) \
- if(!_curl_is_arr((arg), char *)) \
- _curl_easy_getinfo_err_string(); \
- if(_curl_is_long_info(_curl_info)) \
- if(!_curl_is_arr((arg), long)) \
- _curl_easy_getinfo_err_long(); \
- if(_curl_is_double_info(_curl_info)) \
- if(!_curl_is_arr((arg), double)) \
- _curl_easy_getinfo_err_double(); \
- if(_curl_is_slist_info(_curl_info)) \
- if(!_curl_is_arr((arg), struct curl_slist *)) \
- _curl_easy_getinfo_err_curl_slist(); \
- if(_curl_is_tlssessioninfo_info(_curl_info)) \
- if(!_curl_is_arr((arg), struct curl_tlssessioninfo *)) \
- _curl_easy_getinfo_err_curl_tlssesssioninfo(); \
- if(_curl_is_certinfo_info(_curl_info)) \
- if(!_curl_is_arr((arg), struct curl_certinfo *)) \
- _curl_easy_getinfo_err_curl_certinfo(); \
- if(_curl_is_socket_info(_curl_info)) \
- if(!_curl_is_arr((arg), curl_socket_t)) \
- _curl_easy_getinfo_err_curl_socket(); \
- if(_curl_is_off_t_info(_curl_info)) \
- if(!_curl_is_arr((arg), curl_off_t)) \
- _curl_easy_getinfo_err_curl_off_t(); \
- } \
- curl_easy_getinfo(handle, _curl_info, arg); \
-})
+#define curl_easy_getinfo(handle, info, arg) \
+ __extension__({ \
+ CURLINFO _curl_info = (info); \
+ if(__builtin_constant_p(_curl_info)) { \
+ CURL_IGNORE_DEPRECATION( \
+ if(curlcheck_string_info(_curl_info)) \
+ if(!curlcheck_arr((arg), char *)) \
+ _curl_easy_getinfo_err_string(); \
+ if(curlcheck_long_info(_curl_info)) \
+ if(!curlcheck_arr((arg), long)) \
+ _curl_easy_getinfo_err_long(); \
+ if(curlcheck_double_info(_curl_info)) \
+ if(!curlcheck_arr((arg), double)) \
+ _curl_easy_getinfo_err_double(); \
+ if(curlcheck_slist_info(_curl_info)) \
+ if(!curlcheck_arr((arg), struct curl_slist *)) \
+ _curl_easy_getinfo_err_curl_slist(); \
+ if(curlcheck_tlssessioninfo_info(_curl_info)) \
+ if(!curlcheck_arr((arg), struct curl_tlssessioninfo *)) \
+ _curl_easy_getinfo_err_curl_tlssesssioninfo(); \
+ if(curlcheck_certinfo_info(_curl_info)) \
+ if(!curlcheck_arr((arg), struct curl_certinfo *)) \
+ _curl_easy_getinfo_err_curl_certinfo(); \
+ if(curlcheck_socket_info(_curl_info)) \
+ if(!curlcheck_arr((arg), curl_socket_t)) \
+ _curl_easy_getinfo_err_curl_socket(); \
+ if(curlcheck_off_t_info(_curl_info)) \
+ if(!curlcheck_arr((arg), curl_off_t)) \
+ _curl_easy_getinfo_err_curl_off_t(); \
+ ) \
+ } \
+ curl_easy_getinfo(handle, _curl_info, arg); \
+ })
-/* TODO: typechecking for curl_share_setopt() and curl_multi_setopt(),
- * for now just make sure that the functions are called with three
- * arguments
+/*
+ * For now, just make sure that the functions are called with three arguments
*/
#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
@@ -158,83 +162,83 @@ __extension__ ({ \
* functions */
/* To define a new warning, use _CURL_WARNING(identifier, "message") */
-#define _CURL_WARNING(id, message) \
- static void __attribute__((__warning__(message))) \
- __attribute__((__unused__)) __attribute__((__noinline__)) \
+#define CURLWARNING(id, message) \
+ static void __attribute__((__warning__(message))) \
+ __attribute__((__unused__)) __attribute__((__noinline__)) \
id(void) { __asm__(""); }
-_CURL_WARNING(_curl_easy_setopt_err_long,
+CURLWARNING(_curl_easy_setopt_err_long,
"curl_easy_setopt expects a long argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_curl_off_t,
+CURLWARNING(_curl_easy_setopt_err_curl_off_t,
"curl_easy_setopt expects a curl_off_t argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_string,
+CURLWARNING(_curl_easy_setopt_err_string,
"curl_easy_setopt expects a "
"string ('char *' or char[]) argument for this option"
)
-_CURL_WARNING(_curl_easy_setopt_err_write_callback,
+CURLWARNING(_curl_easy_setopt_err_write_callback,
"curl_easy_setopt expects a curl_write_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_resolver_start_callback,
+CURLWARNING(_curl_easy_setopt_err_resolver_start_callback,
"curl_easy_setopt expects a "
"curl_resolver_start_callback argument for this option"
)
-_CURL_WARNING(_curl_easy_setopt_err_read_cb,
+CURLWARNING(_curl_easy_setopt_err_read_cb,
"curl_easy_setopt expects a curl_read_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,
+CURLWARNING(_curl_easy_setopt_err_ioctl_cb,
"curl_easy_setopt expects a curl_ioctl_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb,
+CURLWARNING(_curl_easy_setopt_err_sockopt_cb,
"curl_easy_setopt expects a curl_sockopt_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb,
+CURLWARNING(_curl_easy_setopt_err_opensocket_cb,
"curl_easy_setopt expects a "
"curl_opensocket_callback argument for this option"
)
-_CURL_WARNING(_curl_easy_setopt_err_progress_cb,
+CURLWARNING(_curl_easy_setopt_err_progress_cb,
"curl_easy_setopt expects a curl_progress_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_debug_cb,
+CURLWARNING(_curl_easy_setopt_err_debug_cb,
"curl_easy_setopt expects a curl_debug_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb,
+CURLWARNING(_curl_easy_setopt_err_ssl_ctx_cb,
"curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_conv_cb,
+CURLWARNING(_curl_easy_setopt_err_conv_cb,
"curl_easy_setopt expects a curl_conv_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_seek_cb,
+CURLWARNING(_curl_easy_setopt_err_seek_cb,
"curl_easy_setopt expects a curl_seek_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_cb_data,
+CURLWARNING(_curl_easy_setopt_err_cb_data,
"curl_easy_setopt expects a "
"private data pointer as argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_error_buffer,
+CURLWARNING(_curl_easy_setopt_err_error_buffer,
"curl_easy_setopt expects a "
"char buffer of CURL_ERROR_SIZE as argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_FILE,
+CURLWARNING(_curl_easy_setopt_err_FILE,
"curl_easy_setopt expects a 'FILE *' argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_postfields,
+CURLWARNING(_curl_easy_setopt_err_postfields,
"curl_easy_setopt expects a 'void *' or 'char *' argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_curl_httpost,
+CURLWARNING(_curl_easy_setopt_err_curl_httpost,
"curl_easy_setopt expects a 'struct curl_httppost *' "
"argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_curl_mimepost,
+CURLWARNING(_curl_easy_setopt_err_curl_mimepost,
"curl_easy_setopt expects a 'curl_mime *' "
"argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_curl_slist,
+CURLWARNING(_curl_easy_setopt_err_curl_slist,
"curl_easy_setopt expects a 'struct curl_slist *' argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_CURLSH,
+CURLWARNING(_curl_easy_setopt_err_CURLSH,
"curl_easy_setopt expects a CURLSH* argument for this option")
-_CURL_WARNING(_curl_easy_getinfo_err_string,
+CURLWARNING(_curl_easy_getinfo_err_string,
"curl_easy_getinfo expects a pointer to 'char *' for this info")
-_CURL_WARNING(_curl_easy_getinfo_err_long,
+CURLWARNING(_curl_easy_getinfo_err_long,
"curl_easy_getinfo expects a pointer to long for this info")
-_CURL_WARNING(_curl_easy_getinfo_err_double,
+CURLWARNING(_curl_easy_getinfo_err_double,
"curl_easy_getinfo expects a pointer to double for this info")
-_CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
+CURLWARNING(_curl_easy_getinfo_err_curl_slist,
"curl_easy_getinfo expects a pointer to 'struct curl_slist *' for this info")
-_CURL_WARNING(_curl_easy_getinfo_err_curl_tlssesssioninfo,
+CURLWARNING(_curl_easy_getinfo_err_curl_tlssesssioninfo,
"curl_easy_getinfo expects a pointer to "
"'struct curl_tlssessioninfo *' for this info")
-_CURL_WARNING(_curl_easy_getinfo_err_curl_certinfo,
+CURLWARNING(_curl_easy_getinfo_err_curl_certinfo,
"curl_easy_getinfo expects a pointer to "
"'struct curl_certinfo *' for this info")
-_CURL_WARNING(_curl_easy_getinfo_err_curl_socket,
+CURLWARNING(_curl_easy_getinfo_err_curl_socket,
"curl_easy_getinfo expects a pointer to curl_socket_t for this info")
-_CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
+CURLWARNING(_curl_easy_getinfo_err_curl_off_t,
"curl_easy_getinfo expects a pointer to curl_off_t for this info")
/* groups of curl_easy_setops options that take the same type of argument */
@@ -246,14 +250,14 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
*/
/* evaluates to true if option takes a long argument */
-#define _curl_is_long_option(option) \
+#define curlcheck_long_option(option) \
(0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT)
-#define _curl_is_off_t_option(option) \
- ((option) > CURLOPTTYPE_OFF_T)
+#define curlcheck_off_t_option(option) \
+ (((option) > CURLOPTTYPE_OFF_T) && ((option) < CURLOPTTYPE_BLOB))
/* evaluates to true if option takes a char* argument */
-#define _curl_is_string_option(option) \
+#define curlcheck_string_option(option) \
((option) == CURLOPT_ABSTRACT_UNIX_SOCKET || \
(option) == CURLOPT_ACCEPT_ENCODING || \
(option) == CURLOPT_ALTSVC || \
@@ -272,9 +276,10 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
(option) == CURLOPT_DNS_SERVERS || \
(option) == CURLOPT_DOH_URL || \
(option) == CURLOPT_EGDSOCKET || \
- (option) == CURLOPT_FTPPORT || \
(option) == CURLOPT_FTP_ACCOUNT || \
(option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \
+ (option) == CURLOPT_FTPPORT || \
+ (option) == CURLOPT_HSTS || \
(option) == CURLOPT_INTERFACE || \
(option) == CURLOPT_ISSUERCERT || \
(option) == CURLOPT_KEYPASSWD || \
@@ -287,33 +292,40 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
(option) == CURLOPT_PASSWORD || \
(option) == CURLOPT_PINNEDPUBLICKEY || \
(option) == CURLOPT_PRE_PROXY || \
+ (option) == CURLOPT_PROTOCOLS_STR || \
(option) == CURLOPT_PROXY || \
- (option) == CURLOPT_PROXYPASSWORD || \
- (option) == CURLOPT_PROXYUSERNAME || \
- (option) == CURLOPT_PROXYUSERPWD || \
(option) == CURLOPT_PROXY_CAINFO || \
(option) == CURLOPT_PROXY_CAPATH || \
(option) == CURLOPT_PROXY_CRLFILE || \
+ (option) == CURLOPT_PROXY_ISSUERCERT || \
(option) == CURLOPT_PROXY_KEYPASSWD || \
(option) == CURLOPT_PROXY_PINNEDPUBLICKEY || \
(option) == CURLOPT_PROXY_SERVICE_NAME || \
+ (option) == CURLOPT_PROXY_SSL_CIPHER_LIST || \
(option) == CURLOPT_PROXY_SSLCERT || \
(option) == CURLOPT_PROXY_SSLCERTTYPE || \
(option) == CURLOPT_PROXY_SSLKEY || \
(option) == CURLOPT_PROXY_SSLKEYTYPE || \
- (option) == CURLOPT_PROXY_SSL_CIPHER_LIST || \
+ (option) == CURLOPT_PROXY_TLS13_CIPHERS || \
(option) == CURLOPT_PROXY_TLSAUTH_PASSWORD || \
- (option) == CURLOPT_PROXY_TLSAUTH_USERNAME || \
(option) == CURLOPT_PROXY_TLSAUTH_TYPE || \
+ (option) == CURLOPT_PROXY_TLSAUTH_USERNAME || \
+ (option) == CURLOPT_PROXYPASSWORD || \
+ (option) == CURLOPT_PROXYUSERNAME || \
+ (option) == CURLOPT_PROXYUSERPWD || \
(option) == CURLOPT_RANDOM_FILE || \
(option) == CURLOPT_RANGE || \
+ (option) == CURLOPT_REDIR_PROTOCOLS_STR || \
(option) == CURLOPT_REFERER || \
+ (option) == CURLOPT_REQUEST_TARGET || \
(option) == CURLOPT_RTSP_SESSION_ID || \
(option) == CURLOPT_RTSP_STREAM_URI || \
(option) == CURLOPT_RTSP_TRANSPORT || \
+ (option) == CURLOPT_SASL_AUTHZID || \
(option) == CURLOPT_SERVICE_NAME || \
(option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \
(option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \
+ (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 || \
(option) == CURLOPT_SSH_KNOWNHOSTS || \
(option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
(option) == CURLOPT_SSH_PUBLIC_KEYFILE || \
@@ -323,6 +335,7 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
(option) == CURLOPT_SSLKEY || \
(option) == CURLOPT_SSLKEYTYPE || \
(option) == CURLOPT_SSL_CIPHER_LIST || \
+ (option) == CURLOPT_TLS13_CIPHERS || \
(option) == CURLOPT_TLSAUTH_PASSWORD || \
(option) == CURLOPT_TLSAUTH_TYPE || \
(option) == CURLOPT_TLSAUTH_USERNAME || \
@@ -330,32 +343,36 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
(option) == CURLOPT_URL || \
(option) == CURLOPT_USERAGENT || \
(option) == CURLOPT_USERNAME || \
+ (option) == CURLOPT_AWS_SIGV4 || \
(option) == CURLOPT_USERPWD || \
(option) == CURLOPT_XOAUTH2_BEARER || \
+ (option) == CURLOPT_SSL_EC_CURVES || \
0)
/* evaluates to true if option takes a curl_write_callback argument */
-#define _curl_is_write_cb_option(option) \
- ((option) == CURLOPT_HEADERFUNCTION || \
+#define curlcheck_write_cb_option(option) \
+ ((option) == CURLOPT_HEADERFUNCTION || \
(option) == CURLOPT_WRITEFUNCTION)
/* evaluates to true if option takes a curl_conv_callback argument */
-#define _curl_is_conv_cb_option(option) \
- ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \
- (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \
+#define curlcheck_conv_cb_option(option) \
+ ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \
+ (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \
(option) == CURLOPT_CONV_FROM_UTF8_FUNCTION)
/* evaluates to true if option takes a data argument to pass to a callback */
-#define _curl_is_cb_data_option(option) \
+#define curlcheck_cb_data_option(option) \
((option) == CURLOPT_CHUNK_DATA || \
(option) == CURLOPT_CLOSESOCKETDATA || \
(option) == CURLOPT_DEBUGDATA || \
(option) == CURLOPT_FNMATCH_DATA || \
(option) == CURLOPT_HEADERDATA || \
+ (option) == CURLOPT_HSTSREADDATA || \
+ (option) == CURLOPT_HSTSWRITEDATA || \
(option) == CURLOPT_INTERLEAVEDATA || \
(option) == CURLOPT_IOCTLDATA || \
(option) == CURLOPT_OPENSOCKETDATA || \
- (option) == CURLOPT_PRIVATE || \
+ (option) == CURLOPT_PREREQDATA || \
(option) == CURLOPT_PROGRESSDATA || \
(option) == CURLOPT_READDATA || \
(option) == CURLOPT_SEEKDATA || \
@@ -364,17 +381,18 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
(option) == CURLOPT_SSL_CTX_DATA || \
(option) == CURLOPT_WRITEDATA || \
(option) == CURLOPT_RESOLVER_START_DATA || \
- (option) == CURLOPT_CURLU || \
+ (option) == CURLOPT_TRAILERDATA || \
+ (option) == CURLOPT_SSH_HOSTKEYDATA || \
0)
/* evaluates to true if option takes a POST data argument (void* or char*) */
-#define _curl_is_postfields_option(option) \
+#define curlcheck_postfields_option(option) \
((option) == CURLOPT_POSTFIELDS || \
(option) == CURLOPT_COPYPOSTFIELDS || \
0)
/* evaluates to true if option takes a struct curl_slist * argument */
-#define _curl_is_slist_option(option) \
+#define curlcheck_slist_option(option) \
((option) == CURLOPT_HTTP200ALIASES || \
(option) == CURLOPT_HTTPHEADER || \
(option) == CURLOPT_MAIL_RCPT || \
@@ -384,45 +402,47 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
(option) == CURLOPT_QUOTE || \
(option) == CURLOPT_RESOLVE || \
(option) == CURLOPT_TELNETOPTIONS || \
+ (option) == CURLOPT_CONNECT_TO || \
0)
/* groups of curl_easy_getinfo infos that take the same type of argument */
/* evaluates to true if info expects a pointer to char * argument */
-#define _curl_is_string_info(info) \
- (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG)
+#define curlcheck_string_info(info) \
+ (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG && \
+ (info) != CURLINFO_PRIVATE)
/* evaluates to true if info expects a pointer to long argument */
-#define _curl_is_long_info(info) \
+#define curlcheck_long_info(info) \
(CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE)
/* evaluates to true if info expects a pointer to double argument */
-#define _curl_is_double_info(info) \
+#define curlcheck_double_info(info) \
(CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST)
/* true if info expects a pointer to struct curl_slist * argument */
-#define _curl_is_slist_info(info) \
+#define curlcheck_slist_info(info) \
(((info) == CURLINFO_SSL_ENGINES) || ((info) == CURLINFO_COOKIELIST))
/* true if info expects a pointer to struct curl_tlssessioninfo * argument */
-#define _curl_is_tlssessioninfo_info(info) \
+#define curlcheck_tlssessioninfo_info(info) \
(((info) == CURLINFO_TLS_SSL_PTR) || ((info) == CURLINFO_TLS_SESSION))
/* true if info expects a pointer to struct curl_certinfo * argument */
-#define _curl_is_certinfo_info(info) ((info) == CURLINFO_CERTINFO)
+#define curlcheck_certinfo_info(info) ((info) == CURLINFO_CERTINFO)
/* true if info expects a pointer to struct curl_socket_t argument */
-#define _curl_is_socket_info(info) \
+#define curlcheck_socket_info(info) \
(CURLINFO_SOCKET < (info) && (info) < CURLINFO_OFF_T)
/* true if info expects a pointer to curl_off_t argument */
-#define _curl_is_off_t_info(info) \
+#define curlcheck_off_t_info(info) \
(CURLINFO_OFF_T < (info))
-/* typecheck helpers -- check whether given expression has requested type*/
+/* typecheck helpers -- check whether given expression has requested type */
-/* For pointers, you can use the _curl_is_ptr/_curl_is_arr macros,
+/* For pointers, you can use the curlcheck_ptr/curlcheck_arr macros,
* otherwise define a new macro. Search for __builtin_types_compatible_p
* in the GCC manual.
* NOTE: these macros MUST NOT EVALUATE their arguments! The argument is
@@ -432,35 +452,35 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
*/
/* XXX: should evaluate to true if expr is a pointer */
-#define _curl_is_any_ptr(expr) \
+#define curlcheck_any_ptr(expr) \
(sizeof(expr) == sizeof(void *))
/* evaluates to true if expr is NULL */
/* XXX: must not evaluate expr, so this check is not accurate */
-#define _curl_is_NULL(expr) \
+#define curlcheck_NULL(expr) \
(__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL)))
/* evaluates to true if expr is type*, const type* or NULL */
-#define _curl_is_ptr(expr, type) \
- (_curl_is_NULL(expr) || \
- __builtin_types_compatible_p(__typeof__(expr), type *) || \
+#define curlcheck_ptr(expr, type) \
+ (curlcheck_NULL(expr) || \
+ __builtin_types_compatible_p(__typeof__(expr), type *) || \
__builtin_types_compatible_p(__typeof__(expr), const type *))
/* evaluates to true if expr is one of type[], type*, NULL or const type* */
-#define _curl_is_arr(expr, type) \
- (_curl_is_ptr((expr), type) || \
+#define curlcheck_arr(expr, type) \
+ (curlcheck_ptr((expr), type) || \
__builtin_types_compatible_p(__typeof__(expr), type []))
/* evaluates to true if expr is a string */
-#define _curl_is_string(expr) \
- (_curl_is_arr((expr), char) || \
- _curl_is_arr((expr), signed char) || \
- _curl_is_arr((expr), unsigned char))
+#define curlcheck_string(expr) \
+ (curlcheck_arr((expr), char) || \
+ curlcheck_arr((expr), signed char) || \
+ curlcheck_arr((expr), unsigned char))
/* evaluates to true if expr is a long (no matter the signedness)
* XXX: for now, int is also accepted (and therefore short and char, which
* are promoted to int when passed to a variadic function) */
-#define _curl_is_long(expr) \
+#define curlcheck_long(expr) \
(__builtin_types_compatible_p(__typeof__(expr), long) || \
__builtin_types_compatible_p(__typeof__(expr), signed long) || \
__builtin_types_compatible_p(__typeof__(expr), unsigned long) || \
@@ -475,63 +495,59 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
__builtin_types_compatible_p(__typeof__(expr), unsigned char))
/* evaluates to true if expr is of type curl_off_t */
-#define _curl_is_off_t(expr) \
+#define curlcheck_off_t(expr) \
(__builtin_types_compatible_p(__typeof__(expr), curl_off_t))
/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */
/* XXX: also check size of an char[] array? */
-#define _curl_is_error_buffer(expr) \
- (_curl_is_NULL(expr) || \
- __builtin_types_compatible_p(__typeof__(expr), char *) || \
+#define curlcheck_error_buffer(expr) \
+ (curlcheck_NULL(expr) || \
+ __builtin_types_compatible_p(__typeof__(expr), char *) || \
__builtin_types_compatible_p(__typeof__(expr), char[]))
/* evaluates to true if expr is of type (const) void* or (const) FILE* */
#if 0
-#define _curl_is_cb_data(expr) \
- (_curl_is_ptr((expr), void) || \
- _curl_is_ptr((expr), FILE))
+#define curlcheck_cb_data(expr) \
+ (curlcheck_ptr((expr), void) || \
+ curlcheck_ptr((expr), FILE))
#else /* be less strict */
-#define _curl_is_cb_data(expr) \
- _curl_is_any_ptr(expr)
+#define curlcheck_cb_data(expr) \
+ curlcheck_any_ptr(expr)
#endif
/* evaluates to true if expr is of type FILE* */
-#define _curl_is_FILE(expr) \
- (_curl_is_NULL(expr) || \
+#define curlcheck_FILE(expr) \
+ (curlcheck_NULL(expr) || \
(__builtin_types_compatible_p(__typeof__(expr), FILE *)))
/* evaluates to true if expr can be passed as POST data (void* or char*) */
-#define _curl_is_postfields(expr) \
- (_curl_is_ptr((expr), void) || \
- _curl_is_arr((expr), char) || \
- _curl_is_arr((expr), unsigned char))
+#define curlcheck_postfields(expr) \
+ (curlcheck_ptr((expr), void) || \
+ curlcheck_arr((expr), char) || \
+ curlcheck_arr((expr), unsigned char))
-/* FIXME: the whole callback checking is messy...
- * The idea is to tolerate char vs. void and const vs. not const
- * pointers in arguments at least
- */
/* helper: __builtin_types_compatible_p distinguishes between functions and
* function pointers, hide it */
-#define _curl_callback_compatible(func, type) \
- (__builtin_types_compatible_p(__typeof__(func), type) || \
+#define curlcheck_cb_compatible(func, type) \
+ (__builtin_types_compatible_p(__typeof__(func), type) || \
__builtin_types_compatible_p(__typeof__(func) *, type))
/* evaluates to true if expr is of type curl_resolver_start_callback */
-#define _curl_is_resolver_start_callback(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), curl_resolver_start_callback))
+#define curlcheck_resolver_start_callback(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), curl_resolver_start_callback))
/* evaluates to true if expr is of type curl_read_callback or "similar" */
-#define _curl_is_read_cb(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), __typeof__(fread) *) || \
- _curl_callback_compatible((expr), curl_read_callback) || \
- _curl_callback_compatible((expr), _curl_read_callback1) || \
- _curl_callback_compatible((expr), _curl_read_callback2) || \
- _curl_callback_compatible((expr), _curl_read_callback3) || \
- _curl_callback_compatible((expr), _curl_read_callback4) || \
- _curl_callback_compatible((expr), _curl_read_callback5) || \
- _curl_callback_compatible((expr), _curl_read_callback6))
+#define curlcheck_read_cb(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), __typeof__(fread) *) || \
+ curlcheck_cb_compatible((expr), curl_read_callback) || \
+ curlcheck_cb_compatible((expr), _curl_read_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_read_callback2) || \
+ curlcheck_cb_compatible((expr), _curl_read_callback3) || \
+ curlcheck_cb_compatible((expr), _curl_read_callback4) || \
+ curlcheck_cb_compatible((expr), _curl_read_callback5) || \
+ curlcheck_cb_compatible((expr), _curl_read_callback6))
typedef size_t (*_curl_read_callback1)(char *, size_t, size_t, void *);
typedef size_t (*_curl_read_callback2)(char *, size_t, size_t, const void *);
typedef size_t (*_curl_read_callback3)(char *, size_t, size_t, FILE *);
@@ -540,16 +556,16 @@ typedef size_t (*_curl_read_callback5)(void *, size_t, size_t, const void *);
typedef size_t (*_curl_read_callback6)(void *, size_t, size_t, FILE *);
/* evaluates to true if expr is of type curl_write_callback or "similar" */
-#define _curl_is_write_cb(expr) \
- (_curl_is_read_cb(expr) || \
- _curl_callback_compatible((expr), __typeof__(fwrite) *) || \
- _curl_callback_compatible((expr), curl_write_callback) || \
- _curl_callback_compatible((expr), _curl_write_callback1) || \
- _curl_callback_compatible((expr), _curl_write_callback2) || \
- _curl_callback_compatible((expr), _curl_write_callback3) || \
- _curl_callback_compatible((expr), _curl_write_callback4) || \
- _curl_callback_compatible((expr), _curl_write_callback5) || \
- _curl_callback_compatible((expr), _curl_write_callback6))
+#define curlcheck_write_cb(expr) \
+ (curlcheck_read_cb(expr) || \
+ curlcheck_cb_compatible((expr), __typeof__(fwrite) *) || \
+ curlcheck_cb_compatible((expr), curl_write_callback) || \
+ curlcheck_cb_compatible((expr), _curl_write_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_write_callback2) || \
+ curlcheck_cb_compatible((expr), _curl_write_callback3) || \
+ curlcheck_cb_compatible((expr), _curl_write_callback4) || \
+ curlcheck_cb_compatible((expr), _curl_write_callback5) || \
+ curlcheck_cb_compatible((expr), _curl_write_callback6))
typedef size_t (*_curl_write_callback1)(const char *, size_t, size_t, void *);
typedef size_t (*_curl_write_callback2)(const char *, size_t, size_t,
const void *);
@@ -560,37 +576,37 @@ typedef size_t (*_curl_write_callback5)(const void *, size_t, size_t,
typedef size_t (*_curl_write_callback6)(const void *, size_t, size_t, FILE *);
/* evaluates to true if expr is of type curl_ioctl_callback or "similar" */
-#define _curl_is_ioctl_cb(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), curl_ioctl_callback) || \
- _curl_callback_compatible((expr), _curl_ioctl_callback1) || \
- _curl_callback_compatible((expr), _curl_ioctl_callback2) || \
- _curl_callback_compatible((expr), _curl_ioctl_callback3) || \
- _curl_callback_compatible((expr), _curl_ioctl_callback4))
+#define curlcheck_ioctl_cb(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), curl_ioctl_callback) || \
+ curlcheck_cb_compatible((expr), _curl_ioctl_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_ioctl_callback2) || \
+ curlcheck_cb_compatible((expr), _curl_ioctl_callback3) || \
+ curlcheck_cb_compatible((expr), _curl_ioctl_callback4))
typedef curlioerr (*_curl_ioctl_callback1)(CURL *, int, void *);
typedef curlioerr (*_curl_ioctl_callback2)(CURL *, int, const void *);
typedef curlioerr (*_curl_ioctl_callback3)(CURL *, curliocmd, void *);
typedef curlioerr (*_curl_ioctl_callback4)(CURL *, curliocmd, const void *);
/* evaluates to true if expr is of type curl_sockopt_callback or "similar" */
-#define _curl_is_sockopt_cb(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), curl_sockopt_callback) || \
- _curl_callback_compatible((expr), _curl_sockopt_callback1) || \
- _curl_callback_compatible((expr), _curl_sockopt_callback2))
+#define curlcheck_sockopt_cb(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), curl_sockopt_callback) || \
+ curlcheck_cb_compatible((expr), _curl_sockopt_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_sockopt_callback2))
typedef int (*_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
typedef int (*_curl_sockopt_callback2)(const void *, curl_socket_t,
curlsocktype);
/* evaluates to true if expr is of type curl_opensocket_callback or
"similar" */
-#define _curl_is_opensocket_cb(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), curl_opensocket_callback) || \
- _curl_callback_compatible((expr), _curl_opensocket_callback1) || \
- _curl_callback_compatible((expr), _curl_opensocket_callback2) || \
- _curl_callback_compatible((expr), _curl_opensocket_callback3) || \
- _curl_callback_compatible((expr), _curl_opensocket_callback4))
+#define curlcheck_opensocket_cb(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), curl_opensocket_callback) || \
+ curlcheck_cb_compatible((expr), _curl_opensocket_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_opensocket_callback2) || \
+ curlcheck_cb_compatible((expr), _curl_opensocket_callback3) || \
+ curlcheck_cb_compatible((expr), _curl_opensocket_callback4))
typedef curl_socket_t (*_curl_opensocket_callback1)
(void *, curlsocktype, struct curl_sockaddr *);
typedef curl_socket_t (*_curl_opensocket_callback2)
@@ -601,28 +617,28 @@ typedef curl_socket_t (*_curl_opensocket_callback4)
(const void *, curlsocktype, const struct curl_sockaddr *);
/* evaluates to true if expr is of type curl_progress_callback or "similar" */
-#define _curl_is_progress_cb(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), curl_progress_callback) || \
- _curl_callback_compatible((expr), _curl_progress_callback1) || \
- _curl_callback_compatible((expr), _curl_progress_callback2))
+#define curlcheck_progress_cb(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), curl_progress_callback) || \
+ curlcheck_cb_compatible((expr), _curl_progress_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_progress_callback2))
typedef int (*_curl_progress_callback1)(void *,
double, double, double, double);
typedef int (*_curl_progress_callback2)(const void *,
double, double, double, double);
/* evaluates to true if expr is of type curl_debug_callback or "similar" */
-#define _curl_is_debug_cb(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), curl_debug_callback) || \
- _curl_callback_compatible((expr), _curl_debug_callback1) || \
- _curl_callback_compatible((expr), _curl_debug_callback2) || \
- _curl_callback_compatible((expr), _curl_debug_callback3) || \
- _curl_callback_compatible((expr), _curl_debug_callback4) || \
- _curl_callback_compatible((expr), _curl_debug_callback5) || \
- _curl_callback_compatible((expr), _curl_debug_callback6) || \
- _curl_callback_compatible((expr), _curl_debug_callback7) || \
- _curl_callback_compatible((expr), _curl_debug_callback8))
+#define curlcheck_debug_cb(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), curl_debug_callback) || \
+ curlcheck_cb_compatible((expr), _curl_debug_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_debug_callback2) || \
+ curlcheck_cb_compatible((expr), _curl_debug_callback3) || \
+ curlcheck_cb_compatible((expr), _curl_debug_callback4) || \
+ curlcheck_cb_compatible((expr), _curl_debug_callback5) || \
+ curlcheck_cb_compatible((expr), _curl_debug_callback6) || \
+ curlcheck_cb_compatible((expr), _curl_debug_callback7) || \
+ curlcheck_cb_compatible((expr), _curl_debug_callback8))
typedef int (*_curl_debug_callback1) (CURL *,
curl_infotype, char *, size_t, void *);
typedef int (*_curl_debug_callback2) (CURL *,
@@ -642,17 +658,17 @@ typedef int (*_curl_debug_callback8) (CURL *,
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
/* this is getting even messier... */
-#define _curl_is_ssl_ctx_cb(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), curl_ssl_ctx_callback) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback1) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback2) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback3) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback4) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback5) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback6) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback7) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback8))
+#define curlcheck_ssl_ctx_cb(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), curl_ssl_ctx_callback) || \
+ curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback2) || \
+ curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback3) || \
+ curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback4) || \
+ curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback5) || \
+ curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback6) || \
+ curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback7) || \
+ curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback8))
typedef CURLcode (*_curl_ssl_ctx_callback1)(CURL *, void *, void *);
typedef CURLcode (*_curl_ssl_ctx_callback2)(CURL *, void *, const void *);
typedef CURLcode (*_curl_ssl_ctx_callback3)(CURL *, const void *, void *);
@@ -662,11 +678,11 @@ typedef CURLcode (*_curl_ssl_ctx_callback4)(CURL *, const void *,
/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX
* this will of course break if we're included before OpenSSL headers...
*/
-typedef CURLcode (*_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);
-typedef CURLcode (*_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);
-typedef CURLcode (*_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);
-typedef CURLcode (*_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX,
- const void *);
+typedef CURLcode (*_curl_ssl_ctx_callback5)(CURL *, SSL_CTX *, void *);
+typedef CURLcode (*_curl_ssl_ctx_callback6)(CURL *, SSL_CTX *, const void *);
+typedef CURLcode (*_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX *, void *);
+typedef CURLcode (*_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX *,
+ const void *);
#else
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;
@@ -675,26 +691,26 @@ typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8;
#endif
/* evaluates to true if expr is of type curl_conv_callback or "similar" */
-#define _curl_is_conv_cb(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), curl_conv_callback) || \
- _curl_callback_compatible((expr), _curl_conv_callback1) || \
- _curl_callback_compatible((expr), _curl_conv_callback2) || \
- _curl_callback_compatible((expr), _curl_conv_callback3) || \
- _curl_callback_compatible((expr), _curl_conv_callback4))
+#define curlcheck_conv_cb(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), curl_conv_callback) || \
+ curlcheck_cb_compatible((expr), _curl_conv_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_conv_callback2) || \
+ curlcheck_cb_compatible((expr), _curl_conv_callback3) || \
+ curlcheck_cb_compatible((expr), _curl_conv_callback4))
typedef CURLcode (*_curl_conv_callback1)(char *, size_t length);
typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length);
typedef CURLcode (*_curl_conv_callback3)(void *, size_t length);
typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length);
/* evaluates to true if expr is of type curl_seek_callback or "similar" */
-#define _curl_is_seek_cb(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), curl_seek_callback) || \
- _curl_callback_compatible((expr), _curl_seek_callback1) || \
- _curl_callback_compatible((expr), _curl_seek_callback2))
+#define curlcheck_seek_cb(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), curl_seek_callback) || \
+ curlcheck_cb_compatible((expr), _curl_seek_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_seek_callback2))
typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int);
typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int);
-#endif /* __CURL_TYPECHECK_GCC_H */
+#endif /* CURLINC_TYPECHECK_GCC_H */
diff --git a/Source/ThirdParty/curl/urlapi.h b/Source/ThirdParty/curl/urlapi.h
index 850faa97a..b97b53475 100644
--- a/Source/ThirdParty/curl/urlapi.h
+++ b/Source/ThirdParty/curl/urlapi.h
@@ -1,5 +1,5 @@
-#ifndef __CURL_URLAPI_H
-#define __CURL_URLAPI_H
+#ifndef CURLINC_URLAPI_H
+#define CURLINC_URLAPI_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 2018 - 2019, Daniel Stenberg, , et al.
+ * Copyright (C) Daniel Stenberg, , et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -20,6 +20,8 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
+ * SPDX-License-Identifier: curl
+ *
***************************************************************************/
#include "curl.h"
@@ -47,7 +49,21 @@ typedef enum {
CURLUE_NO_HOST, /* 14 */
CURLUE_NO_PORT, /* 15 */
CURLUE_NO_QUERY, /* 16 */
- CURLUE_NO_FRAGMENT /* 17 */
+ CURLUE_NO_FRAGMENT, /* 17 */
+ CURLUE_NO_ZONEID, /* 18 */
+ CURLUE_BAD_FILE_URL, /* 19 */
+ CURLUE_BAD_FRAGMENT, /* 20 */
+ CURLUE_BAD_HOSTNAME, /* 21 */
+ CURLUE_BAD_IPV6, /* 22 */
+ CURLUE_BAD_LOGIN, /* 23 */
+ CURLUE_BAD_PASSWORD, /* 24 */
+ CURLUE_BAD_PATH, /* 25 */
+ CURLUE_BAD_QUERY, /* 26 */
+ CURLUE_BAD_SCHEME, /* 27 */
+ CURLUE_BAD_SLASHES, /* 28 */
+ CURLUE_BAD_USER, /* 29 */
+ CURLUE_LACKS_IDN, /* 30 */
+ CURLUE_LAST
} CURLUcode;
typedef enum {
@@ -60,7 +76,8 @@ typedef enum {
CURLUPART_PORT,
CURLUPART_PATH,
CURLUPART_QUERY,
- CURLUPART_FRAGMENT
+ CURLUPART_FRAGMENT,
+ CURLUPART_ZONEID /* added in 7.65.0 */
} CURLUPart;
#define CURLU_DEFAULT_PORT (1<<0) /* return default port number */
@@ -76,6 +93,10 @@ typedef enum {
#define CURLU_URLENCODE (1<<7) /* URL encode on set */
#define CURLU_APPENDQUERY (1<<8) /* append a form style part */
#define CURLU_GUESS_SCHEME (1<<9) /* legacy curl-style guessing */
+#define CURLU_NO_AUTHORITY (1<<10) /* Allow empty authority when the
+ scheme is unknown. */
+#define CURLU_ALLOW_SPACE (1<<11) /* Allow spaces in the URL */
+#define CURLU_PUNYCODE (1<<12) /* get the host name in pynycode */
typedef struct Curl_URL CURLU;
@@ -114,9 +135,15 @@ CURL_EXTERN CURLUcode curl_url_get(CURLU *handle, CURLUPart what,
CURL_EXTERN CURLUcode curl_url_set(CURLU *handle, CURLUPart what,
const char *part, unsigned int flags);
+/*
+ * curl_url_strerror() turns a CURLUcode value into the equivalent human
+ * readable error string. This is useful for printing meaningful error
+ * messages.
+ */
+CURL_EXTERN const char *curl_url_strerror(CURLUcode);
#ifdef __cplusplus
} /* end of extern "C" */
#endif
-#endif
+#endif /* CURLINC_URLAPI_H */
diff --git a/Source/ThirdParty/curl/websockets.h b/Source/ThirdParty/curl/websockets.h
new file mode 100644
index 000000000..fd6a91654
--- /dev/null
+++ b/Source/ThirdParty/curl/websockets.h
@@ -0,0 +1,84 @@
+#ifndef CURLINC_WEBSOCKETS_H
+#define CURLINC_WEBSOCKETS_H
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) Daniel Stenberg, , et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at https://curl.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ * SPDX-License-Identifier: curl
+ *
+ ***************************************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct curl_ws_frame {
+ int age; /* zero */
+ int flags; /* See the CURLWS_* defines */
+ curl_off_t offset; /* the offset of this data into the frame */
+ curl_off_t bytesleft; /* number of pending bytes left of the payload */
+ size_t len; /* size of the current data chunk */
+};
+
+/* flag bits */
+#define CURLWS_TEXT (1<<0)
+#define CURLWS_BINARY (1<<1)
+#define CURLWS_CONT (1<<2)
+#define CURLWS_CLOSE (1<<3)
+#define CURLWS_PING (1<<4)
+#define CURLWS_OFFSET (1<<5)
+
+/*
+ * NAME curl_ws_recv()
+ *
+ * DESCRIPTION
+ *
+ * Receives data from the websocket connection. Use after successful
+ * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
+ */
+CURL_EXTERN CURLcode curl_ws_recv(CURL *curl, void *buffer, size_t buflen,
+ size_t *recv,
+ struct curl_ws_frame **metap);
+
+/* sendflags for curl_ws_send() */
+#define CURLWS_PONG (1<<6)
+
+/*
+ * NAME curl_easy_send()
+ *
+ * DESCRIPTION
+ *
+ * Sends data over the websocket connection. Use after successful
+ * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
+ */
+CURL_EXTERN CURLcode curl_ws_send(CURL *curl, const void *buffer,
+ size_t buflen, size_t *sent,
+ curl_off_t framesize,
+ unsigned int sendflags);
+
+/* bits for the CURLOPT_WS_OPTIONS bitmask: */
+#define CURLWS_RAW_MODE (1<<0)
+
+CURL_EXTERN struct curl_ws_frame *curl_ws_meta(CURL *curl);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CURLINC_WEBSOCKETS_H */
diff --git a/Source/ThirdParty/freetype/FTL.TXT b/Source/ThirdParty/freetype/FTL.TXT
new file mode 100644
index 000000000..c406d150f
--- /dev/null
+++ b/Source/ThirdParty/freetype/FTL.TXT
@@ -0,0 +1,169 @@
+ The FreeType Project LICENSE
+ ----------------------------
+
+ 2006-Jan-27
+
+ Copyright 1996-2002, 2006 by
+ David Turner, Robert Wilhelm, and Werner Lemberg
+
+
+
+Introduction
+============
+
+ The FreeType Project is distributed in several archive packages;
+ some of them may contain, in addition to the FreeType font engine,
+ various tools and contributions which rely on, or relate to, the
+ FreeType Project.
+
+ This license applies to all files found in such packages, and
+ which do not fall under their own explicit license. The license
+ affects thus the FreeType font engine, the test programs,
+ documentation and makefiles, at the very least.
+
+ This license was inspired by the BSD, Artistic, and IJG
+ (Independent JPEG Group) licenses, which all encourage inclusion
+ and use of free software in commercial and freeware products
+ alike. As a consequence, its main points are that:
+
+ o We don't promise that this software works. However, we will be
+ interested in any kind of bug reports. (`as is' distribution)
+
+ o You can use this software for whatever you want, in parts or
+ full form, without having to pay us. (`royalty-free' usage)
+
+ o You may not pretend that you wrote this software. If you use
+ it, or only parts of it, in a program, you must acknowledge
+ somewhere in your documentation that you have used the
+ FreeType code. (`credits')
+
+ We specifically permit and encourage the inclusion of this
+ software, with or without modifications, in commercial products.
+ We disclaim all warranties covering The FreeType Project and
+ assume no liability related to The FreeType Project.
+
+
+ Finally, many people asked us for a preferred form for a
+ credit/disclaimer to use in compliance with this license. We thus
+ encourage you to use the following text:
+
+ """
+ Portions of this software are copyright © The FreeType
+ Project (www.freetype.org). All rights reserved.
+ """
+
+ Please replace with the value from the FreeType version you
+ actually use.
+
+
+Legal Terms
+===========
+
+0. Definitions
+--------------
+
+ Throughout this license, the terms `package', `FreeType Project',
+ and `FreeType archive' refer to the set of files originally
+ distributed by the authors (David Turner, Robert Wilhelm, and
+ Werner Lemberg) as the `FreeType Project', be they named as alpha,
+ beta or final release.
+
+ `You' refers to the licensee, or person using the project, where
+ `using' is a generic term including compiling the project's source
+ code as well as linking it to form a `program' or `executable'.
+ This program is referred to as `a program using the FreeType
+ engine'.
+
+ This license applies to all files distributed in the original
+ FreeType Project, including all source code, binaries and
+ documentation, unless otherwise stated in the file in its
+ original, unmodified form as distributed in the original archive.
+ If you are unsure whether or not a particular file is covered by
+ this license, you must contact us to verify this.
+
+ The FreeType Project is copyright (C) 1996-2000 by David Turner,
+ Robert Wilhelm, and Werner Lemberg. All rights reserved except as
+ specified below.
+
+1. No Warranty
+--------------
+
+ THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO
+ USE, OF THE FREETYPE PROJECT.
+
+2. Redistribution
+-----------------
+
+ This license grants a worldwide, royalty-free, perpetual and
+ irrevocable right and license to use, execute, perform, compile,
+ display, copy, create derivative works of, distribute and
+ sublicense the FreeType Project (in both source and object code
+ forms) and derivative works thereof for any purpose; and to
+ authorize others to exercise some or all of the rights granted
+ herein, subject to the following conditions:
+
+ o Redistribution of source code must retain this license file
+ (`FTL.TXT') unaltered; any additions, deletions or changes to
+ the original files must be clearly indicated in accompanying
+ documentation. The copyright notices of the unaltered,
+ original files must be preserved in all copies of source
+ files.
+
+ o Redistribution in binary form must provide a disclaimer that
+ states that the software is based in part of the work of the
+ FreeType Team, in the distribution documentation. We also
+ encourage you to put an URL to the FreeType web page in your
+ documentation, though this isn't mandatory.
+
+ These conditions apply to any software derived from or based on
+ the FreeType Project, not just the unmodified files. If you use
+ our work, you must acknowledge us. However, no fee need be paid
+ to us.
+
+3. Advertising
+--------------
+
+ Neither the FreeType authors and contributors nor you shall use
+ the name of the other for commercial, advertising, or promotional
+ purposes without specific prior written permission.
+
+ We suggest, but do not require, that you use one or more of the
+ following phrases to refer to this software in your documentation
+ or advertising materials: `FreeType Project', `FreeType Engine',
+ `FreeType library', or `FreeType Distribution'.
+
+ As you have not signed this license, you are not required to
+ accept it. However, as the FreeType Project is copyrighted
+ material, only this license, or another one contracted with the
+ authors, grants you the right to use, distribute, and modify it.
+ Therefore, by using, distributing, or modifying the FreeType
+ Project, you indicate that you understand and accept all the terms
+ of this license.
+
+4. Contacts
+-----------
+
+ There are two mailing lists related to FreeType:
+
+ o freetype@nongnu.org
+
+ Discusses general use and applications of FreeType, as well as
+ future and wanted additions to the library and distribution.
+ If you are looking for support, start in this list if you
+ haven't found anything to help you in the documentation.
+
+ o freetype-devel@nongnu.org
+
+ Discusses bugs, as well as engine internals, design issues,
+ specific licenses, porting, etc.
+
+ Our home page can be found at
+
+ https://www.freetype.org
+
+
+--- end of FTL.TXT ---
diff --git a/Source/ThirdParty/freetype/LICENSE.TXT b/Source/ThirdParty/freetype/LICENSE.TXT
index af5a1c50f..8b9ce9e2e 100644
--- a/Source/ThirdParty/freetype/LICENSE.TXT
+++ b/Source/ThirdParty/freetype/LICENSE.TXT
@@ -1,39 +1,46 @@
+FREETYPE LICENSES
+-----------------
-The FreeType 2 font engine is copyrighted work and cannot be used
-legally without a software license. In order to make this project
-usable to a vast majority of developers, we distribute it under two
+The FreeType 2 font engine is copyrighted work and cannot be used
+legally without a software license. In order to make this project
+usable to a vast majority of developers, we distribute it under two
mutually exclusive open-source licenses.
-This means that *you* must choose *one* of the two licenses described
-below, then obey all its terms and conditions when using FreeType 2 in
+This means that *you* must choose *one* of the two licenses described
+below, then obey all its terms and conditions when using FreeType 2 in
any of your projects or products.
- - The FreeType License, found in the file `FTL.TXT', which is similar
- to the original BSD license *with* an advertising clause that forces
- you to explicitly cite the FreeType project in your product's
- documentation. All details are in the license file. This license
- is suited to products which don't use the GNU General Public
- License.
+ - The FreeType License, found in the file `docs/FTL.TXT`, which is
+ similar to the original BSD license *with* an advertising clause
+ that forces you to explicitly cite the FreeType project in your
+ product's documentation. All details are in the license file.
+ This license is suited to products which don't use the GNU General
+ Public License.
- Note that this license is compatible to the GNU General Public
+ Note that this license is compatible to the GNU General Public
License version 3, but not version 2.
- - The GNU General Public License version 2, found in `GPLv2.TXT' (any
- later version can be used also), for programs which already use the
- GPL. Note that the FTL is incompatible with GPLv2 due to its
- advertisement clause.
+ - The GNU General Public License version 2, found in
+ `docs/GPLv2.TXT` (any later version can be used also), for
+ programs which already use the GPL. Note that the FTL is
+ incompatible with GPLv2 due to its advertisement clause.
-The contributed BDF and PCF drivers come with a license similar to that
-of the X Window System. It is compatible to the above two licenses (see
-file src/bdf/README and src/pcf/README). The same holds for the files
-`fthash.c' and `fthash.h'; their code was part of the BDF driver in
-earlier FreeType versions.
+The contributed BDF and PCF drivers come with a license similar to
+that of the X Window System. It is compatible to the above two
+licenses (see files `src/bdf/README` and `src/pcf/README`). The same
+holds for the source code files `src/base/fthash.c` and
+`include/freetype/internal/fthash.h`; they were part of the BDF driver
+in earlier FreeType versions.
-The gzip module uses the zlib license (see src/gzip/zlib.h) which too is
-compatible to the above two licenses.
+The gzip module uses the zlib license (see `src/gzip/zlib.h`) which
+too is compatible to the above two licenses.
-The MD5 checksum support (only used for debugging in development builds)
-is in the public domain.
+The files `src/autofit/ft-hb.c` and `src/autofit/ft-hb.h` contain code
+taken almost verbatim from the HarfBuzz file `hb-ft.cc`, which uses
+the 'Old MIT' license, compatible to the above two licenses.
+
+The MD5 checksum support (only used for debugging in development
+builds) is in the public domain.
--- end of LICENSE.TXT ---
diff --git a/Source/ThirdParty/freetype/config/ftconfig.h b/Source/ThirdParty/freetype/config/ftconfig.h
index 946660337..a85151699 100644
--- a/Source/ThirdParty/freetype/config/ftconfig.h
+++ b/Source/ThirdParty/freetype/config/ftconfig.h
@@ -4,7 +4,7 @@
*
* ANSI-specific configuration file (specification only).
*
- * Copyright (C) 1996-2019 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -41,533 +41,9 @@
#include FT_CONFIG_OPTIONS_H
#include FT_CONFIG_STANDARD_LIBRARY_H
-
-FT_BEGIN_HEADER
-
-
- /**************************************************************************
- *
- * PLATFORM-SPECIFIC CONFIGURATION MACROS
- *
- * These macros can be toggled to suit a specific system. The current ones
- * are defaults used to compile FreeType in an ANSI C environment (16bit
- * compilers are also supported). Copy this file to your own
- * `builds/` directory, and edit it to port the engine.
- *
- */
-
-
- /* There are systems (like the Texas Instruments 'C54x) where a `char` */
- /* has 16~bits. ANSI~C says that `sizeof(char)` is always~1. Since an */
- /* `int` has 16~bits also for this system, `sizeof(int)` gives~1 which */
- /* is probably unexpected. */
- /* */
- /* `CHAR_BIT` (defined in `limits.h`) gives the number of bits in a */
- /* `char` type. */
-
-#ifndef FT_CHAR_BIT
-#define FT_CHAR_BIT CHAR_BIT
-#endif
-
-
- /* The size of an `int` type. */
-#if FT_UINT_MAX == 0xFFFFUL
-#define FT_SIZEOF_INT ( 16 / FT_CHAR_BIT )
-#elif FT_UINT_MAX == 0xFFFFFFFFUL
-#define FT_SIZEOF_INT ( 32 / FT_CHAR_BIT )
-#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL
-#define FT_SIZEOF_INT ( 64 / FT_CHAR_BIT )
-#else
-#error "Unsupported size of `int' type!"
-#endif
-
- /* The size of a `long` type. A five-byte `long` (as used e.g. on the */
- /* DM642) is recognized but avoided. */
-#if FT_ULONG_MAX == 0xFFFFFFFFUL
-#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
-#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
-#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
-#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL
-#define FT_SIZEOF_LONG ( 64 / FT_CHAR_BIT )
-#else
-#error "Unsupported size of `long' type!"
-#endif
-
-
- /* `FT_UNUSED` indicates that a given parameter is not used -- */
- /* this is only used to get rid of unpleasant compiler warnings. */
-#ifndef FT_UNUSED
-#define FT_UNUSED( arg ) ( (arg) = (arg) )
-#endif
-
-
- /**************************************************************************
- *
- * AUTOMATIC CONFIGURATION MACROS
- *
- * These macros are computed from the ones defined above. Don't touch
- * their definition, unless you know precisely what you are doing. No
- * porter should need to mess with them.
- *
- */
-
-
- /**************************************************************************
- *
- * Mac support
- *
- * This is the only necessary change, so it is defined here instead
- * providing a new configuration file.
- */
-#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
- /* No Carbon frameworks for 64bit 10.4.x. */
- /* `AvailabilityMacros.h` is available since Mac OS X 10.2, */
- /* so guess the system version by maximum errno before inclusion. */
-#include
-#ifdef ECANCELED /* defined since 10.2 */
-#include "AvailabilityMacros.h"
-#endif
-#if defined( __LP64__ ) && \
- ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
-#undef FT_MACINTOSH
-#endif
-
-#elif defined( __SC__ ) || defined( __MRC__ )
- /* Classic MacOS compilers */
-#include "ConditionalMacros.h"
-#if TARGET_OS_MAC
-#define FT_MACINTOSH 1
-#endif
-
-#endif
-
-
- /* Fix compiler warning with sgi compiler. */
-#if defined( __sgi ) && !defined( __GNUC__ )
-#if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
-#pragma set woff 3505
-#endif
-#endif
-
-
- /**************************************************************************
- *
- * @section:
- * basic_types
- *
- */
-
-
- /**************************************************************************
- *
- * @type:
- * FT_Int16
- *
- * @description:
- * A typedef for a 16bit signed integer type.
- */
- typedef signed short FT_Int16;
-
-
- /**************************************************************************
- *
- * @type:
- * FT_UInt16
- *
- * @description:
- * A typedef for a 16bit unsigned integer type.
- */
- typedef unsigned short FT_UInt16;
-
- /* */
-
-
- /* this #if 0 ... #endif clause is for documentation purposes */
-#if 0
-
- /**************************************************************************
- *
- * @type:
- * FT_Int32
- *
- * @description:
- * A typedef for a 32bit signed integer type. The size depends on the
- * configuration.
- */
- typedef signed XXX FT_Int32;
-
-
- /**************************************************************************
- *
- * @type:
- * FT_UInt32
- *
- * A typedef for a 32bit unsigned integer type. The size depends on the
- * configuration.
- */
- typedef unsigned XXX FT_UInt32;
-
-
- /**************************************************************************
- *
- * @type:
- * FT_Int64
- *
- * A typedef for a 64bit signed integer type. The size depends on the
- * configuration. Only defined if there is real 64bit support;
- * otherwise, it gets emulated with a structure (if necessary).
- */
- typedef signed XXX FT_Int64;
-
-
- /**************************************************************************
- *
- * @type:
- * FT_UInt64
- *
- * A typedef for a 64bit unsigned integer type. The size depends on the
- * configuration. Only defined if there is real 64bit support;
- * otherwise, it gets emulated with a structure (if necessary).
- */
- typedef unsigned XXX FT_UInt64;
-
- /* */
-
-#endif
-
-#if FT_SIZEOF_INT == ( 32 / FT_CHAR_BIT )
-
- typedef signed int FT_Int32;
- typedef unsigned int FT_UInt32;
-
-#elif FT_SIZEOF_LONG == ( 32 / FT_CHAR_BIT )
-
- typedef signed long FT_Int32;
- typedef unsigned long FT_UInt32;
-
-#else
-#error "no 32bit type found -- please check your configuration files"
-#endif
-
-
- /* look up an integer type that is at least 32~bits */
-#if FT_SIZEOF_INT >= ( 32 / FT_CHAR_BIT )
-
- typedef int FT_Fast;
- typedef unsigned int FT_UFast;
-
-#elif FT_SIZEOF_LONG >= ( 32 / FT_CHAR_BIT )
-
- typedef long FT_Fast;
- typedef unsigned long FT_UFast;
-
-#endif
-
-
- /* determine whether we have a 64-bit `int` type for platforms without */
- /* Autoconf */
-#if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT )
-
- /* `FT_LONG64` must be defined if a 64-bit type is available */
-#define FT_LONG64
-#define FT_INT64 long
-#define FT_UINT64 unsigned long
-
- /**************************************************************************
- *
- * A 64-bit data type may create compilation problems if you compile in
- * strict ANSI mode. To avoid them, we disable other 64-bit data types if
- * `__STDC__` is defined. You can however ignore this rule by defining the
- * `FT_CONFIG_OPTION_FORCE_INT64` configuration macro.
- */
-#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
-
-#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
-
-#define FT_LONG64
-#define FT_INT64 long long int
-#define FT_UINT64 unsigned long long int
-
-#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
-
- /* this compiler provides the `__int64` type */
-#define FT_LONG64
-#define FT_INT64 __int64
-#define FT_UINT64 unsigned __int64
-
-#elif defined( __BORLANDC__ ) /* Borland C++ */
-
- /* XXXX: We should probably check the value of `__BORLANDC__` in order */
- /* to test the compiler version. */
-
- /* this compiler provides the `__int64` type */
-#define FT_LONG64
-#define FT_INT64 __int64
-#define FT_UINT64 unsigned __int64
-
-#elif defined( __WATCOMC__ ) /* Watcom C++ */
-
- /* Watcom doesn't provide 64-bit data types */
-
-#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
-
-#define FT_LONG64
-#define FT_INT64 long long int
-#define FT_UINT64 unsigned long long int
-
-#elif defined( __GNUC__ )
-
- /* GCC provides the `long long` type */
-#define FT_LONG64
-#define FT_INT64 long long int
-#define FT_UINT64 unsigned long long int
-
-#endif /* __STDC_VERSION__ >= 199901L */
-
-#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
-
-#ifdef FT_LONG64
- typedef FT_INT64 FT_Int64;
- typedef FT_UINT64 FT_UInt64;
-#endif
-
-
-#ifdef _WIN64
- /* only 64bit Windows uses the LLP64 data model, i.e., */
- /* 32bit integers, 64bit pointers */
-#define FT_UINT_TO_POINTER( x ) (void*)(unsigned __int64)(x)
-#else
-#define FT_UINT_TO_POINTER( x ) (void*)(unsigned long)(x)
-#endif
-
-
- /**************************************************************************
- *
- * miscellaneous
- *
- */
-
-
-#define FT_BEGIN_STMNT do {
-#define FT_END_STMNT } while ( 0 )
-#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
-
-
- /* `typeof` condition taken from gnulib's `intprops.h` header file */
-#if ( ( defined( __GNUC__ ) && __GNUC__ >= 2 ) || \
- ( defined( __IBMC__ ) && __IBMC__ >= 1210 && \
- defined( __IBM__TYPEOF__ ) ) || \
- ( defined( __SUNPRO_C ) && __SUNPRO_C >= 0x5110 && !__STDC__ ) )
-#define FT_TYPEOF( type ) ( __typeof__ ( type ) )
-#else
-#define FT_TYPEOF( type ) /* empty */
-#endif
-
-
- /* Use `FT_LOCAL` and `FT_LOCAL_DEF` to declare and define, */
- /* respectively, a function that gets used only within the scope of a */
- /* module. Normally, both the header and source code files for such a */
- /* function are within a single module directory. */
- /* */
- /* Intra-module arrays should be tagged with `FT_LOCAL_ARRAY` and */
- /* `FT_LOCAL_ARRAY_DEF`. */
- /* */
-#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
-
-#define FT_LOCAL( x ) static x
-#define FT_LOCAL_DEF( x ) static x
-
-#else
-
-#ifdef __cplusplus
-#define FT_LOCAL( x ) extern "C" x
-#define FT_LOCAL_DEF( x ) extern "C" x
-#else
-#define FT_LOCAL( x ) extern x
-#define FT_LOCAL_DEF( x ) x
-#endif
-
-#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
-
-#define FT_LOCAL_ARRAY( x ) extern const x
-#define FT_LOCAL_ARRAY_DEF( x ) const x
-
-
- /* Use `FT_BASE` and `FT_BASE_DEF` to declare and define, respectively, */
- /* functions that are used in more than a single module. In the */
- /* current setup this implies that the declaration is in a header file */
- /* in the `include/freetype/internal` directory, and the function body */
- /* is in a file in `src/base`. */
- /* */
-#ifndef FT_BASE
-
-#ifdef __cplusplus
-#define FT_BASE( x ) extern "C" x
-#else
-#define FT_BASE( x ) extern x
-#endif
-
-#endif /* !FT_BASE */
-
-
-#ifndef FT_BASE_DEF
-
-#ifdef __cplusplus
-#define FT_BASE_DEF( x ) x
-#else
-#define FT_BASE_DEF( x ) x
-#endif
-
-#endif /* !FT_BASE_DEF */
-
-
- /* When compiling FreeType as a DLL or DSO with hidden visibility */
- /* some systems/compilers need a special attribute in front OR after */
- /* the return type of function declarations. */
- /* */
- /* Two macros are used within the FreeType source code to define */
- /* exported library functions: `FT_EXPORT` and `FT_EXPORT_DEF`. */
- /* */
- /* - `FT_EXPORT( return_type )` */
- /* */
- /* is used in a function declaration, as in */
- /* */
- /* ``` */
- /* FT_EXPORT( FT_Error ) */
- /* FT_Init_FreeType( FT_Library* alibrary ); */
- /* ``` */
- /* */
- /* - `FT_EXPORT_DEF( return_type )` */
- /* */
- /* is used in a function definition, as in */
- /* */
- /* ``` */
- /* FT_EXPORT_DEF( FT_Error ) */
- /* FT_Init_FreeType( FT_Library* alibrary ) */
- /* { */
- /* ... some code ... */
- /* return FT_Err_Ok; */
- /* } */
- /* ``` */
- /* */
- /* You can provide your own implementation of `FT_EXPORT` and */
- /* `FT_EXPORT_DEF` here if you want. */
- /* */
- /* To export a variable, use `FT_EXPORT_VAR`. */
- /* */
-#ifndef FT_EXPORT
-
-#ifdef FT2_BUILD_LIBRARY
-
-#if defined( _WIN32 ) && defined( DLL_EXPORT )
-#define FT_EXPORT( x ) __declspec( dllexport ) x
-#elif defined( __GNUC__ ) && __GNUC__ >= 4
-#define FT_EXPORT( x ) __attribute__(( visibility( "default" ) )) x
-#elif defined( __SUNPRO_C ) && __SUNPRO_C >= 0x550
-#define FT_EXPORT( x ) __global x
-#elif defined( __cplusplus )
-#define FT_EXPORT( x ) extern "C" x
-#else
-#define FT_EXPORT( x ) extern x
-#endif
-
-#else
-
-#if defined( _WIN32 ) && defined( DLL_IMPORT )
-#define FT_EXPORT( x ) __declspec( dllimport ) x
-#elif defined( __cplusplus )
-#define FT_EXPORT( x ) extern "C" x
-#else
-#define FT_EXPORT( x ) extern x
-#endif
-
-#endif
-
-#endif /* !FT_EXPORT */
-
-
-#ifndef FT_EXPORT_DEF
-
-#ifdef __cplusplus
-#define FT_EXPORT_DEF( x ) extern "C" x
-#else
-#define FT_EXPORT_DEF( x ) extern x
-#endif
-
-#endif /* !FT_EXPORT_DEF */
-
-
-#ifndef FT_EXPORT_VAR
-
-#ifdef __cplusplus
-#define FT_EXPORT_VAR( x ) extern "C" x
-#else
-#define FT_EXPORT_VAR( x ) extern x
-#endif
-
-#endif /* !FT_EXPORT_VAR */
-
-
- /* The following macros are needed to compile the library with a */
- /* C++ compiler and with 16bit compilers. */
- /* */
-
- /* This is special. Within C++, you must specify `extern "C"` for */
- /* functions which are used via function pointers, and you also */
- /* must do that for structures which contain function pointers to */
- /* assure C linkage -- it's not possible to have (local) anonymous */
- /* functions which are accessed by (global) function pointers. */
- /* */
- /* */
- /* FT_CALLBACK_DEF is used to _define_ a callback function, */
- /* located in the same source code file as the structure that uses */
- /* it. */
- /* */
- /* FT_BASE_CALLBACK and FT_BASE_CALLBACK_DEF are used to declare */
- /* and define a callback function, respectively, in a similar way */
- /* as FT_BASE and FT_BASE_DEF work. */
- /* */
- /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
- /* contains pointers to callback functions. */
- /* */
- /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
- /* that contains pointers to callback functions. */
- /* */
- /* */
- /* Some 16bit compilers have to redefine these macros to insert */
- /* the infamous `_cdecl` or `__fastcall` declarations. */
- /* */
-#ifndef FT_CALLBACK_DEF
-#ifdef __cplusplus
-#define FT_CALLBACK_DEF( x ) extern "C" x
-#else
-#define FT_CALLBACK_DEF( x ) static x
-#endif
-#endif /* FT_CALLBACK_DEF */
-
-#ifndef FT_BASE_CALLBACK
-#ifdef __cplusplus
-#define FT_BASE_CALLBACK( x ) extern "C" x
-#define FT_BASE_CALLBACK_DEF( x ) extern "C" x
-#else
-#define FT_BASE_CALLBACK( x ) extern x
-#define FT_BASE_CALLBACK_DEF( x ) x
-#endif
-#endif /* FT_BASE_CALLBACK */
-
-#ifndef FT_CALLBACK_TABLE
-#ifdef __cplusplus
-#define FT_CALLBACK_TABLE extern "C"
-#define FT_CALLBACK_TABLE_DEF extern "C"
-#else
-#define FT_CALLBACK_TABLE extern
-#define FT_CALLBACK_TABLE_DEF /* nothing */
-#endif
-#endif /* FT_CALLBACK_TABLE */
-
-
-FT_END_HEADER
-
+#include
+#include
+#include
#endif /* FTCONFIG_H_ */
diff --git a/Source/ThirdParty/freetype/config/ftheader.h b/Source/ThirdParty/freetype/config/ftheader.h
index 696d6ba90..e607bce15 100644
--- a/Source/ThirdParty/freetype/config/ftheader.h
+++ b/Source/ThirdParty/freetype/config/ftheader.h
@@ -4,7 +4,7 @@
*
* Build macros of the FreeType 2 library.
*
- * Copyright (C) 1996-2019 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -30,10 +30,12 @@
/* encapsulated in an `extern "C" { .. }` block when included from a */
/* C++ compiler. */
/* */
-#ifdef __cplusplus
-#define FT_BEGIN_HEADER extern "C" {
-#else
-#define FT_BEGIN_HEADER /* nothing */
+#ifndef FT_BEGIN_HEADER
+# ifdef __cplusplus
+# define FT_BEGIN_HEADER extern "C" {
+# else
+# define FT_BEGIN_HEADER /* nothing */
+# endif
#endif
@@ -48,10 +50,12 @@
/* encapsulated in an `extern "C" { .. }` block when included from a */
/* C++ compiler. */
/* */
-#ifdef __cplusplus
-#define FT_END_HEADER }
-#else
-#define FT_END_HEADER /* nothing */
+#ifndef FT_END_HEADER
+# ifdef __cplusplus
+# define FT_END_HEADER }
+# else
+# define FT_END_HEADER /* nothing */
+# endif
#endif
@@ -73,9 +77,16 @@
* Macro definitions used to `#include` specific header files.
*
* @description:
- * The following macros are defined to the name of specific FreeType~2
- * header files. They can be used directly in `#include` statements as
- * in:
+ * In addition to the normal scheme of including header files like
+ *
+ * ```
+ * #include
+ * #include
+ * #include
+ * ```
+ *
+ * it is possible to used named macros instead. They can be used
+ * directly in `#include` statements as in
*
* ```
* #include FT_FREETYPE_H
@@ -83,13 +94,9 @@
* #include FT_GLYPH_H
* ```
*
- * There are several reasons why we are now using macros to name public
- * header files. The first one is that such macros are not limited to
- * the infamous 8.3~naming rule required by DOS (and
- * `FT_MULTIPLE_MASTERS_H` is a lot more meaningful than `ftmm.h`).
- *
- * The second reason is that it allows for more flexibility in the way
- * FreeType~2 is installed on a given system.
+ * These macros were introduced to overcome the infamous 8.3~naming rule
+ * required by DOS (and `FT_MULTIPLE_MASTERS_H` is a lot more meaningful
+ * than `ftmm.h`).
*
*/
@@ -770,6 +777,18 @@
#define FT_COLOR_H
+ /**************************************************************************
+ *
+ * @macro:
+ * FT_OTSVG_H
+ *
+ * @description:
+ * A macro used in `#include` statements to name the file containing the
+ * FreeType~2 API which handles the OpenType 'SVG~' glyphs.
+ */
+#define FT_OTSVG_H
+
+
/* */
/* These header files don't need to be included by the user. */
@@ -797,16 +816,19 @@
#define FT_CACHE_INTERNAL_IMAGE_H FT_CACHE_H
#define FT_CACHE_INTERNAL_SBITS_H FT_CACHE_H
-
- /*
- * Include internal headers definitions from `` only when
- * building the library.
- */
+/* TODO(david): Move this section below to a different header */
#ifdef FT2_BUILD_LIBRARY
-#define FT_INTERNAL_INTERNAL_H
-#include FT_INTERNAL_INTERNAL_H
-#endif /* FT2_BUILD_LIBRARY */
+#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
+ /* We disable the warning `conditional expression is constant' here */
+ /* in order to compile cleanly with the maximum level of warnings. */
+ /* In particular, the warning complains about stuff like `while(0)' */
+ /* which is very useful in macro definitions. There is no benefit */
+ /* in having it enabled. */
+#pragma warning( disable : 4127 )
+
+#endif /* _MSC_VER */
+#endif /* FT2_BUILD_LIBRARY */
#endif /* FTHEADER_H_ */
diff --git a/Source/ThirdParty/freetype/config/ftmodule.h b/Source/ThirdParty/freetype/config/ftmodule.h
index 7c603e532..b315baba8 100644
--- a/Source/ThirdParty/freetype/config/ftmodule.h
+++ b/Source/ThirdParty/freetype/config/ftmodule.h
@@ -19,14 +19,15 @@ FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )
+FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
FT_USE_MODULE( FT_Module_Class, psaux_module_class )
FT_USE_MODULE( FT_Module_Class, psnames_module_class )
FT_USE_MODULE( FT_Module_Class, pshinter_module_class )
-FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
-FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )
-FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )
-FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
+FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
+FT_USE_MODULE( FT_Renderer_Class, ft_sdf_renderer_class )
+FT_USE_MODULE( FT_Renderer_Class, ft_bitmap_sdf_renderer_class )
+FT_USE_MODULE( FT_Renderer_Class, ft_svg_renderer_class )
/* EOF */
diff --git a/Source/ThirdParty/freetype/config/ftoption.h b/Source/ThirdParty/freetype/config/ftoption.h
index 12f47a82e..1976b33af 100644
--- a/Source/ThirdParty/freetype/config/ftoption.h
+++ b/Source/ThirdParty/freetype/config/ftoption.h
@@ -4,7 +4,7 @@
*
* User-selectable configuration macros (specification only).
*
- * Copyright (C) 1996-2019 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -42,7 +42,7 @@ FT_BEGIN_HEADER
* the name of a directory that is included _before_ the FreeType include
* path during compilation.
*
- * The default FreeType Makefiles and Jamfiles use the build directory
+ * The default FreeType Makefiles use the build directory
* `builds/` by default, but you can easily change that for your
* own projects.
*
@@ -105,8 +105,7 @@ FT_BEGIN_HEADER
*
* ```
* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
- * cff:no-stem-darkening=1 \
- * autofitter:warping=1
+ * cff:no-stem-darkening=1
* ```
*
*/
@@ -121,10 +120,8 @@ FT_BEGIN_HEADER
* mitigate color fringes inherent to this technology, you also need to
* explicitly set up LCD filtering.
*
- * Note that this feature is covered by several Microsoft patents and
- * should not be activated in any default build of the library. When this
- * macro is not defined, FreeType offers alternative LCD rendering
- * technology that produces excellent output without LCD filtering.
+ * When this macro is not defined, FreeType offers alternative LCD
+ * rendering technology that produces excellent output.
*/
/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
@@ -222,6 +219,10 @@ FT_BEGIN_HEADER
* If you use a build system like cmake or the `configure` script,
* options set by those programs have precedence, overwriting the value
* here with the configured one.
+ *
+ * If you use the GNU make build system directly (that is, without the
+ * `configure` script) and you define this macro, you also have to pass
+ * `SYSTEM_ZLIB=yes` as an argument to make.
*/
/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
@@ -292,6 +293,22 @@ FT_BEGIN_HEADER
/* #define FT_CONFIG_OPTION_USE_HARFBUZZ */
+ /**************************************************************************
+ *
+ * Brotli support.
+ *
+ * FreeType uses the Brotli library to provide support for decompressing
+ * WOFF2 streams.
+ *
+ * Define this macro if you want to enable this 'feature'.
+ *
+ * If you use a build system like cmake or the `configure` script,
+ * options set by those programs have precedence, overwriting the value
+ * here with the configured one.
+ */
+/* #define FT_CONFIG_OPTION_USE_BROTLI */
+
+
/**************************************************************************
*
* Glyph Postscript Names handling
@@ -417,6 +434,23 @@ FT_BEGIN_HEADER
/* #define FT_DEBUG_LEVEL_TRACE */
+ /**************************************************************************
+ *
+ * Logging
+ *
+ * Compiling FreeType in debug or trace mode makes FreeType write error
+ * and trace log messages to `stderr`. Enabling this macro
+ * automatically forces the `FT_DEBUG_LEVEL_ERROR` and
+ * `FT_DEBUG_LEVEL_TRACE` macros and allows FreeType to write error and
+ * trace log messages to a file instead of `stderr`. For writing logs
+ * to a file, FreeType uses an the external `dlg` library (the source
+ * code is in `src/dlg`).
+ *
+ * This option needs a C99 compiler.
+ */
+/* #define FT_DEBUG_LOGGING */
+
+
/**************************************************************************
*
* Autofitter debugging
@@ -427,9 +461,9 @@ FT_BEGIN_HEADER
* while compiling in 'release' mode):
*
* ```
- * _af_debug_disable_horz_hints
- * _af_debug_disable_vert_hints
- * _af_debug_disable_blue_hints
+ * af_debug_disable_horz_hints_
+ * af_debug_disable_vert_hints_
+ * af_debug_disable_blue_hints_
* ```
*
* Additionally, the following functions provide dumps of various
@@ -446,7 +480,7 @@ FT_BEGIN_HEADER
* As an argument, they use another global variable:
*
* ```
- * _af_debug_hints
+ * af_debug_hints_
* ```
*
* Please have a look at the `ftgrid` demo program to see how those
@@ -493,6 +527,20 @@ FT_BEGIN_HEADER
#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
+ /**************************************************************************
+ *
+ * OpenType SVG Glyph Support
+ *
+ * Setting this macro enables support for OpenType SVG glyphs. By
+ * default, FreeType can only fetch SVG documents. However, it can also
+ * render them if external rendering hook functions are plugged in at
+ * runtime.
+ *
+ * More details on the hooks can be found in file `otsvg.h`.
+ */
+#define FT_CONFIG_OPTION_SVG
+
+
/**************************************************************************
*
* Error Strings
@@ -526,7 +574,7 @@ FT_BEGIN_HEADER
/**************************************************************************
*
- * Define `TT_CONFIG_OPTION_COLOR_LAYERS` if you want to support coloured
+ * Define `TT_CONFIG_OPTION_COLOR_LAYERS` if you want to support colored
* outlines (from the 'COLR'/'CPAL' tables) in all formats using the 'sfnt'
* module (namely TrueType~& OpenType).
*/
@@ -536,12 +584,12 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* Define `TT_CONFIG_OPTION_POSTSCRIPT_NAMES` if you want to be able to
- * load and enumerate the glyph Postscript names in a TrueType or OpenType
+ * load and enumerate Postscript names of glyphs in a TrueType or OpenType
* file.
*
- * Note that when you do not compile the 'psnames' module by undefining the
- * above `FT_CONFIG_OPTION_POSTSCRIPT_NAMES`, the 'sfnt' module will
- * contain additional code used to read the PS Names table from a font.
+ * Note that if you do not compile the 'psnames' module by undefining the
+ * above `FT_CONFIG_OPTION_POSTSCRIPT_NAMES` macro, the 'sfnt' module will
+ * contain additional code to read the PostScript name table from a font.
*
* (By default, the module uses 'psnames' to extract glyph names.)
*/
@@ -613,36 +661,12 @@ FT_BEGIN_HEADER
* not) instructions in a certain way so that all TrueType fonts look like
* they do in a Windows ClearType (DirectWrite) environment. See [1] for a
* technical overview on what this means. See `ttinterp.h` for more
- * details on the LEAN option.
+ * details on this option.
*
- * There are three possible values.
- *
- * Value 1:
- * This value is associated with the 'Infinality' moniker, contributed by
- * an individual nicknamed Infinality with the goal of making TrueType
- * fonts render better than on Windows. A high amount of configurability
- * and flexibility, down to rules for single glyphs in fonts, but also
- * very slow. Its experimental and slow nature and the original
- * developer losing interest meant that this option was never enabled in
- * default builds.
- *
- * The corresponding interpreter version is v38.
- *
- * Value 2:
- * The new default mode for the TrueType driver. The Infinality code
- * base was stripped to the bare minimum and all configurability removed
- * in the name of speed and simplicity. The configurability was mainly
- * aimed at legacy fonts like 'Arial', 'Times New Roman', or 'Courier'.
- * Legacy fonts are fonts that modify vertical stems to achieve clean
- * black-and-white bitmaps. The new mode focuses on applying a minimal
- * set of rules to all fonts indiscriminately so that modern and web
- * fonts render well while legacy fonts render okay.
- *
- * The corresponding interpreter version is v40.
- *
- * Value 3:
- * Compile both, making both v38 and v40 available (the latter is the
- * default).
+ * The new default mode focuses on applying a minimal set of rules to all
+ * fonts indiscriminately so that modern and web fonts render well while
+ * legacy fonts render okay. The corresponding interpreter version is v40.
+ * The so-called Infinality mode (v38) is no longer available in FreeType.
*
* By undefining these, you get rendering behavior like on Windows without
* ClearType, i.e., Windows XP without ClearType enabled and Win9x
@@ -657,9 +681,7 @@ FT_BEGIN_HEADER
* [1]
* https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
*/
-/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
-#define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2
-/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */
+#define TT_CONFIG_OPTION_SUBPIXEL_HINTING
/**************************************************************************
@@ -691,6 +713,24 @@ FT_BEGIN_HEADER
#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ /**************************************************************************
+ *
+ * Define `TT_CONFIG_OPTION_NO_BORING_EXPANSION` if you want to exclude
+ * support for 'boring' OpenType specification expansions.
+ *
+ * https://github.com/harfbuzz/boring-expansion-spec
+ *
+ * Right now, the following features are covered:
+ *
+ * - 'avar' version 2.0
+ *
+ * Most likely, this is a temporary configuration option to be removed in
+ * the near future, since it is assumed that eventually those features are
+ * added to the OpenType standard.
+ */
+/* #define TT_CONFIG_OPTION_NO_BORING_EXPANSION */
+
+
/**************************************************************************
*
* Define `TT_CONFIG_OPTION_BDF` if you want to include support for an
@@ -871,27 +911,11 @@ FT_BEGIN_HEADER
*
* Compile 'autofit' module with fallback Indic script support, covering
* some scripts that the 'latin' submodule of the 'autofit' module doesn't
- * (yet) handle.
+ * (yet) handle. Currently, this needs option `AF_CONFIG_OPTION_CJK`.
*/
+#ifdef AF_CONFIG_OPTION_CJK
#define AF_CONFIG_OPTION_INDIC
-
-
- /**************************************************************************
- *
- * Compile 'autofit' module with warp hinting. The idea of the warping
- * code is to slightly scale and shift a glyph within a single dimension so
- * that as much of its segments are aligned (more or less) on the grid. To
- * find out the optimal scaling and shifting value, various parameter
- * combinations are tried and scored.
- *
- * You can switch warping on and off with the `warping` property of the
- * auto-hinter (see file `ftdriver.h` for more information; by default it
- * is switched off).
- *
- * This experimental option is not active if the rendering mode is
- * `FT_RENDER_MODE_LIGHT`.
- */
-#define AF_CONFIG_OPTION_USE_WARPER
+#endif
/**************************************************************************
@@ -927,21 +951,29 @@ FT_BEGIN_HEADER
/*
- * The next three macros are defined if native TrueType hinting is
+ * The next two macros are defined if native TrueType hinting is
* requested by the definitions above. Don't change this.
*/
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#define TT_USE_BYTECODE_INTERPRETER
-
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
-#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1
-#define TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
-#endif
-
-#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2
#define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
#endif
#endif
+
+
+ /*
+ * The TT_SUPPORT_COLRV1 macro is defined to indicate to clients that this
+ * version of FreeType has support for 'COLR' v1 API. This definition is
+ * useful to FreeType clients that want to build in support for 'COLR' v1
+ * depending on a tip-of-tree checkout before it is officially released in
+ * FreeType, and while the feature cannot yet be tested against using
+ * version macros. Don't change this macro. This may be removed once the
+ * feature is in a FreeType release version and version macros can be used
+ * to test for availability.
+ */
+#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
+#define TT_SUPPORT_COLRV1
#endif
@@ -973,8 +1005,8 @@ FT_BEGIN_HEADER
#error "Invalid CFF darkening parameters!"
#endif
-FT_END_HEADER
+FT_END_HEADER
#endif /* FTOPTION_H_ */
diff --git a/Source/ThirdParty/freetype/config/ftstdlib.h b/Source/ThirdParty/freetype/config/ftstdlib.h
index 438b6145d..f65148a90 100644
--- a/Source/ThirdParty/freetype/config/ftstdlib.h
+++ b/Source/ThirdParty/freetype/config/ftstdlib.h
@@ -5,7 +5,7 @@
* ANSI-specific library and header configuration file (specification
* only).
*
- * Copyright (C) 2002-2019 by
+ * Copyright (C) 2002-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -43,7 +43,8 @@
*
* `UINT_MAX` and `ULONG_MAX` are used to automatically compute the size of
* `int` and `long` in bytes at compile-time. So far, this works for all
- * platforms the library has been tested on.
+ * platforms the library has been tested on. We also check `ULLONG_MAX`
+ * to see whether we can use 64-bit `long long` later on.
*
* Note that on the extremely rare platforms that do not provide integer
* types that are _exactly_ 16 and 32~bits wide (e.g., some old Crays where
@@ -66,6 +67,15 @@
#define FT_LONG_MIN LONG_MIN
#define FT_LONG_MAX LONG_MAX
#define FT_ULONG_MAX ULONG_MAX
+#ifdef LLONG_MAX
+#define FT_LLONG_MAX LLONG_MAX
+#endif
+#ifdef LLONG_MIN
+#define FT_LLONG_MIN LLONG_MIN
+#endif
+#ifdef ULLONG_MAX
+#define FT_ULLONG_MAX ULLONG_MAX
+#endif
/**************************************************************************
@@ -101,13 +111,13 @@
#include
-#define FT_FILE FILE
-#define ft_fclose fclose
-#define ft_fopen fopen
-#define ft_fread fread
-#define ft_fseek fseek
-#define ft_ftell ftell
-#define ft_sprintf sprintf
+#define FT_FILE FILE
+#define ft_fclose fclose
+#define ft_fopen fopen
+#define ft_fread fread
+#define ft_fseek fseek
+#define ft_ftell ftell
+#define ft_snprintf snprintf
/**************************************************************************
diff --git a/Source/ThirdParty/freetype/config/integer-types.h b/Source/ThirdParty/freetype/config/integer-types.h
new file mode 100644
index 000000000..7258b5085
--- /dev/null
+++ b/Source/ThirdParty/freetype/config/integer-types.h
@@ -0,0 +1,250 @@
+/****************************************************************************
+ *
+ * config/integer-types.h
+ *
+ * FreeType integer types definitions.
+ *
+ * Copyright (C) 1996-2023 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+#ifndef FREETYPE_CONFIG_INTEGER_TYPES_H_
+#define FREETYPE_CONFIG_INTEGER_TYPES_H_
+
+ /* There are systems (like the Texas Instruments 'C54x) where a `char` */
+ /* has 16~bits. ANSI~C says that `sizeof(char)` is always~1. Since an */
+ /* `int` has 16~bits also for this system, `sizeof(int)` gives~1 which */
+ /* is probably unexpected. */
+ /* */
+ /* `CHAR_BIT` (defined in `limits.h`) gives the number of bits in a */
+ /* `char` type. */
+
+#ifndef FT_CHAR_BIT
+#define FT_CHAR_BIT CHAR_BIT
+#endif
+
+#ifndef FT_SIZEOF_INT
+
+ /* The size of an `int` type. */
+#if FT_UINT_MAX == 0xFFFFUL
+#define FT_SIZEOF_INT ( 16 / FT_CHAR_BIT )
+#elif FT_UINT_MAX == 0xFFFFFFFFUL
+#define FT_SIZEOF_INT ( 32 / FT_CHAR_BIT )
+#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL
+#define FT_SIZEOF_INT ( 64 / FT_CHAR_BIT )
+#else
+#error "Unsupported size of `int' type!"
+#endif
+
+#endif /* !defined(FT_SIZEOF_INT) */
+
+#ifndef FT_SIZEOF_LONG
+
+ /* The size of a `long` type. A five-byte `long` (as used e.g. on the */
+ /* DM642) is recognized but avoided. */
+#if FT_ULONG_MAX == 0xFFFFFFFFUL
+#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
+#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
+#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
+#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL
+#define FT_SIZEOF_LONG ( 64 / FT_CHAR_BIT )
+#else
+#error "Unsupported size of `long' type!"
+#endif
+
+#endif /* !defined(FT_SIZEOF_LONG) */
+
+#ifndef FT_SIZEOF_LONG_LONG
+
+ /* The size of a `long long` type if available */
+#if defined( FT_ULLONG_MAX ) && FT_ULLONG_MAX >= 0xFFFFFFFFFFFFFFFFULL
+#define FT_SIZEOF_LONG_LONG ( 64 / FT_CHAR_BIT )
+#else
+#define FT_SIZEOF_LONG_LONG 0
+#endif
+
+#endif /* !defined(FT_SIZEOF_LONG_LONG) */
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * basic_types
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_Int16
+ *
+ * @description:
+ * A typedef for a 16bit signed integer type.
+ */
+ typedef signed short FT_Int16;
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_UInt16
+ *
+ * @description:
+ * A typedef for a 16bit unsigned integer type.
+ */
+ typedef unsigned short FT_UInt16;
+
+ /* */
+
+
+ /* this #if 0 ... #endif clause is for documentation purposes */
+#if 0
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_Int32
+ *
+ * @description:
+ * A typedef for a 32bit signed integer type. The size depends on the
+ * configuration.
+ */
+ typedef signed XXX FT_Int32;
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_UInt32
+ *
+ * A typedef for a 32bit unsigned integer type. The size depends on the
+ * configuration.
+ */
+ typedef unsigned XXX FT_UInt32;
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_Int64
+ *
+ * A typedef for a 64bit signed integer type. The size depends on the
+ * configuration. Only defined if there is real 64bit support;
+ * otherwise, it gets emulated with a structure (if necessary).
+ */
+ typedef signed XXX FT_Int64;
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_UInt64
+ *
+ * A typedef for a 64bit unsigned integer type. The size depends on the
+ * configuration. Only defined if there is real 64bit support;
+ * otherwise, it gets emulated with a structure (if necessary).
+ */
+ typedef unsigned XXX FT_UInt64;
+
+ /* */
+
+#endif
+
+#if FT_SIZEOF_INT == ( 32 / FT_CHAR_BIT )
+
+ typedef signed int FT_Int32;
+ typedef unsigned int FT_UInt32;
+
+#elif FT_SIZEOF_LONG == ( 32 / FT_CHAR_BIT )
+
+ typedef signed long FT_Int32;
+ typedef unsigned long FT_UInt32;
+
+#else
+#error "no 32bit type found -- please check your configuration files"
+#endif
+
+
+ /* look up an integer type that is at least 32~bits */
+#if FT_SIZEOF_INT >= ( 32 / FT_CHAR_BIT )
+
+ typedef int FT_Fast;
+ typedef unsigned int FT_UFast;
+
+#elif FT_SIZEOF_LONG >= ( 32 / FT_CHAR_BIT )
+
+ typedef long FT_Fast;
+ typedef unsigned long FT_UFast;
+
+#endif
+
+
+ /* determine whether we have a 64-bit integer type */
+#if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT )
+
+#define FT_INT64 long
+#define FT_UINT64 unsigned long
+
+#elif FT_SIZEOF_LONG_LONG >= ( 64 / FT_CHAR_BIT )
+
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
+
+ /**************************************************************************
+ *
+ * A 64-bit data type may create compilation problems if you compile in
+ * strict ANSI mode. To avoid them, we disable other 64-bit data types if
+ * `__STDC__` is defined. You can however ignore this rule by defining the
+ * `FT_CONFIG_OPTION_FORCE_INT64` configuration macro.
+ */
+#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
+
+#if defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
+
+ /* this compiler provides the `__int64` type */
+#define FT_INT64 __int64
+#define FT_UINT64 unsigned __int64
+
+#elif defined( __BORLANDC__ ) /* Borland C++ */
+
+ /* XXXX: We should probably check the value of `__BORLANDC__` in order */
+ /* to test the compiler version. */
+
+ /* this compiler provides the `__int64` type */
+#define FT_INT64 __int64
+#define FT_UINT64 unsigned __int64
+
+#elif defined( __WATCOMC__ ) && __WATCOMC__ >= 1100 /* Watcom C++ */
+
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
+
+#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
+
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
+
+#elif defined( __GNUC__ )
+
+ /* GCC provides the `long long` type */
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
+
+#endif /* !__STDC__ */
+
+#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
+
+#ifdef FT_INT64
+ typedef FT_INT64 FT_Int64;
+ typedef FT_UINT64 FT_UInt64;
+#endif
+
+
+#endif /* FREETYPE_CONFIG_INTEGER_TYPES_H_ */
diff --git a/Source/ThirdParty/freetype/config/mac-support.h b/Source/ThirdParty/freetype/config/mac-support.h
new file mode 100644
index 000000000..b77b96d5d
--- /dev/null
+++ b/Source/ThirdParty/freetype/config/mac-support.h
@@ -0,0 +1,49 @@
+/****************************************************************************
+ *
+ * config/mac-support.h
+ *
+ * Mac/OS X support configuration header.
+ *
+ * Copyright (C) 1996-2023 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+#ifndef FREETYPE_CONFIG_MAC_SUPPORT_H_
+#define FREETYPE_CONFIG_MAC_SUPPORT_H_
+
+ /**************************************************************************
+ *
+ * Mac support
+ *
+ * This is the only necessary change, so it is defined here instead
+ * providing a new configuration file.
+ */
+#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
+ /* No Carbon frameworks for 64bit 10.4.x. */
+ /* `AvailabilityMacros.h` is available since Mac OS X 10.2, */
+ /* so guess the system version by maximum errno before inclusion. */
+#include
+#ifdef ECANCELED /* defined since 10.2 */
+#include "AvailabilityMacros.h"
+#endif
+#if defined( __LP64__ ) && \
+ ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
+#undef FT_MACINTOSH
+#endif
+
+#elif defined( __SC__ ) || defined( __MRC__ )
+ /* Classic MacOS compilers */
+#include "ConditionalMacros.h"
+#if TARGET_OS_MAC
+#define FT_MACINTOSH 1
+#endif
+
+#endif /* Mac support */
+
+#endif /* FREETYPE_CONFIG_MAC_SUPPORT_H_ */
diff --git a/Source/ThirdParty/freetype/config/public-macros.h b/Source/ThirdParty/freetype/config/public-macros.h
new file mode 100644
index 000000000..23d0fa6a3
--- /dev/null
+++ b/Source/ThirdParty/freetype/config/public-macros.h
@@ -0,0 +1,138 @@
+/****************************************************************************
+ *
+ * config/public-macros.h
+ *
+ * Define a set of compiler macros used in public FreeType headers.
+ *
+ * Copyright (C) 2020-2023 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+ /*
+ * The definitions in this file are used by the public FreeType headers
+ * and thus should be considered part of the public API.
+ *
+ * Other compiler-specific macro definitions that are not exposed by the
+ * FreeType API should go into
+ * `include/freetype/internal/compiler-macros.h` instead.
+ */
+#ifndef FREETYPE_CONFIG_PUBLIC_MACROS_H_
+#define FREETYPE_CONFIG_PUBLIC_MACROS_H_
+
+ /*
+ * `FT_BEGIN_HEADER` and `FT_END_HEADER` might have already been defined
+ * by `freetype/config/ftheader.h`, but we don't want to include this
+ * header here, so redefine the macros here only when needed. Their
+ * definition is very stable, so keeping them in sync with the ones in the
+ * header should not be a maintenance issue.
+ */
+#ifndef FT_BEGIN_HEADER
+#ifdef __cplusplus
+#define FT_BEGIN_HEADER extern "C" {
+#else
+#define FT_BEGIN_HEADER /* empty */
+#endif
+#endif /* FT_BEGIN_HEADER */
+
+#ifndef FT_END_HEADER
+#ifdef __cplusplus
+#define FT_END_HEADER }
+#else
+#define FT_END_HEADER /* empty */
+#endif
+#endif /* FT_END_HEADER */
+
+
+FT_BEGIN_HEADER
+
+ /*
+ * Mark a function declaration as public. This ensures it will be
+ * properly exported to client code. Place this before a function
+ * declaration.
+ *
+ * NOTE: This macro should be considered an internal implementation
+ * detail, and not part of the FreeType API. It is only defined here
+ * because it is needed by `FT_EXPORT`.
+ */
+
+ /* Visual C, mingw */
+#if defined( _WIN32 )
+
+#if defined( FT2_BUILD_LIBRARY ) && defined( DLL_EXPORT )
+#define FT_PUBLIC_FUNCTION_ATTRIBUTE __declspec( dllexport )
+#elif defined( DLL_IMPORT )
+#define FT_PUBLIC_FUNCTION_ATTRIBUTE __declspec( dllimport )
+#endif
+
+ /* gcc, clang */
+#elif ( defined( __GNUC__ ) && __GNUC__ >= 4 ) || defined( __clang__ )
+#define FT_PUBLIC_FUNCTION_ATTRIBUTE \
+ __attribute__(( visibility( "default" ) ))
+
+ /* Sun */
+#elif defined( __SUNPRO_C ) && __SUNPRO_C >= 0x550
+#define FT_PUBLIC_FUNCTION_ATTRIBUTE __global
+#endif
+
+
+#ifndef FT_PUBLIC_FUNCTION_ATTRIBUTE
+#define FT_PUBLIC_FUNCTION_ATTRIBUTE /* empty */
+#endif
+
+
+ /*
+ * Define a public FreeType API function. This ensures it is properly
+ * exported or imported at build time. The macro parameter is the
+ * function's return type as in:
+ *
+ * FT_EXPORT( FT_Bool )
+ * FT_Object_Method( FT_Object obj,
+ * ... );
+ *
+ * NOTE: This requires that all `FT_EXPORT` uses are inside
+ * `FT_BEGIN_HEADER ... FT_END_HEADER` blocks. This guarantees that the
+ * functions are exported with C linkage, even when the header is included
+ * by a C++ source file.
+ */
+#define FT_EXPORT( x ) FT_PUBLIC_FUNCTION_ATTRIBUTE extern x
+
+
+ /*
+ * `FT_UNUSED` indicates that a given parameter is not used -- this is
+ * only used to get rid of unpleasant compiler warnings.
+ *
+ * Technically, this was not meant to be part of the public API, but some
+ * third-party code depends on it.
+ */
+#ifndef FT_UNUSED
+#define FT_UNUSED( arg ) ( (arg) = (arg) )
+#endif
+
+
+ /*
+ * Support for casts in both C and C++.
+ */
+#ifdef __cplusplus
+#define FT_STATIC_CAST( type, var ) static_cast(var)
+#define FT_REINTERPRET_CAST( type, var ) reinterpret_cast(var)
+
+#define FT_STATIC_BYTE_CAST( type, var ) \
+ static_cast( static_cast( var ) )
+#else
+#define FT_STATIC_CAST( type, var ) (type)(var)
+#define FT_REINTERPRET_CAST( type, var ) (type)(var)
+
+#define FT_STATIC_BYTE_CAST( type, var ) (type)(unsigned char)(var)
+#endif
+
+
+FT_END_HEADER
+
+#endif /* FREETYPE_CONFIG_PUBLIC_MACROS_H_ */
diff --git a/Source/ThirdParty/freetype/freetype.h b/Source/ThirdParty/freetype/freetype.h
index 4f2eaca69..92acf3794 100644
--- a/Source/ThirdParty/freetype/freetype.h
+++ b/Source/ThirdParty/freetype/freetype.h
@@ -4,7 +4,7 @@
*
* FreeType high-level API and common types (specification only).
*
- * Copyright (C) 1996-2019 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -20,25 +20,44 @@
#define FREETYPE_H_
-#ifndef FT_FREETYPE_H
-#error "`ft2build.h' hasn't been included yet!"
-#error "Please always use macros to include FreeType header files."
-#error "Example:"
-#error " #include "
-#error " #include FT_FREETYPE_H"
-#endif
-
-
#include
#include FT_CONFIG_CONFIG_H
-#include FT_TYPES_H
-#include FT_ERRORS_H
+#include
+#include
FT_BEGIN_HEADER
+ /**************************************************************************
+ *
+ * @section:
+ * preamble
+ *
+ * @title:
+ * Preamble
+ *
+ * @abstract:
+ * What FreeType is and isn't
+ *
+ * @description:
+ * FreeType is a library that provides access to glyphs in font files. It
+ * scales the glyph images and their metrics to a requested size, and it
+ * rasterizes the glyph images to produce pixel or subpixel alpha coverage
+ * bitmaps.
+ *
+ * Note that FreeType is _not_ a text layout engine. You have to use
+ * higher-level libraries like HarfBuzz, Pango, or ICU for that.
+ *
+ * Note also that FreeType does _not_ perform alpha blending or
+ * compositing the resulting bitmaps or pixmaps by itself. Use your
+ * favourite graphics library (for example, Cairo or Skia) to further
+ * process FreeType's output.
+ *
+ */
+
+
/**************************************************************************
*
* @section:
@@ -51,22 +70,15 @@ FT_BEGIN_HEADER
* How client applications should include FreeType header files.
*
* @description:
- * To be as flexible as possible (and for historical reasons), FreeType
- * uses a very special inclusion scheme to load header files, for example
+ * To be as flexible as possible (and for historical reasons), you must
+ * load file `ft2build.h` first before other header files, for example
*
* ```
* #include
*
- * #include FT_FREETYPE_H
- * #include FT_OUTLINE_H
+ * #include
+ * #include
* ```
- *
- * A compiler and its preprocessor only needs an include path to find the
- * file `ft2build.h`; the exact locations and names of the other FreeType
- * header files are hidden by @header_file_macros, loaded by
- * `ft2build.h`. The API documentation always gives the header macro
- * name needed for a particular function.
- *
*/
@@ -90,6 +102,277 @@ FT_BEGIN_HEADER
*/
+ /**************************************************************************
+ *
+ * @section:
+ * font_testing_macros
+ *
+ * @title:
+ * Font Testing Macros
+ *
+ * @abstract:
+ * Macros to test various properties of fonts.
+ *
+ * @description:
+ * Macros to test the most important font properties.
+ *
+ * It is recommended to use these high-level macros instead of directly
+ * testing the corresponding flags, which are scattered over various
+ * structures.
+ *
+ * @order:
+ * FT_HAS_HORIZONTAL
+ * FT_HAS_VERTICAL
+ * FT_HAS_KERNING
+ * FT_HAS_FIXED_SIZES
+ * FT_HAS_GLYPH_NAMES
+ * FT_HAS_COLOR
+ * FT_HAS_MULTIPLE_MASTERS
+ * FT_HAS_SVG
+ * FT_HAS_SBIX
+ * FT_HAS_SBIX_OVERLAY
+ *
+ * FT_IS_SFNT
+ * FT_IS_SCALABLE
+ * FT_IS_FIXED_WIDTH
+ * FT_IS_CID_KEYED
+ * FT_IS_TRICKY
+ * FT_IS_NAMED_INSTANCE
+ * FT_IS_VARIATION
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * library_setup
+ *
+ * @title:
+ * Library Setup
+ *
+ * @abstract:
+ * Functions to start and end the usage of the FreeType library.
+ *
+ * @description:
+ * Functions to start and end the usage of the FreeType library.
+ *
+ * Note that @FT_Library_Version and @FREETYPE_XXX are of limited use
+ * because even a new release of FreeType with only documentation
+ * changes increases the version number.
+ *
+ * @order:
+ * FT_Library
+ * FT_Init_FreeType
+ * FT_Done_FreeType
+ *
+ * FT_Library_Version
+ * FREETYPE_XXX
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * face_creation
+ *
+ * @title:
+ * Face Creation
+ *
+ * @abstract:
+ * Functions to manage fonts.
+ *
+ * @description:
+ * The functions and structures collected in this section operate on
+ * fonts globally.
+ *
+ * @order:
+ * FT_Face
+ * FT_FaceRec
+ * FT_FACE_FLAG_XXX
+ * FT_STYLE_FLAG_XXX
+ *
+ * FT_New_Face
+ * FT_Done_Face
+ * FT_Reference_Face
+ * FT_New_Memory_Face
+ * FT_Face_Properties
+ * FT_Open_Face
+ * FT_Open_Args
+ * FT_OPEN_XXX
+ * FT_Parameter
+ * FT_Attach_File
+ * FT_Attach_Stream
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * sizing_and_scaling
+ *
+ * @title:
+ * Sizing and Scaling
+ *
+ * @abstract:
+ * Functions to manage font sizes.
+ *
+ * @description:
+ * The functions and structures collected in this section are related to
+ * selecting and manipulating the size of a font globally.
+ *
+ * @order:
+ * FT_Size
+ * FT_SizeRec
+ * FT_Size_Metrics
+ *
+ * FT_Bitmap_Size
+ *
+ * FT_Set_Char_Size
+ * FT_Set_Pixel_Sizes
+ * FT_Request_Size
+ * FT_Select_Size
+ * FT_Size_Request_Type
+ * FT_Size_RequestRec
+ * FT_Size_Request
+ *
+ * FT_Set_Transform
+ * FT_Get_Transform
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * glyph_retrieval
+ *
+ * @title:
+ * Glyph Retrieval
+ *
+ * @abstract:
+ * Functions to manage glyphs.
+ *
+ * @description:
+ * The functions and structures collected in this section operate on
+ * single glyphs, of which @FT_Load_Glyph is most important.
+ *
+ * @order:
+ * FT_GlyphSlot
+ * FT_GlyphSlotRec
+ * FT_Glyph_Metrics
+ *
+ * FT_Load_Glyph
+ * FT_LOAD_XXX
+ * FT_LOAD_TARGET_MODE
+ * FT_LOAD_TARGET_XXX
+ *
+ * FT_Render_Glyph
+ * FT_Render_Mode
+ * FT_Get_Kerning
+ * FT_Kerning_Mode
+ * FT_Get_Track_Kerning
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * character_mapping
+ *
+ * @title:
+ * Character Mapping
+ *
+ * @abstract:
+ * Functions to manage character-to-glyph maps.
+ *
+ * @description:
+ * This section holds functions and structures that are related to
+ * mapping character input codes to glyph indices.
+ *
+ * Note that for many scripts the simplistic approach used by FreeType
+ * of mapping a single character to a single glyph is not valid or
+ * possible! In general, a higher-level library like HarfBuzz or ICU
+ * should be used for handling text strings.
+ *
+ * @order:
+ * FT_CharMap
+ * FT_CharMapRec
+ * FT_Encoding
+ * FT_ENC_TAG
+ *
+ * FT_Select_Charmap
+ * FT_Set_Charmap
+ * FT_Get_Charmap_Index
+ *
+ * FT_Get_Char_Index
+ * FT_Get_First_Char
+ * FT_Get_Next_Char
+ * FT_Load_Char
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * information_retrieval
+ *
+ * @title:
+ * Information Retrieval
+ *
+ * @abstract:
+ * Functions to retrieve font and glyph information.
+ *
+ * @description:
+ * Functions to retrieve font and glyph information. Only some very
+ * basic data is covered; see also the chapter on the format-specific
+ * API for more.
+ *
+ *
+ * @order:
+ * FT_Get_Name_Index
+ * FT_Get_Glyph_Name
+ * FT_Get_Postscript_Name
+ * FT_Get_FSType_Flags
+ * FT_FSTYPE_XXX
+ * FT_Get_SubGlyph_Info
+ * FT_SUBGLYPH_FLAG_XXX
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * other_api_data
+ *
+ * @title:
+ * Other API Data
+ *
+ * @abstract:
+ * Other structures, enumerations, and macros.
+ *
+ * @description:
+ * Other structures, enumerations, and macros. Deprecated functions are
+ * also listed here.
+ *
+ * @order:
+ * FT_Face_Internal
+ * FT_Size_Internal
+ * FT_Slot_Internal
+ *
+ * FT_SubGlyph
+ *
+ * FT_HAS_FAST_GLYPHS
+ * FT_Face_CheckTrueTypePatents
+ * FT_Face_SetUnpatentedHinting
+ *
+ */
+
/*************************************************************************/
/*************************************************************************/
@@ -103,165 +386,10 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
- * base_interface
- *
- * @title:
- * Base Interface
- *
- * @abstract:
- * The FreeType~2 base font interface.
- *
- * @description:
- * This section describes the most important public high-level API
- * functions of FreeType~2.
- *
- * @order:
- * FT_Library
- * FT_Face
- * FT_Size
- * FT_GlyphSlot
- * FT_CharMap
- * FT_Encoding
- * FT_ENC_TAG
- *
- * FT_FaceRec
- *
- * FT_FACE_FLAG_SCALABLE
- * FT_FACE_FLAG_FIXED_SIZES
- * FT_FACE_FLAG_FIXED_WIDTH
- * FT_FACE_FLAG_HORIZONTAL
- * FT_FACE_FLAG_VERTICAL
- * FT_FACE_FLAG_COLOR
- * FT_FACE_FLAG_SFNT
- * FT_FACE_FLAG_CID_KEYED
- * FT_FACE_FLAG_TRICKY
- * FT_FACE_FLAG_KERNING
- * FT_FACE_FLAG_MULTIPLE_MASTERS
- * FT_FACE_FLAG_VARIATION
- * FT_FACE_FLAG_GLYPH_NAMES
- * FT_FACE_FLAG_EXTERNAL_STREAM
- * FT_FACE_FLAG_HINTER
- *
- * FT_HAS_HORIZONTAL
- * FT_HAS_VERTICAL
- * FT_HAS_KERNING
- * FT_HAS_FIXED_SIZES
- * FT_HAS_GLYPH_NAMES
- * FT_HAS_COLOR
- * FT_HAS_MULTIPLE_MASTERS
- *
- * FT_IS_SFNT
- * FT_IS_SCALABLE
- * FT_IS_FIXED_WIDTH
- * FT_IS_CID_KEYED
- * FT_IS_TRICKY
- * FT_IS_NAMED_INSTANCE
- * FT_IS_VARIATION
- *
- * FT_STYLE_FLAG_BOLD
- * FT_STYLE_FLAG_ITALIC
- *
- * FT_SizeRec
- * FT_Size_Metrics
- *
- * FT_GlyphSlotRec
- * FT_Glyph_Metrics
- * FT_SubGlyph
- *
- * FT_Bitmap_Size
- *
- * FT_Init_FreeType
- * FT_Done_FreeType
- *
- * FT_New_Face
- * FT_Done_Face
- * FT_Reference_Face
- * FT_New_Memory_Face
- * FT_Face_Properties
- * FT_Open_Face
- * FT_Open_Args
- * FT_Parameter
- * FT_Attach_File
- * FT_Attach_Stream
- *
- * FT_Set_Char_Size
- * FT_Set_Pixel_Sizes
- * FT_Request_Size
- * FT_Select_Size
- * FT_Size_Request_Type
- * FT_Size_RequestRec
- * FT_Size_Request
- * FT_Set_Transform
- * FT_Load_Glyph
- * FT_Get_Char_Index
- * FT_Get_First_Char
- * FT_Get_Next_Char
- * FT_Get_Name_Index
- * FT_Load_Char
- *
- * FT_OPEN_MEMORY
- * FT_OPEN_STREAM
- * FT_OPEN_PATHNAME
- * FT_OPEN_DRIVER
- * FT_OPEN_PARAMS
- *
- * FT_LOAD_DEFAULT
- * FT_LOAD_RENDER
- * FT_LOAD_MONOCHROME
- * FT_LOAD_LINEAR_DESIGN
- * FT_LOAD_NO_SCALE
- * FT_LOAD_NO_HINTING
- * FT_LOAD_NO_BITMAP
- * FT_LOAD_NO_AUTOHINT
- * FT_LOAD_COLOR
- *
- * FT_LOAD_VERTICAL_LAYOUT
- * FT_LOAD_IGNORE_TRANSFORM
- * FT_LOAD_FORCE_AUTOHINT
- * FT_LOAD_NO_RECURSE
- * FT_LOAD_PEDANTIC
- *
- * FT_LOAD_TARGET_NORMAL
- * FT_LOAD_TARGET_LIGHT
- * FT_LOAD_TARGET_MONO
- * FT_LOAD_TARGET_LCD
- * FT_LOAD_TARGET_LCD_V
- *
- * FT_LOAD_TARGET_MODE
- *
- * FT_Render_Glyph
- * FT_Render_Mode
- * FT_Get_Kerning
- * FT_Kerning_Mode
- * FT_Get_Track_Kerning
- * FT_Get_Glyph_Name
- * FT_Get_Postscript_Name
- *
- * FT_CharMapRec
- * FT_Select_Charmap
- * FT_Set_Charmap
- * FT_Get_Charmap_Index
- *
- * FT_Get_FSType_Flags
- * FT_Get_SubGlyph_Info
- *
- * FT_Face_Internal
- * FT_Size_Internal
- * FT_Slot_Internal
- *
- * FT_FACE_FLAG_XXX
- * FT_STYLE_FLAG_XXX
- * FT_OPEN_XXX
- * FT_LOAD_XXX
- * FT_LOAD_TARGET_XXX
- * FT_SUBGLYPH_FLAG_XXX
- * FT_FSTYPE_XXX
- *
- * FT_HAS_FAST_GLYPHS
+ * glyph_retrieval
*
*/
-
/**************************************************************************
*
* @struct:
@@ -329,6 +457,13 @@ FT_BEGIN_HEADER
} FT_Glyph_Metrics;
+ /**************************************************************************
+ *
+ * @section:
+ * sizing_and_scaling
+ *
+ */
+
/**************************************************************************
*
* @struct:
@@ -389,6 +524,13 @@ FT_BEGIN_HEADER
/*************************************************************************/
/*************************************************************************/
+ /**************************************************************************
+ *
+ * @section:
+ * library_setup
+ *
+ */
+
/**************************************************************************
*
* @type:
@@ -463,7 +605,7 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
- * base_interface
+ * face_creation
*
*/
@@ -499,6 +641,13 @@ FT_BEGIN_HEADER
typedef struct FT_FaceRec_* FT_Face;
+ /**************************************************************************
+ *
+ * @section:
+ * sizing_and_scaling
+ *
+ */
+
/**************************************************************************
*
* @type:
@@ -509,13 +658,15 @@ FT_BEGIN_HEADER
* size.
*
* @note:
- * An @FT_Face has one _active_ @FT_Size object that is used by functions
- * like @FT_Load_Glyph to determine the scaling transformation that in
- * turn is used to load and hint glyphs and metrics.
+ * An @FT_Face has one _active_ `FT_Size` object that is used by
+ * functions like @FT_Load_Glyph to determine the scaling transformation
+ * that in turn is used to load and hint glyphs and metrics.
*
- * You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, @FT_Request_Size
+ * A newly created `FT_Size` object contains only meaningless zero values.
+ * You must use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, @FT_Request_Size
* or even @FT_Select_Size to change the content (i.e., the scaling
- * values) of the active @FT_Size.
+ * values) of the active `FT_Size`. Otherwise, the scaling and hinting
+ * will not be performed.
*
* You can use @FT_New_Size to create additional size objects for a given
* @FT_Face, but they won't be used by other functions until you activate
@@ -529,6 +680,13 @@ FT_BEGIN_HEADER
typedef struct FT_SizeRec_* FT_Size;
+ /**************************************************************************
+ *
+ * @section:
+ * glyph_retrieval
+ *
+ */
+
/**************************************************************************
*
* @type:
@@ -548,6 +706,13 @@ FT_BEGIN_HEADER
typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;
+ /**************************************************************************
+ *
+ * @section:
+ * character_mapping
+ *
+ */
+
/**************************************************************************
*
* @type:
@@ -603,11 +768,12 @@ FT_BEGIN_HEADER
*/
#ifndef FT_ENC_TAG
-#define FT_ENC_TAG( value, a, b, c, d ) \
- value = ( ( (FT_UInt32)(a) << 24 ) | \
- ( (FT_UInt32)(b) << 16 ) | \
- ( (FT_UInt32)(c) << 8 ) | \
- (FT_UInt32)(d) )
+
+#define FT_ENC_TAG( value, a, b, c, d ) \
+ value = ( ( FT_STATIC_BYTE_CAST( FT_UInt32, a ) << 24 ) | \
+ ( FT_STATIC_BYTE_CAST( FT_UInt32, b ) << 16 ) | \
+ ( FT_STATIC_BYTE_CAST( FT_UInt32, c ) << 8 ) | \
+ FT_STATIC_BYTE_CAST( FT_UInt32, d ) )
#endif /* FT_ENC_TAG */
@@ -623,7 +789,7 @@ FT_BEGIN_HEADER
*
* @note:
* Despite the name, this enumeration lists specific character
- * repertories (i.e., charsets), and not text encoding methods (e.g.,
+ * repertoires (i.e., charsets), and not text encoding methods (e.g.,
* UTF-8, UTF-16, etc.).
*
* Other encodings might be defined in the future.
@@ -645,7 +811,7 @@ FT_BEGIN_HEADER
* FT_ENCODING_MS_SYMBOL ::
* Microsoft Symbol encoding, used to encode mathematical symbols and
* wingdings. For more information, see
- * 'https://www.microsoft.com/typography/otspec/recom.htm',
+ * 'https://www.microsoft.com/typography/otspec/recom.htm#non-standard-symbol-fonts',
* 'http://www.kostis.net/charsets/symbol.htm', and
* 'http://www.kostis.net/charsets/wingding.htm'.
*
@@ -717,11 +883,16 @@ FT_BEGIN_HEADER
* Same as FT_ENCODING_JOHAB. Deprecated.
*
* @note:
- * By default, FreeType enables a Unicode charmap and tags it with
- * `FT_ENCODING_UNICODE` when it is either provided or can be generated
- * from PostScript glyph name dictionaries in the font file. All other
- * encodings are considered legacy and tagged only if explicitly defined
- * in the font file. Otherwise, `FT_ENCODING_NONE` is used.
+ * When loading a font, FreeType makes a Unicode charmap active if
+ * possible (either if the font provides such a charmap, or if FreeType
+ * can synthesize one from PostScript glyph name dictionaries; in either
+ * case, the charmap is tagged with `FT_ENCODING_UNICODE`). If such a
+ * charmap is synthesized, it is placed at the first position of the
+ * charmap array.
+ *
+ * All other encodings are considered legacy and tagged only if
+ * explicitly defined in the font file. Otherwise, `FT_ENCODING_NONE` is
+ * used.
*
* `FT_ENCODING_NONE` is set by the BDF and PCF drivers if the charmap is
* neither Unicode nor ISO-8859-1 (otherwise it is set to
@@ -751,7 +922,7 @@ FT_BEGIN_HEADER
* `encoding_id`. If, for example, `encoding_id` is `TT_MAC_ID_ROMAN`
* and the language ID (minus~1) is `TT_MAC_LANGID_GREEK`, it is the
* Greek encoding, not Roman. `TT_MAC_ID_ARABIC` with
- * `TT_MAC_LANGID_FARSI` means the Farsi variant the Arabic encoding.
+ * `TT_MAC_LANGID_FARSI` means the Farsi variant of the Arabic encoding.
*/
typedef enum FT_Encoding_
{
@@ -849,6 +1020,13 @@ FT_BEGIN_HEADER
/*************************************************************************/
+ /**************************************************************************
+ *
+ * @section:
+ * other_api_data
+ *
+ */
+
/**************************************************************************
*
* @type:
@@ -864,6 +1042,13 @@ FT_BEGIN_HEADER
typedef struct FT_Face_InternalRec_* FT_Face_Internal;
+ /**************************************************************************
+ *
+ * @section:
+ * face_creation
+ *
+ */
+
/**************************************************************************
*
* @struct:
@@ -890,7 +1075,7 @@ FT_BEGIN_HEADER
* If we have the third named instance of face~4, say, `face_index` is
* set to 0x00030004.
*
- * Bit 31 is always zero (this is, `face_index` is always a positive
+ * Bit 31 is always zero (that is, `face_index` is always a positive
* value).
*
* [Since 2.9] Changing the design coordinates with
@@ -908,7 +1093,7 @@ FT_BEGIN_HEADER
*
* [Since 2.6.1] Bits 16-30 hold the number of named instances
* available for the current face if we have a GX or OpenType variation
- * (sub)font. Bit 31 is always zero (this is, `style_flags` is always
+ * (sub)font. Bit 31 is always zero (that is, `style_flags` is always
* a positive value). Note that a variation font has always at least
* one named instance, namely the default instance.
*
@@ -974,6 +1159,9 @@ FT_BEGIN_HEADER
* Note that the bounding box might be off by (at least) one pixel for
* hinted fonts. See @FT_Size_Metrics for further discussion.
*
+ * Note that the bounding box does not vary in OpenType variation fonts
+ * and should only be used in relation to the default instance.
+ *
* units_per_EM ::
* The number of font units per EM square for this face. This is
* typically 2048 for TrueType fonts, and 1000 for Type~1 fonts. Only
@@ -1059,9 +1247,9 @@ FT_BEGIN_HEADER
FT_Generic generic;
- /*# The following member variables (down to `underline_thickness`) */
- /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size */
- /*# for bitmap fonts. */
+ /* The following member variables (down to `underline_thickness`) */
+ /* are only relevant to scalable outlines; cf. @FT_Bitmap_Size */
+ /* for bitmap fonts. */
FT_BBox bbox;
FT_UShort units_per_EM;
@@ -1079,7 +1267,7 @@ FT_BEGIN_HEADER
FT_Size size;
FT_CharMap charmap;
- /*@private begin */
+ /* private fields, internal to FreeType */
FT_Driver driver;
FT_Memory memory;
@@ -1092,8 +1280,6 @@ FT_BEGIN_HEADER
FT_Face_Internal internal;
- /*@private end */
-
} FT_FaceRec;
@@ -1136,9 +1322,9 @@ FT_BEGIN_HEADER
* FT_FACE_FLAG_KERNING ::
* The face contains kerning information. If set, the kerning distance
* can be retrieved using the function @FT_Get_Kerning. Otherwise the
- * function always return the vector (0,0). Note that FreeType doesn't
- * handle kerning data from the SFNT 'GPOS' table (as present in many
- * OpenType fonts).
+ * function always returns the vector (0,0). Note that FreeType
+ * doesn't handle kerning data from the SFNT 'GPOS' table (as present
+ * in many OpenType fonts).
*
* FT_FACE_FLAG_FAST_GLYPHS ::
* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT.
@@ -1176,13 +1362,13 @@ FT_BEGIN_HEADER
* successfully; in all other cases you get an
* `FT_Err_Invalid_Argument` error.
*
- * Note that CID-keyed fonts that are in an SFNT wrapper (this is, all
+ * Note that CID-keyed fonts that are in an SFNT wrapper (that is, all
* OpenType/CFF fonts) don't have this flag set since the glyphs are
* accessed in the normal way (using contiguous indices); the
* 'CID-ness' isn't visible to the application.
*
* FT_FACE_FLAG_TRICKY ::
- * The face is 'tricky', this is, it always needs the font format's
+ * The face is 'tricky', that is, it always needs the font format's
* native hinting engine to get a reasonable result. A typical example
* is the old Chinese font `mingli.ttf` (but not `mingliu.ttc`) that
* uses TrueType bytecode instructions to move and scale all of its
@@ -1204,8 +1390,21 @@ FT_BEGIN_HEADER
* FT_FACE_FLAG_VARIATION ::
* [Since 2.9] Set if the current face (or named instance) has been
* altered with @FT_Set_MM_Design_Coordinates,
- * @FT_Set_Var_Design_Coordinates, or @FT_Set_Var_Blend_Coordinates.
- * This flag is unset by a call to @FT_Set_Named_Instance.
+ * @FT_Set_Var_Design_Coordinates, @FT_Set_Var_Blend_Coordinates, or
+ * @FT_Set_MM_WeightVector to select a non-default instance.
+ *
+ * FT_FACE_FLAG_SVG ::
+ * [Since 2.12] The face has an 'SVG~' OpenType table.
+ *
+ * FT_FACE_FLAG_SBIX ::
+ * [Since 2.12] The face has an 'sbix' OpenType table *and* outlines.
+ * For such fonts, @FT_FACE_FLAG_SCALABLE is not set by default to
+ * retain backward compatibility.
+ *
+ * FT_FACE_FLAG_SBIX_OVERLAY ::
+ * [Since 2.12] The face has an 'sbix' OpenType table where outlines
+ * should be drawn on top of bitmap strikes.
+ *
*/
#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
@@ -1223,8 +1422,18 @@ FT_BEGIN_HEADER
#define FT_FACE_FLAG_TRICKY ( 1L << 13 )
#define FT_FACE_FLAG_COLOR ( 1L << 14 )
#define FT_FACE_FLAG_VARIATION ( 1L << 15 )
+#define FT_FACE_FLAG_SVG ( 1L << 16 )
+#define FT_FACE_FLAG_SBIX ( 1L << 17 )
+#define FT_FACE_FLAG_SBIX_OVERLAY ( 1L << 18 )
+ /**************************************************************************
+ *
+ * @section:
+ * font_testing_macros
+ *
+ */
+
/**************************************************************************
*
* @macro:
@@ -1239,7 +1448,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_HORIZONTAL( face ) \
- ( (face)->face_flags & FT_FACE_FLAG_HORIZONTAL )
+ ( !!( (face)->face_flags & FT_FACE_FLAG_HORIZONTAL ) )
/**************************************************************************
@@ -1253,7 +1462,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_VERTICAL( face ) \
- ( (face)->face_flags & FT_FACE_FLAG_VERTICAL )
+ ( !!( (face)->face_flags & FT_FACE_FLAG_VERTICAL ) )
/**************************************************************************
@@ -1267,7 +1476,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_KERNING( face ) \
- ( (face)->face_flags & FT_FACE_FLAG_KERNING )
+ ( !!( (face)->face_flags & FT_FACE_FLAG_KERNING ) )
/**************************************************************************
@@ -1282,7 +1491,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_SCALABLE( face ) \
- ( (face)->face_flags & FT_FACE_FLAG_SCALABLE )
+ ( !!( (face)->face_flags & FT_FACE_FLAG_SCALABLE ) )
/**************************************************************************
@@ -1301,7 +1510,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_SFNT( face ) \
- ( (face)->face_flags & FT_FACE_FLAG_SFNT )
+ ( !!( (face)->face_flags & FT_FACE_FLAG_SFNT ) )
/**************************************************************************
@@ -1316,7 +1525,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_FIXED_WIDTH( face ) \
- ( (face)->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
+ ( !!( (face)->face_flags & FT_FACE_FLAG_FIXED_WIDTH ) )
/**************************************************************************
@@ -1331,9 +1540,16 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_FIXED_SIZES( face ) \
- ( (face)->face_flags & FT_FACE_FLAG_FIXED_SIZES )
+ ( !!( (face)->face_flags & FT_FACE_FLAG_FIXED_SIZES ) )
+ /**************************************************************************
+ *
+ * @section:
+ * other_api_data
+ *
+ */
+
/**************************************************************************
*
* @macro:
@@ -1346,6 +1562,13 @@ FT_BEGIN_HEADER
#define FT_HAS_FAST_GLYPHS( face ) 0
+ /**************************************************************************
+ *
+ * @section:
+ * font_testing_macros
+ *
+ */
+
/**************************************************************************
*
* @macro:
@@ -1357,7 +1580,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_GLYPH_NAMES( face ) \
- ( (face)->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
+ ( !!( (face)->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) )
/**************************************************************************
@@ -1372,7 +1595,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_MULTIPLE_MASTERS( face ) \
- ( (face)->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
+ ( !!( (face)->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS ) )
/**************************************************************************
@@ -1394,7 +1617,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_NAMED_INSTANCE( face ) \
- ( (face)->face_index & 0x7FFF0000L )
+ ( !!( (face)->face_index & 0x7FFF0000L ) )
/**************************************************************************
@@ -1404,15 +1627,15 @@ FT_BEGIN_HEADER
*
* @description:
* A macro that returns true whenever a face object has been altered by
- * @FT_Set_MM_Design_Coordinates, @FT_Set_Var_Design_Coordinates, or
- * @FT_Set_Var_Blend_Coordinates.
+ * @FT_Set_MM_Design_Coordinates, @FT_Set_Var_Design_Coordinates,
+ * @FT_Set_Var_Blend_Coordinates, or @FT_Set_MM_WeightVector.
*
* @since:
* 2.9
*
*/
#define FT_IS_VARIATION( face ) \
- ( (face)->face_flags & FT_FACE_FLAG_VARIATION )
+ ( !!( (face)->face_flags & FT_FACE_FLAG_VARIATION ) )
/**************************************************************************
@@ -1429,7 +1652,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_CID_KEYED( face ) \
- ( (face)->face_flags & FT_FACE_FLAG_CID_KEYED )
+ ( !!( (face)->face_flags & FT_FACE_FLAG_CID_KEYED ) )
/**************************************************************************
@@ -1443,7 +1666,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_TRICKY( face ) \
- ( (face)->face_flags & FT_FACE_FLAG_TRICKY )
+ ( !!( (face)->face_flags & FT_FACE_FLAG_TRICKY ) )
/**************************************************************************
@@ -1460,9 +1683,134 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_COLOR( face ) \
- ( (face)->face_flags & FT_FACE_FLAG_COLOR )
+ ( !!( (face)->face_flags & FT_FACE_FLAG_COLOR ) )
+ /**************************************************************************
+ *
+ * @macro:
+ * FT_HAS_SVG
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains an 'SVG~'
+ * OpenType table.
+ *
+ * @since:
+ * 2.12
+ */
+#define FT_HAS_SVG( face ) \
+ ( !!( (face)->face_flags & FT_FACE_FLAG_SVG ) )
+
+
+ /**************************************************************************
+ *
+ * @macro:
+ * FT_HAS_SBIX
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains an 'sbix'
+ * OpenType table *and* outline glyphs.
+ *
+ * Currently, FreeType only supports bitmap glyphs in PNG format for this
+ * table (i.e., JPEG and TIFF formats are unsupported, as are
+ * Apple-specific formats not part of the OpenType specification).
+ *
+ * @note:
+ * For backward compatibility, a font with an 'sbix' table is treated as
+ * a bitmap-only face. Using @FT_Open_Face with
+ * @FT_PARAM_TAG_IGNORE_SBIX, an application can switch off 'sbix'
+ * handling so that the face is treated as an ordinary outline font with
+ * scalable outlines.
+ *
+ * Here is some pseudo code that roughly illustrates how to implement
+ * 'sbix' handling according to the OpenType specification.
+ *
+ * ```
+ * if ( FT_HAS_SBIX( face ) )
+ * {
+ * // open font as a scalable one without sbix handling
+ * FT_Face face2;
+ * FT_Parameter param = { FT_PARAM_TAG_IGNORE_SBIX, NULL };
+ * FT_Open_Args args = { FT_OPEN_PARAMS | ...,
+ * ...,
+ * 1, ¶m };
+ *
+ *
+ * FT_Open_Face( library, &args, 0, &face2 );
+ *
+ * available_size` as necessary into
+ * `preferred_sizes`[*]>
+ *
+ * for ( i = 0; i < face->num_fixed_sizes; i++ )
+ * {
+ * size = preferred_sizes[i].size;
+ *
+ * error = FT_Set_Pixel_Sizes( face, size, size );
+ *
+ *
+ * // check whether we have a glyph in a bitmap strike
+ * error = FT_Load_Glyph( face,
+ * glyph_index,
+ * FT_LOAD_SBITS_ONLY |
+ * FT_LOAD_BITMAP_METRICS_ONLY );
+ * if ( error == FT_Err_Invalid_Argument )
+ * continue;
+ * else if ( error )
+ *
+ * else
+ * break;
+ * }
+ *
+ * if ( i != face->num_fixed_sizes )
+ *
+ *
+ * if ( i == face->num_fixed_sizes ||
+ * FT_HAS_SBIX_OVERLAY( face ) )
+ *