This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: imacros


   From: Andreas Jaeger <aj@arthur.rhein-neckar.de>
   Date: 22 Jun 1999 08:29:22 +0200

   >>>>> Andreas Jaeger writes:

   >>>>> Ulrich Drepper writes:
   >> I've reverted the imacro change introduced by one of Zack's patches.
   >> It simply has too many weird effects.  E.g., while compiling rpcinfo.c
   >> the macro __GNU_LIBRARY__ was not defined.  This should not happen.

   Andreas> You only reverted part of it.  As far as I understand the
   Andreas> issues, the problem of not defining __GNU_LIBRARY__ is the
   Andreas> missing inclusion of <features.h> in libc-symbols.h.
   Andreas> <features.h> was indirectly included via libintl.h and you
   Andreas> only reverted the Makeconfig part:

   Andreas> 1999-06-18  Zack Weinberg  <zack@rabi.columbia.edu>

   Andreas>         * include/libintl.h: Declare _libc_intl_domainname here.
   Andreas>         Define _ and N_ here.
   Andreas>         * include/libc-symbols.h: Don't include <libintl.h>.  Don't
   Andreas>         define _ and N_.  Don't declare _libc_intl_domainname.
   Andreas>         * Makeconfig (CPPFLAGS): Use -imacros to read libc-symbols.h.

   Andreas> I just looked at rpcinfo and it still has __GNU_LIBRARY__
   Andreas> not defined when including getopt.h.

   Here's a patch to implement my suggestions.

   1999-06-22  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	   * include/libc-symbols.h: Include <features.h> to fix some
	   problems with the 1999-06-18 change (undefined __GNU_LIBRARY__).

The real problem is that <getopt.h> makes use of the feature test
macro's but does not include <features.h> itself.  We cannot include
<features.h> since <getopt.h> is shared with other GNU programs.  We
could include <stdio.h> from <getopt.h>.  I don't think that would
cause any problems, since both getopt.c and getpt1.c already include
<stdio.h>.

If there are serious objections against including <stdio.h>, we could
also move the inclusion of <getopt.h> from rpcinfo.c further down or
remove it altogether.

Alternativey (if we want to keep the differences with the origional
Sun RPC sources as minimal as possible) we could also create
libc/include/getopt.h which does:

#include <features.h>
#include <posix/getopt.h>

I don't think including <features.h> from include/libc-symbols.h is
such a good idea, since it hides the cases where we forget to include
<features.h>.

Mark

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]