Skip to content

Commit 3c21f68

Browse files
committed
Hard-code string-returning functions in SDL_mixer
1 parent 2c185bf commit 3c21f68

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

SDL3-CS/generate_bindings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ def run_clangsharp(command, header: Header):
312312
"--file", header.input_file(),
313313
"--output", header.output_file(),
314314
"--libraryPath", header.base,
315-
316315
"--methodClassName", header.base,
317316
]
318317

@@ -374,6 +373,8 @@ def get_string_returning_functions(sdl_api):
374373
yield "TTF_GetFontFamilyName"
375374
yield "TTF_GetFontStyleName"
376375

376+
yield "MIX_GetAudioDecoder"
377+
377378

378379
def should_skip(solo_headers: list[Header], header: Header):
379380
if len(solo_headers) == 0:

SDL3_mixer-CS/SDL3_mixer/ClangSharp/SDL_mixer.g.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ public static unsafe partial class SDL3_mixer
7979
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
8080
public static extern int MIX_GetNumAudioDecoders();
8181

82-
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
82+
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, EntryPoint = "MIX_GetAudioDecoder", ExactSpelling = true)]
8383
[return: NativeTypeName("const char *")]
84-
public static extern byte* MIX_GetAudioDecoder(int index);
84+
public static extern byte* Unsafe_MIX_GetAudioDecoder(int index);
8585

8686
[DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
8787
public static extern MIX_Mixer* MIX_CreateMixerDevice(SDL_AudioDeviceID devid, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec);

0 commit comments

Comments
 (0)