diff options
author | Sam Lantinga <slouken@libsdl.org> | 2018-08-09 16:00:17 -0700 |
---|---|---|
committer | Sam Lantinga <slouken@libsdl.org> | 2018-08-09 16:00:17 -0700 |
commit | 6fc6bfca0277f18d61a4ef071151ed41401c70f6 (patch) | |
tree | 0cf1a7fce1d1e005bb903e6858e013f13bebeb88 /src/stdlib | |
parent | 6c65dfa2ec6649b125881ce422506fcb38af8c5b (diff) | |
download | sdl-6fc6bfca0277f18d61a4ef071151ed41401c70f6.tar.gz |
Added HIDAPI joystick drivers for more consistent support for Xbox, PS4 and Nintendo Switch Pro controller support across platforms.
Added SDL_GameControllerRumble() and SDL_JoystickRumble() for simple force feedback outside of the SDL haptics API
Diffstat (limited to 'src/stdlib')
-rw-r--r-- | src/stdlib/SDL_string.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c index 5cbcc4bba..22aceedb1 100644 --- a/src/stdlib/SDL_string.c +++ b/src/stdlib/SDL_string.c @@ -416,6 +416,17 @@ SDL_strlen(const char *string) #endif /* HAVE_STRLEN */ } +wchar_t * +SDL_wcsdup(const wchar_t *string) +{ + size_t len = ((SDL_wcslen(string) + 1) * sizeof(wchar_t)); + wchar_t *newstr = (wchar_t *)SDL_malloc(len); + if (newstr) { + SDL_memcpy(newstr, string, len); + } + return newstr; +} + size_t SDL_wcslen(const wchar_t * string) { @@ -562,7 +573,7 @@ char * SDL_strdup(const char *string) { size_t len = SDL_strlen(string) + 1; - char *newstr = SDL_malloc(len); + char *newstr = (char *)SDL_malloc(len); if (newstr) { SDL_memcpy(newstr, string, len); } |