From 4f52c04b3b81ef426b7ab60b7618ab0e3997fc5a Mon Sep 17 00:00:00 2001 From: BjossiAlfreds Date: Sat, 26 Oct 2024 19:56:02 +0000 Subject: [PATCH] Small fix for SDL3 API change for SetClipboardText --- src/client/input/sdl2.c | 5 ++++- src/client/input/sdl3.c | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/client/input/sdl2.c b/src/client/input/sdl2.c index 992d1a88..ed2a28f9 100644 --- a/src/client/input/sdl2.c +++ b/src/client/input/sdl2.c @@ -2441,8 +2441,11 @@ IN_GetClipboardText(char *out, size_t n) SDL_free(s); } +/* Copy string s to the clipboard. + Returns 0 on success, 1 otherwise. +*/ int IN_SetClipboardText(const char *s) { - return SDL_SetClipboardText(s); + return SDL_SetClipboardText(s) != 0; } diff --git a/src/client/input/sdl3.c b/src/client/input/sdl3.c index 52b97535..2bee5218 100644 --- a/src/client/input/sdl3.c +++ b/src/client/input/sdl3.c @@ -2437,8 +2437,13 @@ IN_GetClipboardText(char *out, size_t n) SDL_free(s); } +/* Copy string s to the clipboard. + Returns 0 on success, 1 otherwise. +*/ int IN_SetClipboardText(const char *s) { - return SDL_SetClipboardText(s); + bool res = SDL_SetClipboardText(s); + + return !res; }