This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


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

'char **environ' woes with cygwin


I've recently painfully learned that gdb explicitly declares 'char **environ'
all over the place.

This presents a problem for cygwin since environ is now being imported from
the cygwin DLL.

I've modified configure.in to egrep unistd.h for an environ declaration and
define HAVE_ENVIRON if unistd.h contains a declaration.

The question is, where do I put a:

#ifndef HAVE_ENVIRON
char **environ;
#endif

?

My initial choice was gdb's "environ.h" but that means that a number of files
need to include this just to get this declaration.  So, I'm wondering if putting
this in defs.h is a better choice.

Can anyone tell me the best place to include this?  I assume that
everyone agrees that putting the above in one header file is better than
sprinkling it throughout the sources.

cgf

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