[ghemical-devel] Private configure tokens in public headers

Daniel Macks dmacks at netspace.org
Thu Oct 19 22:00:56 EDT 2006


When I #include the public headers for libghemical-2.10, I wind up
polluting my namespace with lots of #define tokens that seems like
they should be restricted to libghemical's own source-building
process. For example, why should "a library that links against
libghemical" see:

/* This is the version of libghemical to be built--it is set in the
   configure.ac */
#define LIBVERSION "2.10"

(from from libghemicalconfig2.h)? It's the library version of
libghemical, not of the library being built against it. The token name
is generic enough that it's likely to conflict with my own library's
tokens. Likewise, all the autoconf tokens at best cause a slew of
redefined warnings due to my own config.h also having them.

Executive summary: restrict header things that are used by the
libghemical build process to being private to the build process.  For
example, have the libghemical sources #include libghemicalconfig2.h
directly instead of having libghemicaldefine.h #include it, and don't
install the config header publicly.

dan

-- 
Daniel Macks
dmacks at netspace.org
http://www.netspace.org/~dmacks



More information about the ghemical-devel mailing list