# HG changeset patch # User Bruno Haible # Date 1521154563 -3600 # Node ID 8090d30c7a924acefe2cfa3323247753eafa5999 # Parent 27933959db65a15abc7e292b24eb31731b4232d4 glob: Fix compilation error in C++ mode. * lib/glob.in.h (_Restrict_): Define, like in regex.h and spawn.in.h. diff -r 27933959db65 -r 8090d30c7a92 ChangeLog --- a/ChangeLog Thu Mar 15 22:26:09 2018 +0100 +++ b/ChangeLog Thu Mar 15 23:56:03 2018 +0100 @@ -1,3 +1,8 @@ +2018-03-15 Bruno Haible + + glob: Fix compilation error in C++ mode. + * lib/glob.in.h (_Restrict_): Define, like in regex.h and spawn.in.h. + 2018-03-15 Bruno Haible host-cpu-c-abi: Support for RISC-V CPU. diff -r 27933959db65 -r 8090d30c7a92 lib/glob.in.h --- a/lib/glob.in.h Thu Mar 15 22:26:09 2018 +0100 +++ b/lib/glob.in.h Thu Mar 15 23:56:03 2018 +0100 @@ -33,6 +33,21 @@ # define __USE_GNU 1 #endif +/* GCC 2.95 and later have "__restrict"; C99 compilers have + "restrict", and "configure" may have defined "restrict". + Other compilers use __restrict, __restrict__, and _Restrict, and + 'configure' might #define 'restrict' to those words, so pick a + different name. */ +#ifndef _Restrict_ +# if 199901L <= __STDC_VERSION__ +# define _Restrict_ restrict +# elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__) +# define _Restrict_ __restrict +# else +# define _Restrict_ +# endif +#endif + #define glob rpl_glob #define globfree rpl_globfree