| Summary: | specify SDLCALL as the calling convention for destructor() callback of SDL_TLSSet() | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Ozkan Sezer <sezeroz> |
| Component: | *don't know* | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
SDLCALL-2 patch
SDLCALL-2a -- SDL_LogOutputFunction SDLCALL-2b SDLCALL-2c -- SDL_blit |
||
This will break ABI and source compatibility with previous SDL releases. > This will break ABI and source compatibility with previous SDL releases.
No, I don't think it will: Addition of SDLCALL will be a nop for
all current targets as specified in begin_code.h, i.e. the existing
status will be still preserved for them.
I don't mind this change, but in order for it to be complete the same would have to be done for the other callbacks in the API. The hint callback, log output callback, etc. Ozkan, would you mind going through and doing a complete update of all the API callbacks to the SDLCALL calling convention? Thanks! Created attachment 2846 [details]
SDLCALL-2a -- SDL_LogOutputFunction
patch to make SDL_LogOutputFunction SDLCALL.
Created attachment 2847 [details]
SDLCALL-2b
patch to make SDL_HintCallback SDLCALL.
Added patches for log and hint callbacks, above. There are SDLTest_TestCase??? callbacks, but I'm not sure whether they need dictating a calling convention (as they are just for devs.) AFAICS, only SDL_surface.h:SDL_blit is left now: I am also taking a closer look at the SDL_BlitFunc() (bug #3746) case to ensure that it was not a mistake to remove SDLCALL from it. Created attachment 2848 [details]
SDLCALL-2c -- SDL_blit
patch to make SDL_blit SDLCALL.
> AFAICS, only SDL_surface.h:SDL_blit is left now: Added patch for it above. Can you see anything I missed or anything I did wrong? > I am also taking a > closer look at the SDL_BlitFunc() (bug #3746) case to ensure that > it was not a mistake to remove SDLCALL from it. AFAICS no, it was not a mistake. Patches are in, thanks! https://hg.libsdl.org/SDL/rev/3db78361e751 |
Created attachment 2835 [details] SDLCALL-2 patch The attached patch specifies SDLCALL as the calling convention for the destructor() callback of SDL_TLSSet(). At present nothing is specified and it is OK for most target/compiler combinations. However, there targets with different compilers who has different default calling conventions (e.g. OS/2 with Watcom and gcc.) So it is important to make it standard, as it is done everywhere else in the SDL tree.