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 957

Summary: SDL_GetWMInfo return code documented wrong in header
Product: SDL Reporter: Maarten ter Huurne <maarten>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: minor    
Priority: P2    
Version: 1.2.14   
Hardware: All   
OS: All   

Description Maarten ter Huurne 2010-02-20 18:37:22 UTC
In SDL_syswm.h, the documentation for SDL_GetWMInfo() states "If it's not implemented, or the version member of the 'info' structure is invalid, it returns 0."

The doc wiki states "1 if the function is implemented and no error occured, 0 if function is unimplemented, -1 if implemented but a failure occurred."

In SDL_x11wm.c, the implementation of X11_GetWMInfo() returns -1 if the 'info' structure contains a version number larger than the version of the SDL library being called.

Since the doc wiki and the implementation agree, I am assuming the header file gets it wrong. If that is indeed the case, please fix the documentation in the header file. In the mean time, I'm going to assume that any return value greater than 0 means success.
Comment 1 Sam Lantinga 2010-07-18 10:41:41 UTC
This is fixed in revision 3f2d351d8274.  Thanks!