From: Bruno Haible Date: Sat, 18 May 2024 10:31:15 +0000 (+0200) Subject: endian tests: Verify that it can be used from C++. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=59a670d792d16c5083b8657b972f1c00ce9905d1;p=gnulib.git endian tests: Verify that it can be used from C++. * tests/test-endian-c++.cc: New file. * modules/endian-c++-tests: New file. * modules/endian-tests (Depends-on): Add endian-c++-tests. --- diff --git a/ChangeLog b/ChangeLog index 322aaf362d..29adf56ab7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-05-18 Bruno Haible + + endian tests: Verify that it can be used from C++. + * tests/test-endian-c++.cc: New file. + * modules/endian-c++-tests: New file. + * modules/endian-tests (Depends-on): Add endian-c++-tests. + 2024-05-18 Bruno Haible endian: Update doc and strengthen tests. diff --git a/modules/endian-c++-tests b/modules/endian-c++-tests new file mode 100644 index 0000000000..d358ac122a --- /dev/null +++ b/modules/endian-c++-tests @@ -0,0 +1,17 @@ +Files: +tests/test-endian-c++.cc + +Status: +c++-test + +Depends-on: +ansi-c++-opt + +configure.ac: + +Makefile.am: +if ANSICXX +TESTS += test-endian-c++ +check_PROGRAMS += test-endian-c++ +test_endian_c___SOURCES = test-endian-c++.cc +endif diff --git a/modules/endian-tests b/modules/endian-tests index 8ec67a1c42..e5d6da19b6 100644 --- a/modules/endian-tests +++ b/modules/endian-tests @@ -5,6 +5,7 @@ tests/macros.h Depends-on: assert-h stdint +endian-c++-tests configure.ac: diff --git a/tests/test-endian-c++.cc b/tests/test-endian-c++.cc new file mode 100644 index 0000000000..25c1ab0834 --- /dev/null +++ b/tests/test-endian-c++.cc @@ -0,0 +1,32 @@ +/* Test of substitute in C++ mode. + Copyright (C) 2024 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 . */ + +/* Written by Bruno Haible , 2024. */ + +#define GNULIB_NAMESPACE gnulib +#include + +#include + +/* Check against conflicts between and the C++ header files. */ +#include +#include + + +int +main () +{ +}