Do any SDL functions use stdcall calling convention, or are they all cdecl?

And does it depend on platform?

I assume everything uses the standard C convention, so cdecl, but I haven’t been able to find any documentation confirming.

According to SDL_begin_code.h, SDL uses the standard C calling convention for whichever platform/compiler you’re using.

It specifically defines SDLCALL as __cdecl on Windows.

/* By default SDL uses the C calling convention */
#ifndef SDLCALL
#if (defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)) && !defined(__GNUC__)
#define SDLCALL __cdecl
#define SDLCALL
#endif /* SDLCALL */
1 Like