longcongduoi / wvstreams

Automatically exported from code.google.com/p/wvstreams
0 stars 0 forks source link

wvautoconf.h pollutes header files #16

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Find a project that uses WvStreams and also uses Autoconf.
2. In that project's source files, #include the local config.h
3. Also #include a WvStreams header that includes wvautoconf.h (e.g.
wvaddr.h, though most of them end up including it indirectly).

Expected: The project builds with no compiler warnings.
Actual: The compiler complains a lot about redefined preprocessor values,
particularly PACKAGE_NAME, PACKAGE_VERSION, PACKAGE_STRING,
PACKAGE_BUGREPORT, and PACKAGE_TARNAME.  This is because these values are
commonly defined by any project using Autoconf, and wvautoconf.h lets them
slip into the public header files.

The Autoconf book has a more complete description of the problem, and also
describes a way of avoiding it (
http://sources.redhat.com/autobook/autobook/autobook_96.html ) though it's
kind of ugly.

Original issue reported on code.google.com by peter.mc...@gmail.com on 9 Dec 2007 at 11:13

GoogleCodeExporter commented 8 years ago
Luke implemented a partial fix to this problem, renaming PACKAGE_* to 
WVPACKAGE_*
during the build process. Check the mailing list for a more in-depth discussion 
of
this problem (and a better proposed solution, iirc)

Original comment by wrl...@gmail.com on 12 Sep 2008 at 6:50