From: Bruno Haible Date: Sat, 25 Dec 2010 13:43:05 +0000 (+0100) Subject: fcntl-h: Fix for use of C++ on glibc systems. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebc78c6fc2de2f5f80520ee8980adac78ecd7521;p=pspp 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 index 441724be10..5aaac69040 100644 --- 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 index 6d1888de47..73c5f1ef03 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. */