Skip to content

Commit 890db2e

Browse files
committed
Mark SDL2_mixer callback functions as cdecl
1 parent a78bb2f commit 890db2e

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

sdl2_mixer.pas

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ function Mix_GetMusicType(music: TMix_Music): TMix_MusicType cdecl; external MIX
244244
or add a custom mixer filter for the stream data.
245245
*}
246246
type
247-
TMix_Func = procedure(udata: Pointer; stream: PUInt8; len: Integer);
247+
TMix_Func = procedure(udata: Pointer; stream: PUInt8; len: Integer) cdecl;
248248

249249
procedure Mix_SetPostMix(func: TMix_Func; arg: Pointer) cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_SetPostMix' {$ENDIF} {$ENDIF};
250250

@@ -253,12 +253,13 @@ procedure Mix_SetPostMix(func: TMix_Func; arg: Pointer) cdecl; external MIX_LibN
253253
*}
254254
procedure Mix_HookMusic(func: TMix_Func; arg: Pointer) cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_HookMusic' {$ENDIF} {$ENDIF};
255255

256-
{* Add your own callback when the music has finished playing.
257-
This callback is only called if the music finishes naturally.
256+
{* Add your own callback when the music has finished playing
257+
* or when it is stopped from a call to Mix_HaltMusic.
258258
*}
259259
type
260260
PMix_Music_Finished = ^TMix_Music_Finished;
261-
TMix_Music_Finished = procedure();
261+
TMix_Music_Finished = procedure() cdecl;
262+
262263
procedure Mix_HookMusicFinished(music_finished: PMix_Music_Finished) cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_HookMusicFinished' {$ENDIF} {$ENDIF};
263264

264265
{* Get a pointer to the user data for the current music hook *}
@@ -273,7 +274,8 @@ function Mix_GetMusicHookData: Pointer cdecl; external MIX_LibName {$IFDEF DELPH
273274
* before calling your callback.
274275
*}
275276
type
276-
TMix_Channel_Finished = procedure(channel: Integer);
277+
TMix_Channel_Finished = procedure(channel: Integer) cdecl;
278+
277279
procedure Mix_ChannelFinished(channel_finished: TMix_Channel_Finished) cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_ChannelFinished' {$ENDIF} {$ENDIF};
278280

279281
{* Special Effects API by ryan c. gordon. (icculus@icculus.org) *}
@@ -298,7 +300,7 @@ procedure Mix_ChannelFinished(channel_finished: TMix_Channel_Finished) cdecl; ex
298300
* DO NOT EVER call SDL_LockAudio() from your callback function!
299301
*}
300302
type
301-
TMix_EffectFunc_t = procedure(chan: Integer; stream: Pointer; len: Integer; udata: Pointer);
303+
TMix_EffectFunc_t = procedure(chan: Integer; stream: Pointer; len: Integer; udata: Pointer) cdecl;
302304

303305
{*
304306
* This is a callback that signifies that a channel has finished all its
@@ -310,7 +312,7 @@ procedure Mix_ChannelFinished(channel_finished: TMix_Channel_Finished) cdecl; ex
310312
* DO NOT EVER call SDL_LockAudio() from your callback function!
311313
*}
312314
type
313-
TMix_EffectDone_t = procedure(chan: Integer; udata: Pointer);
315+
TMix_EffectDone_t = procedure(chan: Integer; udata: Pointer) cdecl;
314316

315317
{* Register a special effect function. At mixing time, the channel data is
316318
* copied into a buffer and passed through each registered effect function.
@@ -654,7 +656,7 @@ function Mix_SetSoundFonts(paths: PAnsiChar): Integer cdecl; external MIX_LibNam
654656
function Mix_GetSoundFonts: PAnsiChar cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_GetSoundFonts' {$ENDIF} {$ENDIF};
655657

656658
type
657-
TMix_SoundFunc = function(c: PAnsiChar; p: Pointer): Integer;
659+
TMix_SoundFunc = function(c: PAnsiChar; p: Pointer): Integer cdecl;
658660

659661
function Mix_EachSoundFont(func: TMix_SoundFunc; data: Pointer): Integer cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_EachSoundFont' {$ENDIF} {$ENDIF};
660662

0 commit comments

Comments
 (0)