# HG changeset patch # User Bruno Haible # Date 1293284585 -3600 # Node ID 872c921488fd9f7edbe284100fea098c2ef49bdf # Parent e9ece819f6cde607c69c01e268f743a31af72679 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 . diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +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. diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h --- 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. */