|
From: Maurice L. <mj...@ga...> - 2002-12-24 21:20:03
|
Maurice LeBrun writes:
> Although I fixed the include guards in acconfig.h, because of the way
> autoheader works they're still broken in include/plConfig.h{,.in}. Anyone
> know of a way to properly handle these?
>
> (i.e. the #endif should be the very last statement to protect against
> multiple inclusions)
Sigh..
We now have several new problems with the autoconf-generated header files
in addition to the old one (#1 below).
1. User codes that include plplot.h really shouldn't necessarily be exposed to
all the details of the configuration process. I looked into this issue
previously but never got back to it. I think all configuration related
defines should default to private, i.e. not be visible when including
plplot.h. The public ones would only be those we specifically decide to
export like PACKAGE, VERSION, PL_DOUBLE, etc. The problem has gotten worse
than the last time I looked at it because of many new autoconf tests. I
really don't like the idea of injecting all these defines into the global
namespace.
2. Include guards on plConfig.h are broken.
3. acconfig.h now has device defines in addition to the more customary
configuration defines, so these device defines now appear in *both* plDevs.h
and plConfig.h, which is superfluous. Maybe not harmful, at least.
4. autoheader's obnoxious warning, and the real possibility the "file
template" style will go away some day.
On the severity scale, 3 & 4 are mostly just irritants, but could probably be
made to go away easily enough in the course of fixing numbers 1 & 2.
For the solution, I'm envisioning 3 include files:
plConfigP.h plConfig.h plDevs.h
none of which are autoconf-generated. These are the only files that may be
included by plplot codes, and each has include guards. Each include an
autoconf-generated header file with a specific subset of the entire set
of defines according to the following rule set:
- the default set goes to the file included by plConfigP.h
- the publicly-exported set goes to the file included by plConfig.h
- the device set goes to the file included by plDevs.h
Still need names for all these autoconf-generated headers. Use 3rd
arg of AC_DEFINE* to create assuming the autoconf API will cooperate.
Need to find out what autoconf's support this feature.
This will address all 4 points.
I may get the time to work on this before the release but am mostly writing
all this down as a reminder as to what should eventually be fixed.
--
Maurice LeBrun mj...@ga...
Research Organization for Information Science and Technology of Japan (RIST)
|