From: Paul Eggert Date: Thu, 7 Feb 2013 00:11:07 +0000 (-0800) Subject: unistd: avoid namespace pollution on non-glibc systems X-Git-Tag: v0.1~212 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=26aae1208b863f1f4d7f98445c0cb22a874fecb4;p=gnulib.git unistd: avoid namespace pollution on non-glibc systems * lib/unistd.in.h: #define __need_getopt before including . This avoids namespace pollution on non-glibc systems, by causing gnulib unistd.h to behave more like glibc unistd.h. I also hope that this fixes a bug on FreeBSD, reported by Mats Erik Andersson in . --- diff --git a/ChangeLog b/ChangeLog index 4b046d3b96..25db57d837 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2013-02-06 Paul Eggert + + unistd: avoid namespace pollution on non-glibc systems + * lib/unistd.in.h: #define __need_getopt before including . + This avoids namespace pollution on non-glibc systems, by causing + gnulib unistd.h to behave more like glibc unistd.h. I also hope + that this fixes a bug on FreeBSD, reported by Mats Erik Andersson in + . + 2013-02-04 Paul Eggert tmpdir: use secure_getenv diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 7cc022dbd8..8a25aa4346 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -110,6 +110,7 @@ /* Get getopt(), optarg, optind, opterr, optopt. But avoid namespace pollution on glibc systems. */ #if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined _GL_SYSTEM_GETOPT +# define __need_getopt # include #endif