From 37da786af0b6d6de333e335382a85126ceb0c3c2 Mon Sep 17 00:00:00 2001 From: Susko3 Date: Sat, 6 Apr 2024 13:38:13 +0200 Subject: [PATCH] Define `SDL_FUNCTION_POINTER_IS_VOID_POINTER` --- SDL3-CS/SDL3/ClangSharp/SDL_loadso.g.cs | 2 +- SDL3-CS/SDL3/ClangSharp/SDL_video.g.cs | 4 ++-- SDL3-CS/SDL3/ClangSharp/SDL_vulkan.g.cs | 3 ++- SDL3-CS/generate_bindings.py | 3 +++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_loadso.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_loadso.g.cs index 6afac12..65d2668 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_loadso.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_loadso.g.cs @@ -36,7 +36,7 @@ namespace SDL [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("SDL_FunctionPointer")] - public static extern delegate* unmanaged[Cdecl] SDL_LoadFunction([NativeTypeName("void*")] IntPtr handle, [NativeTypeName("const char *")] byte* name); + public static extern IntPtr SDL_LoadFunction([NativeTypeName("void*")] IntPtr handle, [NativeTypeName("const char *")] byte* name); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_UnloadObject([NativeTypeName("void*")] IntPtr handle); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_video.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_video.g.cs index 9c3c60a..69ff2ac 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_video.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_video.g.cs @@ -414,11 +414,11 @@ namespace SDL [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("SDL_FunctionPointer")] - public static extern delegate* unmanaged[Cdecl] SDL_GL_GetProcAddress([NativeTypeName("const char *")] byte* proc); + public static extern IntPtr SDL_GL_GetProcAddress([NativeTypeName("const char *")] byte* proc); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("SDL_FunctionPointer")] - public static extern delegate* unmanaged[Cdecl] SDL_EGL_GetProcAddress([NativeTypeName("const char *")] byte* proc); + public static extern IntPtr SDL_EGL_GetProcAddress([NativeTypeName("const char *")] byte* proc); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_GL_UnloadLibrary(); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_vulkan.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_vulkan.g.cs index a83e2fb..f8c8039 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_vulkan.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_vulkan.g.cs @@ -23,6 +23,7 @@ 3. This notice may not be removed or altered from any source distribution. */ +using System; using System.Runtime.InteropServices; namespace SDL @@ -46,7 +47,7 @@ namespace SDL [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("SDL_FunctionPointer")] - public static extern delegate* unmanaged[Cdecl] SDL_Vulkan_GetVkGetInstanceProcAddr(); + public static extern IntPtr SDL_Vulkan_GetVkGetInstanceProcAddr(); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_Vulkan_UnloadLibrary(); diff --git a/SDL3-CS/generate_bindings.py b/SDL3-CS/generate_bindings.py index 834f085..0144ad9 100644 --- a/SDL3-CS/generate_bindings.py +++ b/SDL3-CS/generate_bindings.py @@ -217,6 +217,9 @@ base_command = [ "char=byte", "wchar_t *=IntPtr", # wchar_t has a platform-defined size + "--define-macro", + "SDL_FUNCTION_POINTER_IS_VOID_POINTER", + "--additional", "--undefine-macro=_WIN32", ]