This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
'char **environ' woes with cygwin
- To: gdb at sources dot redhat dot com
- Subject: 'char **environ' woes with cygwin
- From: Chris Faylor <cgf at cygnus dot com>
- Date: Thu, 24 Aug 2000 16:33:39 -0400
- Reply-To: gdb at sources dot redhat dot com
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