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
..
SDL.h Updated to version 3.1.5 for development 2024-10-09 11:02:01 -07:00
SDL_assert.h Removed SDL_bool in favor of plain bool 2024-09-18 08:32:30 -07:00
SDL_atomic.h Removed tabs from headers 2024-09-21 10:39:53 -07:00
SDL_audio.h Sync SDL3 wiki -> header 2024-10-02 19:28:35 +00:00
SDL_begin_code.h Remove SDL_RESTRICT in favor of doc comments 2024-09-09 13:51:16 -07:00
SDL_bits.h explicit cast to int in SDL_bits 2024-10-11 18:52:06 -07:00
SDL_blendmode.h
SDL_camera.h Sync SDL3 wiki -> header 2024-10-10 00:32:39 +00:00
SDL_clipboard.h Minor cleanup 2024-09-27 14:10:46 -07:00
SDL_close_code.h
SDL_copying.h
SDL_cpuinfo.h Sync SDL3 wiki -> header 2024-09-18 15:33:11 +00:00
SDL_dialog.h Sync SDL3 wiki -> header 2024-09-27 21:11:58 +00:00
SDL_egl.h
SDL_endian.h
SDL_error.h Added missing parentheses 2024-10-04 13:27:13 -07:00
SDL_events.h Update some window function documentation 2024-10-08 13:05:20 -04:00
SDL_filesystem.h filesystem: SDL_EnumerateDirectoryCallback uses an enum now, not an int. 2024-09-28 01:33:40 -04:00
SDL_gamepad.h Sync SDL3 wiki -> header 2024-09-18 15:33:11 +00:00
SDL_gpu.h Sync SDL3 wiki -> header 2024-10-10 23:35:37 +00:00
SDL_guid.h Remove unused includes. This only removes includes that aren't used at all, not even in comments. 2024-09-08 17:11:23 -07:00
SDL_haptic.h Sync SDL3 wiki -> header 2024-09-18 15:33:11 +00:00
SDL_hidapi.h Removed SDL_bool in favor of plain bool 2024-09-18 08:32:30 -07:00
SDL_hints.h Set hint SDL_HINT_MAC_SCROLL_MOMENTUM version to SDL 3.1.4. 2024-10-11 17:33:52 -07:00
SDL_init.h Sync SDL3 wiki -> header 2024-10-04 20:27:58 +00:00
SDL_intrin.h
SDL_iostream.h Add properties to SDL_IOStreams returned by IOFromMem 2024-10-02 22:09:09 -07:00
SDL_joystick.h Removed SDL_IPHONE_MAX_GFORCE 2024-10-01 18:00:22 -07:00
SDL_keyboard.h Sync SDL3 wiki -> header 2024-10-08 13:59:10 +00:00
SDL_keycode.h Use hexidecimal code for ± 2024-09-21 10:43:34 -07:00
SDL_loadso.h Sync SDL3 wiki -> header 2024-10-01 16:16:44 +00:00
SDL_locale.h
SDL_log.h Sync SDL3 wiki -> header 2024-09-18 15:33:11 +00:00
SDL_main.h Fix SDL_MAIN_USE_CALLBACKS with Android, introduce SDL_MAIN_EXPORTED 2024-10-11 18:54:29 -07:00
SDL_main_impl.h Fix SDL_MAIN_USE_CALLBACKS with Android, introduce SDL_MAIN_EXPORTED 2024-10-11 18:54:29 -07:00
SDL_messagebox.h Sync SDL3 wiki -> header 2024-09-18 15:33:11 +00:00
SDL_metal.h
SDL_misc.h Sync SDL3 wiki -> header 2024-09-18 15:33:11 +00:00
SDL_mouse.h Sync SDL3 wiki -> header 2024-10-04 16:14:38 +00:00
SDL_mutex.h Added header for SDL_ThreadID type 2024-09-27 08:16:49 -07:00
SDL_oldnames.h Remove vestiges of the TAKE_FOCUS window event 2024-10-06 10:02:53 -04:00
SDL_opengl.h
SDL_opengl_glext.h Renamed Gpu to GPU 2024-08-29 17:33:52 -07:00
SDL_opengles.h
SDL_opengles2.h
SDL_opengles2_gl2.h
SDL_opengles2_gl2ext.h
SDL_opengles2_gl2platform.h
SDL_opengles2_khrplatform.h
SDL_pen.h pen: Corrected some documentation. 2024-10-01 10:24:17 -04:00
SDL_pixels.h Move default colorspace aliases into enum 2024-09-23 07:37:02 -07:00
SDL_platform.h
SDL_platform_defines.h SDL_platform_defines.h: Added documentation, and a little whitespace. 2024-09-06 15:09:29 -04:00
SDL_power.h
SDL_process.h Sync SDL3 wiki -> header 2024-10-04 19:50:14 +00:00
SDL_properties.h Fix typo: DiretMedia->DirectMedia 2024-10-05 00:08:01 -04:00
SDL_rect.h Sync SDL3 wiki -> header 2024-10-04 20:24:40 +00:00
SDL_render.h render: Restore previous policy for converting window/render coordinates. 2024-10-03 16:31:56 -04:00
SDL_revision.h
SDL_scancode.h Changed enums to use XXX_COUNT for the count or number of values 2024-09-11 09:32:17 -07:00
SDL_sensor.h Sync SDL3 wiki -> header 2024-09-18 15:33:11 +00:00
SDL_stdinc.h Sync SDL3 wiki -> header 2024-10-10 16:43:29 +00:00
SDL_storage.h include: Small clarification on directory enumeration documentation. 2024-09-26 16:39:35 -04:00
SDL_surface.h Sync SDL3 wiki -> header 2024-10-04 20:38:03 +00:00
SDL_system.h Add `SDL_IsTV()` (#11004) 2024-10-01 09:20:00 -07:00
SDL_test.h
SDL_test_assert.h SDL_test: use SDLCALL calling convention 2024-09-06 14:19:05 +02:00
SDL_test_common.h Don't use const for non-pointer API parameters 2024-10-02 09:17:31 -04:00
SDL_test_compare.h SDL_test: use SDLCALL calling convention 2024-09-06 14:19:05 +02:00
SDL_test_crc32.h Updated check for stdbool.h 2024-09-28 16:55:09 -07:00
SDL_test_font.h Removed SDL_bool in favor of plain bool 2024-09-18 08:32:30 -07:00
SDL_test_fuzzer.h Removed SDL_bool in favor of plain bool 2024-09-18 08:32:30 -07:00
SDL_test_harness.h SDL_test: add include for SDLTest_CommonState 2024-09-06 14:23:08 +02:00
SDL_test_log.h SDL_test: add SDLTest_LogEscapedString 2024-09-13 20:52:32 +02:00
SDL_test_md5.h SDL_test: whitespace header fixes 2024-09-06 14:19:05 +02:00
SDL_test_memory.h Updated check for stdbool.h 2024-09-28 16:55:09 -07:00
SDL_thread.h Sync SDL3 wiki -> header 2024-10-04 15:58:03 +00:00
SDL_time.h Sync SDL3 wiki -> header 2024-09-18 15:33:11 +00:00
SDL_timer.h Sync SDL3 wiki -> header 2024-10-10 16:43:29 +00:00
SDL_touch.h Remove unused includes. This only removes includes that aren't used at all, not even in comments. 2024-09-08 17:11:23 -07:00
SDL_version.h Updated to version 3.1.5 for development 2024-10-09 11:02:01 -07:00
SDL_video.h Sync SDL3 wiki -> header 2024-10-10 15:24:38 +00:00
SDL_vulkan.h docs: Wrote CategoryVulkan. 2024-10-04 16:55:50 -04:00