Isn't it much easier to write the conditional based on what causes it rather that what doesn't. unistd.h in _general_ doesn't include environ. Either write a test for autoconf that tries to use environ when only unistd.h is included or do the getopt hack:

/* If __GNU_LIBRARY__ is not already defined, either we are being used
standalone, or this is the first header included in the source file.
If we are being used with glibc, we need to include <features.h>, but
that does not exist if we are standalone. So: if __GNU_LIBRARY__ is
not defined, include <ctype.h>, which will pull in <features.h> for us
if it's from glibc. (Why ctype.h? It's guaranteed to exist and it
doesn't flood the namespace with stuff the way some other headers do.) */
#if !defined __GNU_LIBRARY__
# include <ctype.h>
#endif

After that, you can test for __GNU_LIBRARY__ to know if we are on glibc.

Rick

On May 2, 2009, at 11:25 AM, Michael Bruck wrote:

If it is a GNU specific thing then assuming that more often than not
this package is used with glibc I would suggest keeping

#if !HAVE_UNISTD_H || IS_DARWIN

rather than listing all variations that have environ in unistd.h.

As an alternative a test in ./configure would be a solution.


Michael


On Sat, May 2, 2009 at 2:36 PM, Michael Fischer <fische...@t- online.de> wrote:
Hello,

the new version r1589 do not solve the problem,
becasue the unistd.h looks like:

#define getpagesize() PAGE_SIZE

No information about environ here.

Regards,

Michael
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

--
Rick Altherr
kc8...@kc8apf.net

"He said he hadn't had a byte in three days. I had a short, so I split it with him."
 -- Unsigned



Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to