Skip to content

Commit

Permalink
Small fix for SDL3 API change for SetClipboardText
Browse files Browse the repository at this point in the history
  • Loading branch information
BjossiAlfreds committed Oct 26, 2024
1 parent 07ee830 commit 4f52c04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/client/input/sdl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
7 changes: 6 additions & 1 deletion src/client/input/sdl3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 4f52c04

Please sign in to comment.