Skip to content

Commit

Permalink
add ifdefs to avoid unnecessary 64bit strtoull() in win32 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Mar 24, 2018
1 parent db8ae75 commit 460d095
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/video/windib/SDL_dibevents.c
Expand Up @@ -654,8 +654,10 @@ int DIB_CreateWindow(_THIS)
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, windowid, -1, windowid_t, SDL_strlen(windowid) + 1);
SDL_Window = (HWND)wcstol(windowid_t, NULL, 0);
SDL_free(windowid_t);
#elif defined(_WIN64)
SDL_Window = (HWND)SDL_strtoull(windowid, NULL, 0);
#else
SDL_Window = (HWND)((size_t)SDL_strtoull(windowid, NULL, 0));
SDL_Window = (HWND)SDL_strtoul(windowid, NULL, 0);
#endif
if ( SDL_Window == NULL ) {
SDL_SetError("Couldn't get user specified window");
Expand Down
6 changes: 5 additions & 1 deletion src/video/windx5/SDL_dx5events.c
Expand Up @@ -947,7 +947,11 @@ int DX5_CreateWindow(_THIS)

SDL_windowid = (windowid != NULL);
if ( SDL_windowid ) {
SDL_Window = (HWND)((size_t)SDL_strtoull(windowid, NULL, 0));
#ifdef _WIN64
SDL_Window = (HWND)SDL_strtoull(windowid, NULL, 0);
#else
SDL_Window = (HWND)SDL_strtoul(windowid, NULL, 0);
#endif
if ( SDL_Window == NULL ) {
SDL_SetError("Couldn't get user specified window");
return(-1);
Expand Down

0 comments on commit 460d095

Please sign in to comment.