From: Bruno Haible Date: Fri, 27 Dec 2024 22:14:06 +0000 (+0100) Subject: Rename module fenv to fenv-h. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=21bad22d6906a25392ad1f16bffc5bb1c6d06115;p=gnulib.git Rename module fenv to fenv-h. * modules/fenv-h: Renamed from modules/fenv. * modules/fenv-h-tests: Renamed from modules/fenv-tests. * modules/fenv-h-c++-tests: Renamed from modules/fenv-c++-tests. * tests/test-fenv-h.c: Renamed from tests/test-fenv.c. * tests/test-fenv-h-c++.cc: Renamed from tests/test-fenv-c++.cc. * doc/posix-headers/fenv.texi: Update. * modules/* (Depends-on): Update. * modules/fenv: New file. --- diff --git a/ChangeLog b/ChangeLog index 605a4c462c..309b6ce3f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2024-12-27 Bruno Haible + + Rename module fenv to fenv-h. + * modules/fenv-h: Renamed from modules/fenv. + * modules/fenv-h-tests: Renamed from modules/fenv-tests. + * modules/fenv-h-c++-tests: Renamed from modules/fenv-c++-tests. + * tests/test-fenv-h.c: Renamed from tests/test-fenv.c. + * tests/test-fenv-h-c++.cc: Renamed from tests/test-fenv-c++.cc. + * doc/posix-headers/fenv.texi: Update. + * modules/* (Depends-on): Update. + * modules/fenv: New file. + 2024-12-27 Bruno Haible Rename module errno to errno-h. diff --git a/doc/posix-headers/fenv.texi b/doc/posix-headers/fenv.texi index 4149021e3c..7677b3d9aa 100644 --- a/doc/posix-headers/fenv.texi +++ b/doc/posix-headers/fenv.texi @@ -3,8 +3,8 @@ POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/fenv.h.html} -Gnulib module: fenv -@mindex fenv +Gnulib module: fenv-h +@mindex fenv-h Portability problems fixed by Gnulib: @itemize diff --git a/modules/fenv b/modules/fenv index 6c02818818..3dd3ef0963 100644 --- a/modules/fenv +++ b/modules/fenv @@ -1,87 +1,20 @@ Description: A GNU-like . -It nearly conforms to C99 and to C23. + +Status: +deprecated + +Notice: +This module is deprecated. Use the module 'fenv-h' instead. Files: -lib/fenv.in.h -m4/fenv_h.m4 Depends-on: -gen-header -include_next -snippet/c++defs -snippet/warn-on-use +fenv-h configure.ac: -gl_FENV_H -gl_FENV_H_REQUIRE_DEFAULTS -AC_PROG_MKDIR_P Makefile.am: -BUILT_SOURCES += fenv.h - -# We need the following in order to create an override of . -fenv.h: fenv.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) -@NMD@ $(AM_V_GEN)$(MKDIR_P) '%reldir%' - $(gl_V_at)$(SED_HEADER_STDOUT) \ - -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \ - -e 's/@''HAVE_FENV_H''@/$(HAVE_FENV_H)/g' \ - -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ - -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ - -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ - -e 's|@''NEXT_FENV_H''@|$(NEXT_FENV_H)|g' \ - -e 's/@''GNULIB_FECLEAREXCEPT''@/$(GNULIB_FECLEAREXCEPT)/g' \ - -e 's/@''GNULIB_FEDISABLEEXCEPT''@/$(GNULIB_FEDISABLEEXCEPT)/g' \ - -e 's/@''GNULIB_FEENABLEEXCEPT''@/$(GNULIB_FEENABLEEXCEPT)/g' \ - -e 's/@''GNULIB_FEGETENV''@/$(GNULIB_FEGETENV)/g' \ - -e 's/@''GNULIB_FEGETEXCEPT''@/$(GNULIB_FEGETEXCEPT)/g' \ - -e 's/@''GNULIB_FEGETEXCEPTFLAG''@/$(GNULIB_FEGETEXCEPTFLAG)/g' \ - -e 's/@''GNULIB_FEGETROUND''@/$(GNULIB_FEGETROUND)/g' \ - -e 's/@''GNULIB_FEHOLDEXCEPT''@/$(GNULIB_FEHOLDEXCEPT)/g' \ - -e 's/@''GNULIB_FERAISEEXCEPT''@/$(GNULIB_FERAISEEXCEPT)/g' \ - -e 's/@''GNULIB_FESETENV''@/$(GNULIB_FESETENV)/g' \ - -e 's/@''GNULIB_FESETEXCEPT''@/$(GNULIB_FESETEXCEPT)/g' \ - -e 's/@''GNULIB_FESETEXCEPTFLAG''@/$(GNULIB_FESETEXCEPTFLAG)/g' \ - -e 's/@''GNULIB_FESETROUND''@/$(GNULIB_FESETROUND)/g' \ - -e 's/@''GNULIB_FETESTEXCEPT''@/$(GNULIB_FETESTEXCEPT)/g' \ - -e 's/@''GNULIB_FETESTEXCEPTFLAG''@/$(GNULIB_FETESTEXCEPTFLAG)/g' \ - -e 's/@''GNULIB_FEUPDATEENV''@/$(GNULIB_FEUPDATEENV)/g' \ - -e 's|@''HAVE_FECLEAREXCEPT''@|$(HAVE_FECLEAREXCEPT)|g' \ - -e 's|@''HAVE_FEDISABLEEXCEPT''@|$(HAVE_FEDISABLEEXCEPT)|g' \ - -e 's|@''HAVE_FEENABLEEXCEPT''@|$(HAVE_FEENABLEEXCEPT)|g' \ - -e 's|@''HAVE_FEGETENV''@|$(HAVE_FEGETENV)|g' \ - -e 's|@''HAVE_FEGETEXCEPT''@|$(HAVE_FEGETEXCEPT)|g' \ - -e 's|@''HAVE_FEGETEXCEPTFLAG''@|$(HAVE_FEGETEXCEPTFLAG)|g' \ - -e 's|@''HAVE_FEGETROUND''@|$(HAVE_FEGETROUND)|g' \ - -e 's|@''HAVE_FEHOLDEXCEPT''@|$(HAVE_FEHOLDEXCEPT)|g' \ - -e 's|@''HAVE_FERAISEEXCEPT''@|$(HAVE_FERAISEEXCEPT)|g' \ - -e 's|@''HAVE_FESETENV''@|$(HAVE_FESETENV)|g' \ - -e 's|@''HAVE_FESETEXCEPT''@|$(HAVE_FESETEXCEPT)|g' \ - -e 's|@''HAVE_FESETEXCEPTFLAG''@|$(HAVE_FESETEXCEPTFLAG)|g' \ - -e 's|@''HAVE_FESETROUND''@|$(HAVE_FESETROUND)|g' \ - -e 's|@''HAVE_FETESTEXCEPT''@|$(HAVE_FETESTEXCEPT)|g' \ - -e 's|@''HAVE_FETESTEXCEPTFLAG''@|$(HAVE_FETESTEXCEPTFLAG)|g' \ - -e 's|@''HAVE_FEUPDATEENV''@|$(HAVE_FEUPDATEENV)|g' \ - -e 's|@''REPLACE_FECLEAREXCEPT''@|$(REPLACE_FECLEAREXCEPT)|g' \ - -e 's|@''REPLACE_FEDISABLEEXCEPT''@|$(REPLACE_FEDISABLEEXCEPT)|g' \ - -e 's|@''REPLACE_FEENABLEEXCEPT''@|$(REPLACE_FEENABLEEXCEPT)|g' \ - -e 's|@''REPLACE_FEGETENV''@|$(REPLACE_FEGETENV)|g' \ - -e 's|@''REPLACE_FEGETEXCEPT''@|$(REPLACE_FEGETEXCEPT)|g' \ - -e 's|@''REPLACE_FEGETEXCEPTFLAG''@|$(REPLACE_FEGETEXCEPTFLAG)|g' \ - -e 's|@''REPLACE_FEGETROUND''@|$(REPLACE_FEGETROUND)|g' \ - -e 's|@''REPLACE_FEHOLDEXCEPT''@|$(REPLACE_FEHOLDEXCEPT)|g' \ - -e 's|@''REPLACE_FERAISEEXCEPT''@|$(REPLACE_FERAISEEXCEPT)|g' \ - -e 's|@''REPLACE_FESETENV''@|$(REPLACE_FESETENV)|g' \ - -e 's|@''REPLACE_FESETEXCEPT''@|$(REPLACE_FESETEXCEPT)|g' \ - -e 's|@''REPLACE_FESETEXCEPTFLAG''@|$(REPLACE_FESETEXCEPTFLAG)|g' \ - -e 's|@''REPLACE_FESETROUND''@|$(REPLACE_FESETROUND)|g' \ - -e 's|@''REPLACE_FETESTEXCEPT''@|$(REPLACE_FETESTEXCEPT)|g' \ - -e 's|@''REPLACE_FEUPDATEENV''@|$(REPLACE_FEUPDATEENV)|g' \ - -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ - -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ - $(srcdir)/fenv.in.h > $@-t - $(AM_V_at)mv $@-t $@ -MOSTLYCLEANFILES += fenv.h fenv.h-t Include: @@ -90,4 +23,3 @@ License: LGPLv2+ Maintainer: -all diff --git a/modules/fenv-c++-tests b/modules/fenv-c++-tests deleted file mode 100644 index a485726088..0000000000 --- a/modules/fenv-c++-tests +++ /dev/null @@ -1,19 +0,0 @@ -Files: -tests/test-fenv-c++.cc -tests/signature.h - -Status: -c++-test - -Depends-on: -ansi-c++-opt - -configure.ac: - -Makefile.am: -if ANSICXX -TESTS += test-fenv-c++ -check_PROGRAMS += test-fenv-c++ -test_fenv_c___SOURCES = test-fenv-c++.cc -test_fenv_c___LDADD = $(LDADD) $(FENV_ENVIRONMENT_LIBM) $(FENV_ROUNDING_LIBM) $(FENV_EXCEPTIONS_TRACKING_LIBM) $(FENV_EXCEPTIONS_TRAPPING_LIBM) -endif diff --git a/modules/fenv-environment b/modules/fenv-environment index ab5e15bcab..addf45cb6d 100644 --- a/modules/fenv-environment +++ b/modules/fenv-environment @@ -12,7 +12,7 @@ m4/mathfunc.m4 m4/musl.m4 Depends-on: -fenv +fenv-h extensions verify fenv-exceptions-tracking-c99 diff --git a/modules/fenv-exceptions-state-c23 b/modules/fenv-exceptions-state-c23 index 487913c076..cd9bc89f89 100644 --- a/modules/fenv-exceptions-state-c23 +++ b/modules/fenv-exceptions-state-c23 @@ -8,7 +8,7 @@ m4/fenv-exceptions-state-c23.m4 m4/mathfunc.m4 Depends-on: -fenv +fenv-h fenv-exceptions-state-c99 configure.ac: diff --git a/modules/fenv-exceptions-state-c99 b/modules/fenv-exceptions-state-c99 index dcf7c42c10..563c93180e 100644 --- a/modules/fenv-exceptions-state-c99 +++ b/modules/fenv-exceptions-state-c99 @@ -11,7 +11,7 @@ m4/fenv-exceptions.m4 m4/mathfunc.m4 Depends-on: -fenv +fenv-h configure.ac: gl_FENV_EXCEPTIONS_STATE diff --git a/modules/fenv-exceptions-tracking-c23 b/modules/fenv-exceptions-tracking-c23 index a10145a24e..90f681c359 100644 --- a/modules/fenv-exceptions-tracking-c23 +++ b/modules/fenv-exceptions-tracking-c23 @@ -9,7 +9,7 @@ m4/fenv-exceptions-tracking-c23.m4 m4/mathfunc.m4 Depends-on: -fenv +fenv-h fenv-exceptions-tracking-c99 configure.ac: diff --git a/modules/fenv-exceptions-tracking-c99 b/modules/fenv-exceptions-tracking-c99 index 2e800cc47b..bbf32664bc 100644 --- a/modules/fenv-exceptions-tracking-c99 +++ b/modules/fenv-exceptions-tracking-c99 @@ -12,7 +12,7 @@ m4/fenv-exceptions.m4 m4/mathfunc.m4 Depends-on: -fenv +fenv-h configure.ac: gl_FENV_EXCEPTIONS_TRACKING diff --git a/modules/fenv-exceptions-trapping b/modules/fenv-exceptions-trapping index 7ce55fcbd6..1ba8339d6e 100644 --- a/modules/fenv-exceptions-trapping +++ b/modules/fenv-exceptions-trapping @@ -10,7 +10,7 @@ m4/mathfunc.m4 m4/musl.m4 Depends-on: -fenv +fenv-h extensions configure.ac: diff --git a/modules/fenv-h b/modules/fenv-h new file mode 100644 index 0000000000..6c02818818 --- /dev/null +++ b/modules/fenv-h @@ -0,0 +1,93 @@ +Description: +A GNU-like . +It nearly conforms to C99 and to C23. + +Files: +lib/fenv.in.h +m4/fenv_h.m4 + +Depends-on: +gen-header +include_next +snippet/c++defs +snippet/warn-on-use + +configure.ac: +gl_FENV_H +gl_FENV_H_REQUIRE_DEFAULTS +AC_PROG_MKDIR_P + +Makefile.am: +BUILT_SOURCES += fenv.h + +# We need the following in order to create an override of . +fenv.h: fenv.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) +@NMD@ $(AM_V_GEN)$(MKDIR_P) '%reldir%' + $(gl_V_at)$(SED_HEADER_STDOUT) \ + -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \ + -e 's/@''HAVE_FENV_H''@/$(HAVE_FENV_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_FENV_H''@|$(NEXT_FENV_H)|g' \ + -e 's/@''GNULIB_FECLEAREXCEPT''@/$(GNULIB_FECLEAREXCEPT)/g' \ + -e 's/@''GNULIB_FEDISABLEEXCEPT''@/$(GNULIB_FEDISABLEEXCEPT)/g' \ + -e 's/@''GNULIB_FEENABLEEXCEPT''@/$(GNULIB_FEENABLEEXCEPT)/g' \ + -e 's/@''GNULIB_FEGETENV''@/$(GNULIB_FEGETENV)/g' \ + -e 's/@''GNULIB_FEGETEXCEPT''@/$(GNULIB_FEGETEXCEPT)/g' \ + -e 's/@''GNULIB_FEGETEXCEPTFLAG''@/$(GNULIB_FEGETEXCEPTFLAG)/g' \ + -e 's/@''GNULIB_FEGETROUND''@/$(GNULIB_FEGETROUND)/g' \ + -e 's/@''GNULIB_FEHOLDEXCEPT''@/$(GNULIB_FEHOLDEXCEPT)/g' \ + -e 's/@''GNULIB_FERAISEEXCEPT''@/$(GNULIB_FERAISEEXCEPT)/g' \ + -e 's/@''GNULIB_FESETENV''@/$(GNULIB_FESETENV)/g' \ + -e 's/@''GNULIB_FESETEXCEPT''@/$(GNULIB_FESETEXCEPT)/g' \ + -e 's/@''GNULIB_FESETEXCEPTFLAG''@/$(GNULIB_FESETEXCEPTFLAG)/g' \ + -e 's/@''GNULIB_FESETROUND''@/$(GNULIB_FESETROUND)/g' \ + -e 's/@''GNULIB_FETESTEXCEPT''@/$(GNULIB_FETESTEXCEPT)/g' \ + -e 's/@''GNULIB_FETESTEXCEPTFLAG''@/$(GNULIB_FETESTEXCEPTFLAG)/g' \ + -e 's/@''GNULIB_FEUPDATEENV''@/$(GNULIB_FEUPDATEENV)/g' \ + -e 's|@''HAVE_FECLEAREXCEPT''@|$(HAVE_FECLEAREXCEPT)|g' \ + -e 's|@''HAVE_FEDISABLEEXCEPT''@|$(HAVE_FEDISABLEEXCEPT)|g' \ + -e 's|@''HAVE_FEENABLEEXCEPT''@|$(HAVE_FEENABLEEXCEPT)|g' \ + -e 's|@''HAVE_FEGETENV''@|$(HAVE_FEGETENV)|g' \ + -e 's|@''HAVE_FEGETEXCEPT''@|$(HAVE_FEGETEXCEPT)|g' \ + -e 's|@''HAVE_FEGETEXCEPTFLAG''@|$(HAVE_FEGETEXCEPTFLAG)|g' \ + -e 's|@''HAVE_FEGETROUND''@|$(HAVE_FEGETROUND)|g' \ + -e 's|@''HAVE_FEHOLDEXCEPT''@|$(HAVE_FEHOLDEXCEPT)|g' \ + -e 's|@''HAVE_FERAISEEXCEPT''@|$(HAVE_FERAISEEXCEPT)|g' \ + -e 's|@''HAVE_FESETENV''@|$(HAVE_FESETENV)|g' \ + -e 's|@''HAVE_FESETEXCEPT''@|$(HAVE_FESETEXCEPT)|g' \ + -e 's|@''HAVE_FESETEXCEPTFLAG''@|$(HAVE_FESETEXCEPTFLAG)|g' \ + -e 's|@''HAVE_FESETROUND''@|$(HAVE_FESETROUND)|g' \ + -e 's|@''HAVE_FETESTEXCEPT''@|$(HAVE_FETESTEXCEPT)|g' \ + -e 's|@''HAVE_FETESTEXCEPTFLAG''@|$(HAVE_FETESTEXCEPTFLAG)|g' \ + -e 's|@''HAVE_FEUPDATEENV''@|$(HAVE_FEUPDATEENV)|g' \ + -e 's|@''REPLACE_FECLEAREXCEPT''@|$(REPLACE_FECLEAREXCEPT)|g' \ + -e 's|@''REPLACE_FEDISABLEEXCEPT''@|$(REPLACE_FEDISABLEEXCEPT)|g' \ + -e 's|@''REPLACE_FEENABLEEXCEPT''@|$(REPLACE_FEENABLEEXCEPT)|g' \ + -e 's|@''REPLACE_FEGETENV''@|$(REPLACE_FEGETENV)|g' \ + -e 's|@''REPLACE_FEGETEXCEPT''@|$(REPLACE_FEGETEXCEPT)|g' \ + -e 's|@''REPLACE_FEGETEXCEPTFLAG''@|$(REPLACE_FEGETEXCEPTFLAG)|g' \ + -e 's|@''REPLACE_FEGETROUND''@|$(REPLACE_FEGETROUND)|g' \ + -e 's|@''REPLACE_FEHOLDEXCEPT''@|$(REPLACE_FEHOLDEXCEPT)|g' \ + -e 's|@''REPLACE_FERAISEEXCEPT''@|$(REPLACE_FERAISEEXCEPT)|g' \ + -e 's|@''REPLACE_FESETENV''@|$(REPLACE_FESETENV)|g' \ + -e 's|@''REPLACE_FESETEXCEPT''@|$(REPLACE_FESETEXCEPT)|g' \ + -e 's|@''REPLACE_FESETEXCEPTFLAG''@|$(REPLACE_FESETEXCEPTFLAG)|g' \ + -e 's|@''REPLACE_FESETROUND''@|$(REPLACE_FESETROUND)|g' \ + -e 's|@''REPLACE_FETESTEXCEPT''@|$(REPLACE_FETESTEXCEPT)|g' \ + -e 's|@''REPLACE_FEUPDATEENV''@|$(REPLACE_FEUPDATEENV)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + $(srcdir)/fenv.in.h > $@-t + $(AM_V_at)mv $@-t $@ +MOSTLYCLEANFILES += fenv.h fenv.h-t + +Include: + + +License: +LGPLv2+ + +Maintainer: +all diff --git a/modules/fenv-h-c++-tests b/modules/fenv-h-c++-tests new file mode 100644 index 0000000000..da099c25fb --- /dev/null +++ b/modules/fenv-h-c++-tests @@ -0,0 +1,19 @@ +Files: +tests/test-fenv-h-c++.cc +tests/signature.h + +Status: +c++-test + +Depends-on: +ansi-c++-opt + +configure.ac: + +Makefile.am: +if ANSICXX +TESTS += test-fenv-h-c++ +check_PROGRAMS += test-fenv-h-c++ +test_fenv_h_c___SOURCES = test-fenv-h-c++.cc +test_fenv_h_c___LDADD = $(LDADD) $(FENV_ENVIRONMENT_LIBM) $(FENV_ROUNDING_LIBM) $(FENV_EXCEPTIONS_TRACKING_LIBM) $(FENV_EXCEPTIONS_TRAPPING_LIBM) +endif diff --git a/modules/fenv-h-tests b/modules/fenv-h-tests new file mode 100644 index 0000000000..e8909adf6a --- /dev/null +++ b/modules/fenv-h-tests @@ -0,0 +1,12 @@ +Files: +tests/test-fenv-h.c + +Depends-on: +verify +fenv-h-c++-tests + +configure.ac: + +Makefile.am: +TESTS += test-fenv-h +check_PROGRAMS += test-fenv-h diff --git a/modules/fenv-rounding b/modules/fenv-rounding index bd7eb48824..3a9524e533 100644 --- a/modules/fenv-rounding +++ b/modules/fenv-rounding @@ -9,7 +9,7 @@ m4/fenv-rounding.m4 m4/mathfunc.m4 Depends-on: -fenv +fenv-h configure.ac: gl_FENV_ROUNDING diff --git a/modules/fenv-tests b/modules/fenv-tests deleted file mode 100644 index c7f96c040a..0000000000 --- a/modules/fenv-tests +++ /dev/null @@ -1,12 +0,0 @@ -Files: -tests/test-fenv.c - -Depends-on: -verify -fenv-c++-tests - -configure.ac: - -Makefile.am: -TESTS += test-fenv -check_PROGRAMS += test-fenv diff --git a/tests/test-fenv-c++.cc b/tests/test-fenv-c++.cc deleted file mode 100644 index db5d192be5..0000000000 --- a/tests/test-fenv-c++.cc +++ /dev/null @@ -1,95 +0,0 @@ -/* Test of substitute in C++ mode. - Copyright (C) 2023-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 , 2010. */ - -#define GNULIB_NAMESPACE gnulib -#include - -#include - -#include "signature.h" - - -#if GNULIB_TEST_FEGETENV -SIGNATURE_CHECK (GNULIB_NAMESPACE::fegetenv, int, (fenv_t *)); -#endif - -#if GNULIB_TEST_FESETENV -SIGNATURE_CHECK (GNULIB_NAMESPACE::fesetenv, int, (fenv_t const *)); -#endif - -#if GNULIB_TEST_FEUPDATEENV -SIGNATURE_CHECK (GNULIB_NAMESPACE::feupdateenv, int, (fenv_t const *)); -#endif - -#if GNULIB_TEST_FEHOLDEXCEPT -SIGNATURE_CHECK (GNULIB_NAMESPACE::feholdexcept, int, (fenv_t *)); -#endif - -#if GNULIB_TEST_FEGETROUND -SIGNATURE_CHECK (GNULIB_NAMESPACE::fegetround, int, (void)); -#endif - -#if GNULIB_TEST_FESETROUND -SIGNATURE_CHECK (GNULIB_NAMESPACE::fesetround, int, (int)); -#endif - -#if GNULIB_TEST_FECLEAREXCEPT -SIGNATURE_CHECK (GNULIB_NAMESPACE::feclearexcept, int, (int)); -#endif - -#if GNULIB_TEST_FERAISEEXCEPT -SIGNATURE_CHECK (GNULIB_NAMESPACE::feraiseexcept, int, (int)); -#endif - -#if GNULIB_TEST_FETESTEXCEPT -SIGNATURE_CHECK (GNULIB_NAMESPACE::fetestexcept, int, (int)); -#endif - -#if GNULIB_TEST_FESETEXCEPT -SIGNATURE_CHECK (GNULIB_NAMESPACE::fesetexcept, int, (int)); -#endif - -#if GNULIB_TEST_FEENABLEEXCEPT -SIGNATURE_CHECK (GNULIB_NAMESPACE::feenableexcept, int, (int)); -#endif - -#if GNULIB_TEST_FEDISABLEEXCEPT -SIGNATURE_CHECK (GNULIB_NAMESPACE::fedisableexcept, int, (int)); -#endif - -#if GNULIB_TEST_FEGETEXCEPT -SIGNATURE_CHECK (GNULIB_NAMESPACE::fegetexcept, int, (void)); -#endif - -#if GNULIB_TEST_FEGETEXCEPTFLAG -SIGNATURE_CHECK (GNULIB_NAMESPACE::fegetexceptflag, int, (fexcept_t *, int)); -#endif - -#if GNULIB_TEST_FESETEXCEPTFLAG -SIGNATURE_CHECK (GNULIB_NAMESPACE::fesetexceptflag, int, (fexcept_t const *, int)); -#endif - -#if GNULIB_TEST_FETESTEXCEPTFLAG -SIGNATURE_CHECK (GNULIB_NAMESPACE::fetestexceptflag, int, (fexcept_t const *, int)); -#endif - - -int -main () -{ -} diff --git a/tests/test-fenv-h-c++.cc b/tests/test-fenv-h-c++.cc new file mode 100644 index 0000000000..db5d192be5 --- /dev/null +++ b/tests/test-fenv-h-c++.cc @@ -0,0 +1,95 @@ +/* Test of substitute in C++ mode. + Copyright (C) 2023-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 , 2010. */ + +#define GNULIB_NAMESPACE gnulib +#include + +#include + +#include "signature.h" + + +#if GNULIB_TEST_FEGETENV +SIGNATURE_CHECK (GNULIB_NAMESPACE::fegetenv, int, (fenv_t *)); +#endif + +#if GNULIB_TEST_FESETENV +SIGNATURE_CHECK (GNULIB_NAMESPACE::fesetenv, int, (fenv_t const *)); +#endif + +#if GNULIB_TEST_FEUPDATEENV +SIGNATURE_CHECK (GNULIB_NAMESPACE::feupdateenv, int, (fenv_t const *)); +#endif + +#if GNULIB_TEST_FEHOLDEXCEPT +SIGNATURE_CHECK (GNULIB_NAMESPACE::feholdexcept, int, (fenv_t *)); +#endif + +#if GNULIB_TEST_FEGETROUND +SIGNATURE_CHECK (GNULIB_NAMESPACE::fegetround, int, (void)); +#endif + +#if GNULIB_TEST_FESETROUND +SIGNATURE_CHECK (GNULIB_NAMESPACE::fesetround, int, (int)); +#endif + +#if GNULIB_TEST_FECLEAREXCEPT +SIGNATURE_CHECK (GNULIB_NAMESPACE::feclearexcept, int, (int)); +#endif + +#if GNULIB_TEST_FERAISEEXCEPT +SIGNATURE_CHECK (GNULIB_NAMESPACE::feraiseexcept, int, (int)); +#endif + +#if GNULIB_TEST_FETESTEXCEPT +SIGNATURE_CHECK (GNULIB_NAMESPACE::fetestexcept, int, (int)); +#endif + +#if GNULIB_TEST_FESETEXCEPT +SIGNATURE_CHECK (GNULIB_NAMESPACE::fesetexcept, int, (int)); +#endif + +#if GNULIB_TEST_FEENABLEEXCEPT +SIGNATURE_CHECK (GNULIB_NAMESPACE::feenableexcept, int, (int)); +#endif + +#if GNULIB_TEST_FEDISABLEEXCEPT +SIGNATURE_CHECK (GNULIB_NAMESPACE::fedisableexcept, int, (int)); +#endif + +#if GNULIB_TEST_FEGETEXCEPT +SIGNATURE_CHECK (GNULIB_NAMESPACE::fegetexcept, int, (void)); +#endif + +#if GNULIB_TEST_FEGETEXCEPTFLAG +SIGNATURE_CHECK (GNULIB_NAMESPACE::fegetexceptflag, int, (fexcept_t *, int)); +#endif + +#if GNULIB_TEST_FESETEXCEPTFLAG +SIGNATURE_CHECK (GNULIB_NAMESPACE::fesetexceptflag, int, (fexcept_t const *, int)); +#endif + +#if GNULIB_TEST_FETESTEXCEPTFLAG +SIGNATURE_CHECK (GNULIB_NAMESPACE::fetestexceptflag, int, (fexcept_t const *, int)); +#endif + + +int +main () +{ +} diff --git a/tests/test-fenv-h.c b/tests/test-fenv-h.c new file mode 100644 index 0000000000..1698299edd --- /dev/null +++ b/tests/test-fenv-h.c @@ -0,0 +1,69 @@ +/* Test of substitute. + Copyright (C) 2023-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 , 2023. */ + +#include + +/* Specification. */ +#include + +#include "verify.h" + +/* Check that the various FE_* macros are defined. */ +int r[] = + { +#ifdef FE_DOWNWARD + FE_DOWNWARD, +#endif +#ifdef FE_UPWARD + FE_UPWARD, +#endif +#ifdef FE_TOWARDZERO + FE_TOWARDZERO, +#endif + FE_TONEAREST + }; +int e[] = { FE_DIVBYZERO, FE_INEXACT, FE_INVALID, FE_OVERFLOW, FE_UNDERFLOW }; + +/* Check that the types are all defined. */ +fenv_t t1; +fexcept_t t2; + +/* On many platforms, other FE_* constants are included in FE_ALL_EXCEPT, + therefore in general + FE_ALL_EXCEPT == (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW) + does not hold. */ +verify (((FE_DIVBYZERO | FE_INEXACT | FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW) + & ~FE_ALL_EXCEPT) + == 0); + +int +main (void) +{ + /* Ensure no overlap in FE_*. */ + switch (FE_INVALID) + { + case FE_DIVBYZERO: + case FE_INEXACT: + case FE_INVALID: + case FE_OVERFLOW: + case FE_UNDERFLOW: + ; + } + + return 0; +} diff --git a/tests/test-fenv.c b/tests/test-fenv.c deleted file mode 100644 index 1698299edd..0000000000 --- a/tests/test-fenv.c +++ /dev/null @@ -1,69 +0,0 @@ -/* Test of substitute. - Copyright (C) 2023-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 , 2023. */ - -#include - -/* Specification. */ -#include - -#include "verify.h" - -/* Check that the various FE_* macros are defined. */ -int r[] = - { -#ifdef FE_DOWNWARD - FE_DOWNWARD, -#endif -#ifdef FE_UPWARD - FE_UPWARD, -#endif -#ifdef FE_TOWARDZERO - FE_TOWARDZERO, -#endif - FE_TONEAREST - }; -int e[] = { FE_DIVBYZERO, FE_INEXACT, FE_INVALID, FE_OVERFLOW, FE_UNDERFLOW }; - -/* Check that the types are all defined. */ -fenv_t t1; -fexcept_t t2; - -/* On many platforms, other FE_* constants are included in FE_ALL_EXCEPT, - therefore in general - FE_ALL_EXCEPT == (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW) - does not hold. */ -verify (((FE_DIVBYZERO | FE_INEXACT | FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW) - & ~FE_ALL_EXCEPT) - == 0); - -int -main (void) -{ - /* Ensure no overlap in FE_*. */ - switch (FE_INVALID) - { - case FE_DIVBYZERO: - case FE_INEXACT: - case FE_INVALID: - case FE_OVERFLOW: - case FE_UNDERFLOW: - ; - } - - return 0; -}