From 154b4c4bb430ae91b541d0a4932cdef75710c966 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 18 Nov 2020 02:49:19 +0100 Subject: [PATCH] posixcheck: Don't enable GNULIB_POSIXCHECK in C++ mode. Reported by Tom G. Christensen in . * m4/posixcheck.m4 (gl_POSIXCHECK): Don't define GNULIB_POSIXCHECK in C++ mode. --- ChangeLog | 8 ++++++++ m4/posixcheck.m4 | 10 +++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index fcf2a3c1a4..657768f3b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2020-11-17 Bruno Haible + posixcheck: Don't enable GNULIB_POSIXCHECK in C++ mode. + Reported by Tom G. Christensen in + . + * m4/posixcheck.m4 (gl_POSIXCHECK): Don't define GNULIB_POSIXCHECK in + C++ mode. + +2020-11-17 Bruno Haible + Fix error when GNULIB_POSIXCHECK is enabled (regression 2019-06-04). * lib/unistd.in.h (copy_file_range): Don't assume that copy_file_range is always declared. diff --git a/m4/posixcheck.m4 b/m4/posixcheck.m4 index d9a3d6cadd..2ee1b258c0 100644 --- a/m4/posixcheck.m4 +++ b/m4/posixcheck.m4 @@ -6,7 +6,11 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_POSIXCHECK], [ - AC_DEFINE([GNULIB_POSIXCHECK], [1], - [Define to enable warnings for determining which Gnulib modules to use, - for portability of POSIX functions.]) + AH_VERBATIM([POSIXCHECK], + [/* Define to enable warnings for determining which Gnulib modules to use, for + portability of POSIX functions. This does not work well in C++ mode. */ +#ifndef __cplusplus +# define GNULIB_POSIXCHECK 1 +#endif +]) ]) -- 2.11.4.GIT