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 - Build warning: 'GetDoubleClickTime' undefined; assuming extern returning int
Summary: Build warning: 'GetDoubleClickTime' undefined; assuming extern returning int
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 2.0.9
Hardware: x86_64 Windows (All)
: P2 minor
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-22 15:46 UTC by Coriiander
Modified: 2019-03-22 15:46 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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