diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_iostream.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_iostream.g.cs index ba7b2f9..91172e0 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_iostream.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_iostream.g.cs @@ -40,19 +40,19 @@ namespace SDL public unsafe partial struct SDL_IOStreamInterface { - [NativeTypeName("Sint64 (*)(void *) __attribute__((cdecl))")] + [NativeTypeName("Sint64 (*)(void *)")] public delegate* unmanaged[Cdecl] size; - [NativeTypeName("Sint64 (*)(void *, Sint64, int) __attribute__((cdecl))")] + [NativeTypeName("Sint64 (*)(void *, Sint64, int)")] public delegate* unmanaged[Cdecl] seek; - [NativeTypeName("size_t (*)(void *, void *, size_t, SDL_IOStatus *) __attribute__((cdecl))")] + [NativeTypeName("size_t (*)(void *, void *, size_t, SDL_IOStatus *)")] public delegate* unmanaged[Cdecl] read; - [NativeTypeName("size_t (*)(void *, const void *, size_t, SDL_IOStatus *) __attribute__((cdecl))")] + [NativeTypeName("size_t (*)(void *, const void *, size_t, SDL_IOStatus *)")] public delegate* unmanaged[Cdecl] write; - [NativeTypeName("int (*)(void *) __attribute__((cdecl))")] + [NativeTypeName("int (*)(void *)")] public delegate* unmanaged[Cdecl] close; } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_joystick.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_joystick.g.cs index fc646fb..229c0bb 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_joystick.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_joystick.g.cs @@ -91,22 +91,22 @@ namespace SDL public void* userdata; - [NativeTypeName("void (*)(void *) __attribute__((cdecl))")] + [NativeTypeName("void (*)(void *)")] public delegate* unmanaged[Cdecl] Update; - [NativeTypeName("void (*)(void *, int) __attribute__((cdecl))")] + [NativeTypeName("void (*)(void *, int)")] public delegate* unmanaged[Cdecl] SetPlayerIndex; - [NativeTypeName("int (*)(void *, Uint16, Uint16) __attribute__((cdecl))")] + [NativeTypeName("int (*)(void *, Uint16, Uint16)")] public delegate* unmanaged[Cdecl] Rumble; - [NativeTypeName("int (*)(void *, Uint16, Uint16) __attribute__((cdecl))")] + [NativeTypeName("int (*)(void *, Uint16, Uint16)")] public delegate* unmanaged[Cdecl] RumbleTriggers; - [NativeTypeName("int (*)(void *, Uint8, Uint8, Uint8) __attribute__((cdecl))")] + [NativeTypeName("int (*)(void *, Uint8, Uint8, Uint8)")] public delegate* unmanaged[Cdecl] SetLED; - [NativeTypeName("int (*)(void *, const void *, int) __attribute__((cdecl))")] + [NativeTypeName("int (*)(void *, const void *, int)")] public delegate* unmanaged[Cdecl] SendEffect; } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_main.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_main.g.cs index b2ee8e4..cfa292a 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_main.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_main.g.cs @@ -40,14 +40,5 @@ namespace SDL [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int SDL_EnterAppMainCallbacks(int argc, [NativeTypeName("char *[]")] sbyte** argv, [NativeTypeName("SDL_AppInit_func")] delegate* unmanaged[Cdecl] appinit, [NativeTypeName("SDL_AppIterate_func")] delegate* unmanaged[Cdecl] appiter, [NativeTypeName("SDL_AppEvent_func")] delegate* unmanaged[Cdecl] appevent, [NativeTypeName("SDL_AppQuit_func")] delegate* unmanaged[Cdecl] appquit); - - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_RegisterApp([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("Uint32")] uint style, void* hInst); - - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void SDL_UnregisterApp(); - - [NativeTypeName("#define main SDL_main")] - public static readonly delegate* main = &SDL_main; } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_properties.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_properties.g.cs index 744c198..21b85b1 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_properties.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_properties.g.cs @@ -57,7 +57,7 @@ namespace SDL public static extern void SDL_UnlockProperties([NativeTypeName("SDL_PropertiesID")] uint props); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetPropertyWithCleanup([NativeTypeName("SDL_PropertiesID")] uint props, [NativeTypeName("const char *")] sbyte* name, void* value, [NativeTypeName("void (*)(void *, void *) __attribute__((cdecl))")] delegate* unmanaged[Cdecl] cleanup, void* userdata); + public static extern int SDL_SetPropertyWithCleanup([NativeTypeName("SDL_PropertiesID")] uint props, [NativeTypeName("const char *")] sbyte* name, void* value, [NativeTypeName("void (*)(void *, void *)")] delegate* unmanaged[Cdecl] cleanup, void* userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int SDL_SetProperty([NativeTypeName("SDL_PropertiesID")] uint props, [NativeTypeName("const char *")] sbyte* name, void* value); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_stdinc.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_stdinc.g.cs index 1aa064b..0582c1e 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_stdinc.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_stdinc.g.cs @@ -77,16 +77,16 @@ namespace SDL public static extern int SDL_setenv([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("const char *")] sbyte* value, int overwrite); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void SDL_qsort(void* @base, [NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size, [NativeTypeName("int (*)(const void *, const void *) __attribute__((cdecl))")] delegate* unmanaged[Cdecl] compare); + public static extern void SDL_qsort(void* @base, [NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size, [NativeTypeName("int (*)(const void *, const void *)")] delegate* unmanaged[Cdecl] compare); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void* SDL_bsearch([NativeTypeName("const void *")] void* key, [NativeTypeName("const void *")] void* @base, [NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size, [NativeTypeName("int (*)(const void *, const void *) __attribute__((cdecl))")] delegate* unmanaged[Cdecl] compare); + public static extern void* SDL_bsearch([NativeTypeName("const void *")] void* key, [NativeTypeName("const void *")] void* @base, [NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size, [NativeTypeName("int (*)(const void *, const void *)")] delegate* unmanaged[Cdecl] compare); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void SDL_qsort_r(void* @base, [NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size, [NativeTypeName("int (*)(void *, const void *, const void *) __attribute__((cdecl))")] delegate* unmanaged[Cdecl] compare, void* userdata); + public static extern void SDL_qsort_r(void* @base, [NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size, [NativeTypeName("int (*)(void *, const void *, const void *)")] delegate* unmanaged[Cdecl] compare, void* userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void* SDL_bsearch_r([NativeTypeName("const void *")] void* key, [NativeTypeName("const void *")] void* @base, [NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size, [NativeTypeName("int (*)(void *, const void *, const void *) __attribute__((cdecl))")] delegate* unmanaged[Cdecl] compare, void* userdata); + public static extern void* SDL_bsearch_r([NativeTypeName("const void *")] void* key, [NativeTypeName("const void *")] void* @base, [NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size, [NativeTypeName("int (*)(void *, const void *, const void *)")] delegate* unmanaged[Cdecl] compare, void* userdata); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int SDL_abs(int x); @@ -612,17 +612,17 @@ namespace SDL [NativeTypeName("#define SDL_FLT_EPSILON 1.1920928955078125e-07F")] public const float SDL_FLT_EPSILON = 1.1920928955078125e-07F; - [NativeTypeName("#define SDL_PRIs64 \"I64d\"")] - public static ReadOnlySpan SDL_PRIs64 => "I64d"u8; + [NativeTypeName("#define SDL_PRIs64 \"lld\"")] + public static ReadOnlySpan SDL_PRIs64 => "lld"u8; - [NativeTypeName("#define SDL_PRIu64 \"I64u\"")] - public static ReadOnlySpan SDL_PRIu64 => "I64u"u8; + [NativeTypeName("#define SDL_PRIu64 \"llu\"")] + public static ReadOnlySpan SDL_PRIu64 => "llu"u8; - [NativeTypeName("#define SDL_PRIx64 \"I64x\"")] - public static ReadOnlySpan SDL_PRIx64 => "I64x"u8; + [NativeTypeName("#define SDL_PRIx64 \"llx\"")] + public static ReadOnlySpan SDL_PRIx64 => "llx"u8; - [NativeTypeName("#define SDL_PRIX64 \"I64X\"")] - public static ReadOnlySpan SDL_PRIX64 => "I64X"u8; + [NativeTypeName("#define SDL_PRIX64 \"llX\"")] + public static ReadOnlySpan SDL_PRIX64 => "llX"u8; [NativeTypeName("#define SDL_PRIs32 \"d\"")] public static ReadOnlySpan SDL_PRIs32 => "d"u8; diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_storage.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_storage.g.cs index 67af419..845189b 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_storage.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_storage.g.cs @@ -29,34 +29,34 @@ namespace SDL { public unsafe partial struct SDL_StorageInterface { - [NativeTypeName("int (*)(void *) __attribute__((cdecl))")] + [NativeTypeName("int (*)(void *)")] public delegate* unmanaged[Cdecl] close; - [NativeTypeName("SDL_bool (*)(void *) __attribute__((cdecl))")] + [NativeTypeName("SDL_bool (*)(void *)")] public delegate* unmanaged[Cdecl] ready; - [NativeTypeName("int (*)(void *, const char *, SDL_EnumerateDirectoryCallback, void *) __attribute__((cdecl))")] + [NativeTypeName("int (*)(void *, const char *, SDL_EnumerateDirectoryCallback, void *)")] public delegate* unmanaged[Cdecl], void*, int> enumerate; - [NativeTypeName("int (*)(void *, const char *, SDL_PathInfo *) __attribute__((cdecl))")] + [NativeTypeName("int (*)(void *, const char *, SDL_PathInfo *)")] public delegate* unmanaged[Cdecl] info; - [NativeTypeName("int (*)(void *, const char *, void *, Uint64) __attribute__((cdecl))")] + [NativeTypeName("int (*)(void *, const char *, void *, Uint64)")] public delegate* unmanaged[Cdecl] read_file; - [NativeTypeName("int (*)(void *, const char *, const void *, Uint64) __attribute__((cdecl))")] + [NativeTypeName("int (*)(void *, const char *, const void *, Uint64)")] public delegate* unmanaged[Cdecl] write_file; - [NativeTypeName("int (*)(void *, const char *) __attribute__((cdecl))")] + [NativeTypeName("int (*)(void *, const char *)")] public delegate* unmanaged[Cdecl] mkdir; - [NativeTypeName("int (*)(void *, const char *) __attribute__((cdecl))")] + [NativeTypeName("int (*)(void *, const char *)")] public delegate* unmanaged[Cdecl] remove; - [NativeTypeName("int (*)(void *, const char *, const char *) __attribute__((cdecl))")] + [NativeTypeName("int (*)(void *, const char *, const char *)")] public delegate* unmanaged[Cdecl] rename; - [NativeTypeName("Uint64 (*)(void *) __attribute__((cdecl))")] + [NativeTypeName("Uint64 (*)(void *)")] public delegate* unmanaged[Cdecl] space_remaining; } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_system.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_system.g.cs index f077d73..c16946f 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_system.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_system.g.cs @@ -27,10 +27,6 @@ using System.Runtime.InteropServices; namespace SDL { - public partial struct tagMSG - { - } - [StructLayout(LayoutKind.Explicit)] public partial struct _XEvent { @@ -38,16 +34,6 @@ namespace SDL public static unsafe partial class SDL3 { - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void SDL_SetWindowsMessageHook([NativeTypeName("SDL_WindowsMessageHook")] delegate* unmanaged[Cdecl] callback, void* userdata); - - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_Direct3D9GetAdapterIndex([NativeTypeName("SDL_DisplayID")] uint displayID); - - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [return: NativeTypeName("SDL_bool")] - public static extern int SDL_DXGIGetOutputInfo([NativeTypeName("SDL_DisplayID")] uint displayID, int* adapterIndex, int* outputIndex); - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_SetX11EventHook([NativeTypeName("SDL_X11EventHook")] delegate* unmanaged[Cdecl] callback, void* userdata); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_thread.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_thread.g.cs index a0fecc7..94d428b 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_thread.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_thread.g.cs @@ -42,10 +42,10 @@ namespace SDL public static unsafe partial class SDL3 { [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern SDL_Thread* SDL_CreateThread([NativeTypeName("SDL_ThreadFunction")] delegate* unmanaged[Cdecl] fn, [NativeTypeName("const char *")] sbyte* name, void* data, [NativeTypeName("pfnSDL_CurrentBeginThread")] delegate* unmanaged[Cdecl], void*, uint, uint*, nuint> pfnBeginThread, [NativeTypeName("pfnSDL_CurrentEndThread")] delegate* unmanaged[Cdecl] pfnEndThread); + public static extern SDL_Thread* SDL_CreateThread([NativeTypeName("SDL_ThreadFunction")] delegate* unmanaged[Cdecl] fn, [NativeTypeName("const char *")] sbyte* name, void* data); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern SDL_Thread* SDL_CreateThreadWithStackSize([NativeTypeName("SDL_ThreadFunction")] delegate* unmanaged[Cdecl] fn, [NativeTypeName("const char *")] sbyte* name, [NativeTypeName("const size_t")] nuint stacksize, void* data, [NativeTypeName("pfnSDL_CurrentBeginThread")] delegate* unmanaged[Cdecl], void*, uint, uint*, nuint> pfnBeginThread, [NativeTypeName("pfnSDL_CurrentEndThread")] delegate* unmanaged[Cdecl] pfnEndThread); + public static extern SDL_Thread* SDL_CreateThreadWithStackSize([NativeTypeName("SDL_ThreadFunction")] delegate* unmanaged[Cdecl] fn, [NativeTypeName("const char *")] sbyte* name, [NativeTypeName("const size_t")] nuint stacksize, void* data); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("const char *")] @@ -76,15 +76,9 @@ namespace SDL public static extern void* SDL_GetTLS([NativeTypeName("SDL_TLSID")] uint id); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int SDL_SetTLS([NativeTypeName("SDL_TLSID")] uint id, [NativeTypeName("const void *")] void* value, [NativeTypeName("void (*)(void *) __attribute__((cdecl))")] delegate* unmanaged[Cdecl] destructor); + public static extern int SDL_SetTLS([NativeTypeName("SDL_TLSID")] uint id, [NativeTypeName("const void *")] void* value, [NativeTypeName("void (*)(void *)")] delegate* unmanaged[Cdecl] destructor); [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SDL_CleanupTLS(); - - [NativeTypeName("#define SDL_beginthread _beginthreadex")] - public static readonly delegate*, void*, uint, uint*, nuint> SDL_beginthread = &_beginthreadex; - - [NativeTypeName("#define SDL_endthread _endthreadex")] - public static readonly delegate* SDL_endthread = &_endthreadex; } } diff --git a/SDL3-CS/generate_bindings.py b/SDL3-CS/generate_bindings.py index f2107b3..aebde99 100644 --- a/SDL3-CS/generate_bindings.py +++ b/SDL3-CS/generate_bindings.py @@ -123,6 +123,9 @@ base_command = [ "--libraryPath", "SDL3", "--methodClassName", "SDL3", "--namespace", "SDL", + + "--additional", + "--undefine-macro=_WIN32", ]