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 613 - GetObject redefined as GetObjectA by wingdi.h
Summary: GetObject redefined as GetObjectA by wingdi.h
Status: RESOLVED WONTFIX
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 1.2
Hardware: x86 Windows (All)
: P2 minor
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: target-1.2.14
Depends on:
Blocks:
 
Reported: 2008-08-13 04:09 UTC by jellegeerts
Modified: 2009-09-21 01:57 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 jellegeerts 2008-08-13 04:09:09 UTC
SDL_opengl.h includes windows.h. The windows.h header includes wingdi.h which has #define GetObject GetObjectA. The wingdi.h header I'm talking about is from MinGW 3.4.5.

I have a method in a class of mine that I call GetObject. In the class definition I do not include SDL_opengl.h (so GetObject is not redefined as GetObjectA). However, somewhere else I do include SDL_opengl.h and am trying to call my GetObject() method. This fails with "error: 'class SomeClass' has no member named 'GetObjectA'".

Of course it would be a bit hard to #undef everything that the windows headers define, but one who uses SDL should be able to use GetObject as method name, I think?

I'm not sure what is the best solution to this problem.
Comment 1 Ryan C. Gordon 2009-09-13 16:33:36 UTC
Tagging this bug with "target-1.2.14" so we can try to resolve it for SDL 1.2.14.

Please note that we may choose to resolve it as WONTFIX. This tag is largely so we have a comprehensive wishlist of bugs to examine for 1.2.14 (and so we can close bugs that we'll never fix, rather than have them live forever in Bugzilla).

--ryan.
Comment 2 Sam Lantinga 2009-09-21 01:57:27 UTC
There's not a lot we can do about that.  SDL_opengl.h needs to include <windows.h>, although it tries to include the minimal functionality there.