From ebc78c6fc2de2f5f80520ee8980adac78ecd7521 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 25 Dec 2010 14:43:05 +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 441724be1..5aaac6904 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2010-12-25 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-12-25 Bruno Haible + roundl-ieee: Make it work on OSF/1 5.1 with cc. * modules/roundl-ieee (Depends-on): Add floorl-ieee, ceill-ieee. diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h index 6d1888de4..73c5f1ef0 100644 --- a/lib/fcntl.in.h +++ b/lib/fcntl.in.h @@ -43,7 +43,13 @@ #ifndef _GL_FCNTL_H #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 __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) # include #endif /* The include_next requires a split double-inclusion guard. */ -- 2.11.0