Re[2]: [Gc] Dependency tracking for configuration macros

Ivan Maidanski ivmai at
Thu May 21 09:03:26 PDT 2009


Petter Urkedal <urkedal at> wrote:
> On 2009-05-21, Ivan Maidanski wrote:
> > Hi!
> > 
> > Petter Urkedal <urkedal at> wrote:
> > > On 2009-05-20, Ivan Maidanski wrote:
> ...
> I probably shouldn't have brought this up.  The config.h macros can be useful when inlined code or type definitions depend on system-specific features or feature/tuning parameters decided by ./configure.  However,
the libgc public headers use system/compiler-specific predefined
constants rather than feature-tests.  Since also the main GC API has
little inlining and few datastructures, config.h-dependencies seems to
be avoidable.
> > The other Q: are You going to make this 'public' config auto-gen'ed by GC too? Otherwise, it's not clear how this would be looking in the client code:
> > 
> > #include "my_app_config.h"
> > #define I_HAVE_CUSTOM_GC_API_CONFIG /* looks a bit ugly here */
> > #include "gc.h"
> > 
> > If we move "define I_HAVE_..."  to my_app_config then the Q: isn't that easy to just have "include my_gc_config.h" in it ("my_app_config.h") instead (or directly have "define GC_THREADS"... unless you have a standalone cfg script for the gc API in your app)?
> I'm not sure whether I understood the question, but config.h should only
> contain definitions which are decided once and for all by ./configure.
> If there are feature-macros which the client can #define to tweak the
> API, then they don't belong in config.h.

Miscommunicating a bit...
The above code is for gc.h (or gc_config_macros.h) containing (as I understood what You suggest):

/* define it (before including gc.h or friends) if your app has this config file */
#include "gc_api_config.h"

As You wrote above "config.h-dependencies seems to be avoidable", the question is closed (again, if I understood that right).

> Petter


More information about the Gc mailing list