On May 2, 2009, at 21:25, 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.

There are more systems than OS X that don't declare environ in  
unistd.h (eg. all users of the BSD libc). The Linux manpage for  
environ states that

> This variable must be declared in the user program, but is declared  
> in the header file unistd.h in case the header files came from libc4  
> or libc5, and in case they came from glibc and _GNU_SOURCE was  
> defined.

Unless there is a need to support libc4 or libc5 the test could then  
be changed to an #ifdef _GNU_SOURCE. Using autoconf is of course also  
a possibility.

Regards,
Anders Montonen

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

Reply via email to