Branch
Hash :
d19a73d0
Author :
Date :
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.
/* Test of <stddef.h> substitute in C++ mode.
Copyright (C) 2019-2025 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>, 2019. */
#define GNULIB_NAMESPACE gnulib
#include "test-stddef-h.c"