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 525 - SDL public headers contain non SDL_ prefixed autoconf defines
Summary: SDL public headers contain non SDL_ prefixed autoconf defines
Status: RESOLVED WONTFIX
Alias: None
Product: SDL
Classification: Unclassified
Component: main (show other bugs)
Version: 1.2.9
Hardware: x86 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: target-1.2.14
Depends on:
Blocks:
 
Reported: 2007-12-21 04:01 UTC by Hans de Goede
Modified: 2009-09-21 04:20 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 Hans de Goede 2007-12-21 04:01:24 UTC
While building a package for Fedora today I got lots and lots of these warnings
during the build:
/usr/include/SDL/SDL_config-i386.h:67:1: warning: "HAVE_STDLIB_H" redefined

In general it is considered bad to have HAVE_FOO autoconf defines in public headers as they might conflict with defines from config.h from the package being build.
Comment 1 Sam Lantinga 2007-12-29 14:05:16 UTC
I'll have to address this post SDL 1.2.13, since this is a fairly central part of the build process right now.
Comment 2 Ryan C. Gordon 2009-09-13 16:33:27 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 3 Sam Lantinga 2009-09-21 00:52:53 UTC
Do you have any suggestions on the recommended way to fix this?  I could wrap each of those defines with ifndef, but that seems like kind of a hack.
Comment 4 Hans de Goede 2009-09-21 01:06:54 UTC
One of the ways to fix this, and IMHO the best, is to split SDL_config.h.in into
2 files a classic autoconf.h.in, which only gets used during build and an SDL_config.h.in, which also gets installed under /usr/include

As many defines as possible should go to the autoconf.h.in, leaving only those
needed by the public headers in SDL_config.h.in (and those should all be SDL_
prefixed).

An even better option would be if the public headers could be made to just not
depend on any foo.h.in at all, this also saves some headaches on multilib systems.
Comment 5 Sam Lantinga 2009-09-21 01:47:30 UTC
I'm nervous about making a change of that magnitude and getting it right.  Would you be willing to take a crack at it?
Comment 6 Hans de Goede 2009-09-21 03:34:34 UTC
Erm,

I'm not that good with autofoo myself I must admit. I guess this is best left
unresolved for 1.2.14, would be very nice to get this fixed in the 1.3 branch though.
Comment 7 Sam Lantinga 2009-09-21 04:20:30 UTC
Okay, sounds good.  Feel free to take a poke at it for 1.3 if you like.

Thanks!