Update switch/SDL_systimer.c; fix Switch link issues

This commit is contained in:
Luke Street 2022-06-02 00:41:19 -04:00
parent 0ed3a52d9f
commit 34458fe9f4
2 changed files with 9 additions and 8 deletions

View File

@ -939,7 +939,7 @@ if(SDL_LIBC)
check_symbol_exists("${_FN}" "math.h" ${_HAVEVAR})
endforeach()
set(CMAKE_REQUIRED_LIBRARIES)
if(NOT VITA)
if(NOT VITA AND NOT NINTENDO_SWITCH)
list(APPEND EXTRA_LIBS m)
endif()
endif()
@ -2597,18 +2597,18 @@ elseif(NINTENDO_SWITCH)
set(SOURCE_FILES ${SOURCE_FILES} ${SWITCH_VIDEO_SOURCES})
set(HAVE_SDL_VIDEO TRUE)
set(SDL_VIDEO_OPENGL_EGL 1)
set(HAVE_VIDEO_OPENGLES TRUE)
set(HAVE_OPENGLES TRUE)
set(SDL_VIDEO_OPENGL_ES2 1)
set(SDL_VIDEO_RENDER_OGL_ES2 1)
set(SDL_VIDEO_OPENGL 1)
set(HAVE_VIDEO_OPENGL TRUE)
set(HAVE_OPENGL TRUE)
endif()
set(SDL_STATIC_PIC ON)
list(APPEND EXTRA_LIBS EGL glapi drm_nouveau nx m)
list(APPEND EXTRA_LIBS EGL glapi drm_nouveau)
add_definitions(-DSDL_VIDEO_STATIC_ANGLE)
set(HAVE_CLOCK_GETTIME 1)
set(PTHREADS ON)
set(PTHREADS_SEM ON)
set(SDL_PTHREADS ON)
set(SDL_PTHREADS_SEM ON)
CheckPTHREAD()
endif()

View File

@ -45,13 +45,14 @@ SDL_TicksQuit(void)
started = false;
}
Uint32 SDL_GetTicks(void)
Uint64
SDL_GetTicks64(void)
{
if (!started) {
SDL_TicksInit();
}
return (Uint32) ((SDL_GetPerformanceCounter() - start) * 1000 / SDL_GetPerformanceFrequency());
return (SDL_GetPerformanceCounter() - start) * 1000 / SDL_GetPerformanceFrequency();
}
Uint64