From 59cb9127de519fa2db1c704045551ba447d6ffcb Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 12 Nov 2010 03:20:13 +0100 Subject: [PATCH] fcntl-h: Fix for use of C++ on glibc systems. * lib/fcntl.in.h: Include before include_next also on glibc systems in C++ mode. Reported by Gary V. Vaughan . --- ChangeLog | 7 +++++++ lib/fcntl.in.h | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8c4cde9581..d9e32a88f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-11-11 Bruno Haible + + fcntl-h: Fix for use of C++ on glibc systems. + * lib/fcntl.in.h: Include before include_next + also on glibc systems in C++ mode. + Reported by Gary V. Vaughan . + 2010-11-11 Christian Weisgerber (tiny change) mknod: avoid false failure with dash diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h index 663e49f32b..13f5dde97b 100644 --- a/lib/fcntl.in.h +++ b/lib/fcntl.in.h @@ -26,7 +26,13 @@ /* Special invocation convention. */ #include -#ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems. */ +/* On some systems other than glibc, is a prerequisite of + . On glibc systems, we would like to avoid namespace pollution. + But on glibc systems, includes inside an + extern "C" { ... } block, which leads to errors in C++ mode with the + overridden from gnulib. These errors are known to be gone + with g++ version >= 4.3. */ +#if !defined __GLIBC__ || (defined __cplusplus && defined GNULIB_NAMESPACE && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) # include #endif #@INCLUDE_NEXT@ @NEXT_FCNTL_H@ -- 2.30.2