We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4560

Summary: Build warning: 'GetDoubleClickTime' undefined; assuming extern returning int
Product: SDL Reporter: Coriiander <coriiander>
Component: eventsAssignee: Sam Lantinga <slouken>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: minor    
Priority: P2    
Version: 2.0.9   
Hardware: x86_64   
OS: Windows (All)   

Description Coriiander 2019-03-22 15:46:45 UTC
FILE: SDL2-2.0.9\src\events\SDL_mouse.c
FUNCTION: SDL_MouseDoubleClickTimeChanged

For Win32-platforms this function makes a call to GetDoubleClickTime, as below:

#ifdef __WIN32__
mouse->double_click_time = GetDoubleClickTime();
#else

While building a warning is issued about the GetDoubleClickTime symbol not being defined - which may lead to undefined behaviour, including crashes.

To use GetDoubleClickTime include <windows.h> and link to user32.lib.
You can do so at the top of the file:

#ifdef __WIN32__
#include <windows.h> /* Needed for GetDoubleClickTime. Cheers Coriiander! */
#endif