Skip to content

Commit b78cc37

Browse files
committed
Backends: SDL2: Fixed build for versions older than 2.0.14. (ocornut#7660)
1 parent a931fb7 commit b78cc37

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backends/imgui_impl_sdl2.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
#define SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE 0
117117
#endif
118118
#define SDL_HAS_VULKAN SDL_VERSION_ATLEAST(2,0,6)
119+
#define SDL_HAS_OPEN_URL SDL_VERSION_ATLEAST(2,0,14)
119120
#if SDL_HAS_VULKAN
120121
#include <SDL_vulkan.h>
121122
#endif
@@ -481,7 +482,7 @@ static bool ImGui_ImplSDL2_Init(SDL_Window* window, SDL_Renderer* renderer, void
481482
platform_io.Platform_SetImeDataFn = ImGui_ImplSDL2_PlatformSetImeData;
482483
#ifdef __EMSCRIPTEN__
483484
platform_io.Platform_OpenInShellFn = [](ImGuiContext*, const char* url) { ImGui_ImplSDL2_EmscriptenOpenURL(url); return true; };
484-
#else
485+
#elif SDL_HAS_OPEN_URL
485486
platform_io.Platform_OpenInShellFn = [](ImGuiContext*, const char* url) { return SDL_OpenURL(url) == 0; };
486487
#endif
487488

0 commit comments

Comments
 (0)