bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnulib] config.h (was: Re: getopt trouble on uClibc systems)


From: Simon Josefsson
Subject: [Bug-gnulib] config.h (was: Re: getopt trouble on uClibc systems)
Date: Thu, 01 Jul 2004 17:38:58 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Simon Josefsson <address@hidden> writes:

>> If you don't want gnulib in your libraries, but you do want it in your
>> library, then I'm afraid you need to have a different config.h for
>> your command-line interface than you do for your library -- at least
>> if you use the part of gnulib that redefines symbols like 'malloc'.  I
>> don't see an easy way around this problem.
>
> I'm doing this in one project, but having two config.h complicates
> things.  I haven't tried it, but merely renaming one of the config.h
> to, e.g., cfg.h would probably be as complicated, since "config.h" is
> hard coded all over the place.

Incidentally, I noticed this in argz.c:

/* Provide our wierdo HAVE_CONFIG_H rvalue for other clients.  */
#if !defined(LTDL) && defined(HAVE_CONFIG_H)
#  define HAVE_CONFIG_H <config.h>
#endif

#if defined(HAVE_CONFIG_H)
#  include HAVE_CONFIG_H
#endif

This seem to suggest a solution to avoid hard coding the "config.h"
filename.  Perhaps '#include CONFIG_H' is more name space clean,
though.  Something like:

#ifdef HAVE_CONFIG_H
# ifndef CONFIG_H
#  define CONFIG_H <config.h>
# endif
#  include CONFIG_H
#endif

But I wonder if this is really portable CPP?

Further, I doubt if the benefit outweigh the cost of changing all
files.

In other words: I'm not proposing to do this, unless someone really
find the idea useful and argue for it.  But it seemed like a neat
idea, and in some projects it might be worthwhile to explore it.

Thanks,
Simon





reply via email to

[Prev in Thread] Current Thread [Next in Thread]