From 26aae1208b863f1f4d7f98445c0cb22a874fecb4 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 6 Feb 2013 16:11:07 -0800 Subject: [PATCH] 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 . --- ChangeLog | 9 +++++++++ lib/unistd.in.h | 1 + 2 files changed, 10 insertions(+) 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 -- 2.39.5