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 993 - Definition of symbol NONAMELESSUNION causes trouble
Summary: Definition of symbol NONAMELESSUNION causes trouble
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 1.2.14
Hardware: All Windows (All)
: P2 blocker
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-23 15:43 UTC by Volker Grabsch
Modified: 2010-07-18 11:44 UTC (History)
0 users

See Also:


Attachments
remove the trouble causing definition of NONAMELESSUNION (463 bytes, patch)
2010-04-25 01:14 UTC, Volker Grabsch
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Grabsch 2010-04-23 15:43:14 UTC
The windx5 video driver defines the NONAMELESSUNION symbol before including <ddraw.h>, but only if __GNUC__ is defined:

#ifdef __GNUC__
#define NONAMELESSUNION
#endif

This is simply not necessary, as the GNU compilers already supports unnamed unions.

Moreover, defining this symbol even causes trouble in some MinGW configurations, depending on which set of DirectX headers one uses.

There are some sets that requires NONAMELESSUNION to be defined before the first "#include <windows.h>", not just before the first "#include <ddraw.h>". In those cases, the rest of SDL will compile under the assumption that unions are named, but the headers still define unnamed unions, which leads to compiling errors. Recently, that caused a lot of trouble in the mingw-cross-env project.

Long story short: Defining NONAMELESSUNION is unneeded and does more harm than good, so I recommend to remove it.

The attached patch does exactly that.
Comment 1 Volker Grabsch 2010-04-25 01:14:50 UTC
Created attachment 507 [details]
remove the trouble causing definition of NONAMELESSUNION
Comment 2 Sam Lantinga 2010-07-18 10:51:58 UTC
This is fixed in revision 134c6707b767, thanks!