# HG changeset patch # User Bruno Haible # Date 1289528413 -3600 # Node ID a518692b40d4d5269cbb65f84e7fb482cd8ec99d # Parent c39e4e516aeedc8190477d441240f1935209129f 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-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 --- 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@