Files
SDL/include/SDL3
Daniel Gibson 33366b0a4e Fix SDL_MAIN_USE_CALLBACKS with Android, introduce SDL_MAIN_EXPORTED
My simplification of the conditions for including SDL_main_impl.h
had one problem: I forgot that SDL_main_impl.h must be included
even on Android when SDL_MAIN_USE_CALLBACKS is used, because then a
SDL_main() function that makes sure the callbacks get called is needed,
and that function is implemented in SDL_main_impl.h

But OTOH, even when SDL_MAIN_USE_CALLBACKS is used, SDL_main_impl.h
should not implement a standard `int main(...)` function on Android
(because there the SDL-using native code is compiled as a library and
 the entry point is in SDLActivity.java, which calls SDL_main()
 in said library).

So the check for platforms that don't have *any* native main function
but just SDL_main() called from the outside should be handled in
SDL_main_impl.h, so both the normal and the callback case can avoid
generating a standard main() in the same way.
To do this, SDL_MAIN_EXPORTED is defined for platforms like Android,
where the real entry point (main() function) is outside of the code
that uses SDL, so
- SDL_main() must be visibly exported with SDL_DECLSPEC, so the outside
  code can call it
- SDL_main_impl.h must not implement a "real" main() function

Another small change based on this is defining SDLMAIN_DECLSPEC
at a more general place.

If another platform like Android (where the entry point is somewhere
else entirely, possibly implemented in a different programming language)
turns up, defining SDL_MAIN_NEEDED (so the users main() is renamed
to SDL_main()) and SDL_MAIN_EXPORTED should be all that's needed on the
SDL_main.h side - and if not then at least the implementation is
cleaner and clearer now, IMHO.

fixes #11162
2024-10-11 18:54:29 -07:00
..
2024-09-21 10:39:53 -07:00
2024-10-02 19:28:35 +00:00
2024-10-11 18:52:06 -07:00
2024-10-10 00:32:39 +00:00
2024-09-27 14:10:46 -07:00
2024-09-18 15:33:11 +00:00
2024-09-27 21:11:58 +00:00
2024-10-04 13:27:13 -07:00
2024-09-18 15:33:11 +00:00
2024-10-10 23:35:37 +00:00
2024-09-18 15:33:11 +00:00
2024-10-04 20:27:58 +00:00
2024-10-01 18:00:22 -07:00
2024-10-08 13:59:10 +00:00
2024-09-21 10:43:34 -07:00
2024-10-01 16:16:44 +00:00
2024-07-28 07:24:21 -07:00
2024-09-18 15:33:11 +00:00
2024-09-18 15:33:11 +00:00
2024-09-18 15:33:11 +00:00
2024-10-04 16:14:38 +00:00
2024-09-27 08:16:49 -07:00
2024-08-29 17:33:52 -07:00
2024-10-01 10:24:17 -04:00
2024-05-17 17:09:09 -07:00
2024-10-04 19:50:14 +00:00
2024-10-04 20:24:40 +00:00
2024-09-18 15:33:11 +00:00
2024-10-10 16:43:29 +00:00
2024-10-04 20:38:03 +00:00
2024-10-01 09:20:00 -07:00
2024-09-28 16:55:09 -07:00
2024-09-28 16:55:09 -07:00
2024-10-04 15:58:03 +00:00
2024-09-18 15:33:11 +00:00
2024-10-10 16:43:29 +00:00
2024-10-10 15:24:38 +00:00
2024-10-04 16:55:50 -04:00
2024-10-09 11:02:01 -07:00