]> Savannah Git Hosting - gnulib.git/commitdiff
unistd: avoid namespace pollution on non-glibc systems
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 7 Feb 2013 00:11:07 +0000 (16:11 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 7 Feb 2013 00:11:32 +0000 (16:11 -0800)
* lib/unistd.in.h: #define __need_getopt before including <getopt.h>.
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
<http://lists.gnu.org/archive/html/bug-gnulib/2013-02/msg00027.html>.

ChangeLog
lib/unistd.in.h

index 4b046d3b963b36a458385389e9a82fe47ecff9f6..25db57d837a829e0f68e9ef92e13941ed3e28627 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-02-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+       unistd: avoid namespace pollution on non-glibc systems
+       * lib/unistd.in.h: #define __need_getopt before including <getopt.h>.
+       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
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-02/msg00027.html>.
+
 2013-02-04  Paul Eggert  <eggert@cs.ucla.edu>
 
        tmpdir: use secure_getenv
index 7cc022dbd8775e66dad5bbb8a7c595e5d40d3bca..8a25aa43464aeef8bc32c3f4b95617bec5c7b76a 100644 (file)
 /* 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 <getopt.h>
 #endif