mirror of https://github.com/libsdl-org/SDL.git
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 |
||
|---|---|---|
| .. | ||
| SDL.h | ||
| SDL_assert.h | ||
| SDL_atomic.h | ||
| SDL_audio.h | ||
| SDL_begin_code.h | ||
| SDL_bits.h | ||
| SDL_blendmode.h | ||
| SDL_camera.h | ||
| SDL_clipboard.h | ||
| SDL_close_code.h | ||
| SDL_copying.h | ||
| SDL_cpuinfo.h | ||
| SDL_dialog.h | ||
| SDL_egl.h | ||
| SDL_endian.h | ||
| SDL_error.h | ||
| SDL_events.h | ||
| SDL_filesystem.h | ||
| SDL_gamepad.h | ||
| SDL_gpu.h | ||
| SDL_guid.h | ||
| SDL_haptic.h | ||
| SDL_hidapi.h | ||
| SDL_hints.h | ||
| SDL_init.h | ||
| SDL_intrin.h | ||
| SDL_iostream.h | ||
| SDL_joystick.h | ||
| SDL_keyboard.h | ||
| SDL_keycode.h | ||
| SDL_loadso.h | ||
| SDL_locale.h | ||
| SDL_log.h | ||
| SDL_main.h | ||
| SDL_main_impl.h | ||
| SDL_messagebox.h | ||
| SDL_metal.h | ||
| SDL_misc.h | ||
| SDL_mouse.h | ||
| SDL_mutex.h | ||
| SDL_oldnames.h | ||
| SDL_opengl.h | ||
| SDL_opengl_glext.h | ||
| 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 | ||
| SDL_pixels.h | ||
| SDL_platform.h | ||
| SDL_platform_defines.h | ||
| SDL_power.h | ||
| SDL_process.h | ||
| SDL_properties.h | ||
| SDL_rect.h | ||
| SDL_render.h | ||
| SDL_revision.h | ||
| SDL_scancode.h | ||
| SDL_sensor.h | ||
| SDL_stdinc.h | ||
| SDL_storage.h | ||
| SDL_surface.h | ||
| SDL_system.h | ||
| SDL_test.h | ||
| SDL_test_assert.h | ||
| SDL_test_common.h | ||
| SDL_test_compare.h | ||
| SDL_test_crc32.h | ||
| SDL_test_font.h | ||
| SDL_test_fuzzer.h | ||
| SDL_test_harness.h | ||
| SDL_test_log.h | ||
| SDL_test_md5.h | ||
| SDL_test_memory.h | ||
| SDL_thread.h | ||
| SDL_time.h | ||
| SDL_timer.h | ||
| SDL_touch.h | ||
| SDL_version.h | ||
| SDL_video.h | ||
| SDL_vulkan.h | ||