Commit d19a73d049ef692e5d16f474dd6c5cc98669f53c

Bruno Haible 2025-05-28T01:59:05

stddef-h: Make 'unreachable' usable in C++ mode. Reported by Pierre Ossman <ossman@cendio.se> at <https://savannah.gnu.org/bugs/?67152>. * m4/stddef_h.m4 (gl_STDDEF_H): Also test whether unreachable is defined by <stddef.h> in C++ mode. * lib/stddef.in.h: In C++ mode, include <utility> and either import 'unreachable' from the std namespace or define it as an inline function. * tests/test-stddef-h.c: Disable some tests in C++ mode. * tests/test-stddef-h-c++.cc: Perform nearly the same tests in C++ mode as in C mode. * tests/test-stddef-h-c++2.cc: Rename some variables. Disable the NULL test with clang on Windows. * tests/test-stddef-h-c++3.cc: New file. * modules/stddef-h-c++-tests (Files): Include it. (Makefile.am): Link test-stddef-h-c++ with test-stddef-h-c++3.o.