From: Bruno Haible Date: Mon, 24 Jun 2024 23:04:11 +0000 (+0200) Subject: Reduce duplication among *printf-posix modules. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=d72eae67619356847dc7333fe1c82017149cb8ee;p=gnulib.git Reduce duplication among *printf-posix modules. * modules/mixin/printf-posix: New file. * modules/c-vasnprintf (Depends-on): Add it. Remove isnan*-nolibm, frexp*-nolibm, printf-frexp*, signbit, fpucw. * modules/dprintf-posix (Depends-on): Likewise. * modules/fprintf-posix (Depends-on): Likewise. * modules/snprintf-posix (Depends-on): Likewise. * modules/sprintf-posix (Depends-on): Likewise. * modules/unistdio/u16-u16-vasnprintf (Depends-on): Likewise. * modules/unistdio/u16-vasnprintf (Depends-on): Likewise. * modules/unistdio/u32-u32-vasnprintf (Depends-on): Likewise. * modules/unistdio/u32-vasnprintf (Depends-on): Likewise. * modules/unistdio/u8-u8-vasnprintf (Depends-on): Likewise. * modules/unistdio/u8-vasnprintf (Depends-on): Likewise. * modules/unistdio/ulc-vasnprintf (Depends-on): Likewise. * modules/vasnprintf-posix (Depends-on): Likewise. * modules/vasnwprintf-posix (Depends-on): Likewise. * modules/vasprintf-posix (Depends-on): Likewise. * modules/vdprintf-posix (Depends-on): Likewise. * modules/vfprintf-posix (Depends-on): Likewise. * modules/vsnprintf-posix (Depends-on): Likewise. * modules/vsprintf-posix (Depends-on): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 5dfaf9023f..b2dd608715 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +2024-06-24 Bruno Haible + + Reduce duplication among *printf-posix modules. + * modules/mixin/printf-posix: New file. + * modules/c-vasnprintf (Depends-on): Add it. Remove isnan*-nolibm, + frexp*-nolibm, printf-frexp*, signbit, fpucw. + * modules/dprintf-posix (Depends-on): Likewise. + * modules/fprintf-posix (Depends-on): Likewise. + * modules/snprintf-posix (Depends-on): Likewise. + * modules/sprintf-posix (Depends-on): Likewise. + * modules/unistdio/u16-u16-vasnprintf (Depends-on): Likewise. + * modules/unistdio/u16-vasnprintf (Depends-on): Likewise. + * modules/unistdio/u32-u32-vasnprintf (Depends-on): Likewise. + * modules/unistdio/u32-vasnprintf (Depends-on): Likewise. + * modules/unistdio/u8-u8-vasnprintf (Depends-on): Likewise. + * modules/unistdio/u8-vasnprintf (Depends-on): Likewise. + * modules/unistdio/ulc-vasnprintf (Depends-on): Likewise. + * modules/vasnprintf-posix (Depends-on): Likewise. + * modules/vasnwprintf-posix (Depends-on): Likewise. + * modules/vasprintf-posix (Depends-on): Likewise. + * modules/vdprintf-posix (Depends-on): Likewise. + * modules/vfprintf-posix (Depends-on): Likewise. + * modules/vsnprintf-posix (Depends-on): Likewise. + * modules/vsprintf-posix (Depends-on): Likewise. + 2024-06-24 Bruno Haible c-vasnprintf: Relicense under LGPLv2+. diff --git a/modules/c-vasnprintf b/modules/c-vasnprintf index 1ecf4e9cef..ab48d64310 100644 --- a/modules/c-vasnprintf +++ b/modules/c-vasnprintf @@ -26,13 +26,7 @@ attribute limits-h stdint stdio -isnand-nolibm -isnanl-nolibm -frexpl-nolibm -printf-frexp -printf-frexpl -signbit -fpucw +mixin/printf-posix free-posix nocrash printf-safe diff --git a/modules/dprintf-posix b/modules/dprintf-posix index 8f92586437..5bb88bf80d 100644 --- a/modules/dprintf-posix +++ b/modules/dprintf-posix @@ -18,15 +18,8 @@ dprintf nocrash printf-safe multiarch -vasnprintf [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1] -isnand-nolibm [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1] -isnanl-nolibm [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1] -frexp-nolibm [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1] -frexpl-nolibm [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1] -printf-frexp [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1] -printf-frexpl [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1] -signbit [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1] -fpucw [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1] +vasnprintf [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1] +mixin/printf-posix [test $ac_cv_func_dprintf = no || test $REPLACE_DPRINTF = 1] configure.ac: gl_FUNC_DPRINTF_POSIX diff --git a/modules/fprintf-posix b/modules/fprintf-posix index f2bd1a5c7d..6cda1ccef7 100644 --- a/modules/fprintf-posix +++ b/modules/fprintf-posix @@ -19,17 +19,10 @@ nocrash printf-safe errno multiarch -fseterr [test $REPLACE_FPRINTF = 1] -vasnprintf [test $REPLACE_FPRINTF = 1] -isnand-nolibm [test $REPLACE_FPRINTF = 1] -isnanl-nolibm [test $REPLACE_FPRINTF = 1] -free-posix [test $REPLACE_FPRINTF = 1] -frexp-nolibm [test $REPLACE_FPRINTF = 1] -frexpl-nolibm [test $REPLACE_FPRINTF = 1] -printf-frexp [test $REPLACE_FPRINTF = 1] -printf-frexpl [test $REPLACE_FPRINTF = 1] -signbit [test $REPLACE_FPRINTF = 1] -fpucw [test $REPLACE_FPRINTF = 1] +fseterr [test $REPLACE_FPRINTF = 1] +vasnprintf [test $REPLACE_FPRINTF = 1] +mixin/printf-posix [test $REPLACE_FPRINTF = 1] +free-posix [test $REPLACE_FPRINTF = 1] configure.ac: gl_FUNC_FPRINTF_POSIX diff --git a/modules/mixin/printf-posix b/modules/mixin/printf-posix new file mode 100644 index 0000000000..f78559142d --- /dev/null +++ b/modules/mixin/printf-posix @@ -0,0 +1,28 @@ +Description: +Module dependencies that are needed to compile lib/vasnprintf.c +with all extras for POSIX compliance. + +Files: + +Depends-on: +isnand-nolibm +isnanl-nolibm +frexp-nolibm +frexpl-nolibm +printf-frexp +printf-frexpl +signbit +fpucw + +configure.ac: +# Conditionally invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. + +Makefile.am: + +Include: + +License: +LGPLv2+ + +Maintainer: +all diff --git a/modules/snprintf-posix b/modules/snprintf-posix index 5794e95cea..e099c7644e 100644 --- a/modules/snprintf-posix +++ b/modules/snprintf-posix @@ -18,15 +18,8 @@ snprintf nocrash printf-safe multiarch -vasnprintf [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1] -isnand-nolibm [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1] -isnanl-nolibm [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1] -frexp-nolibm [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1] -frexpl-nolibm [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1] -printf-frexp [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1] -printf-frexpl [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1] -signbit [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1] -fpucw [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1] +vasnprintf [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1] +mixin/printf-posix [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1] configure.ac: gl_FUNC_SNPRINTF_POSIX diff --git a/modules/sprintf-posix b/modules/sprintf-posix index a1eb6127ad..2c47424bec 100644 --- a/modules/sprintf-posix +++ b/modules/sprintf-posix @@ -18,17 +18,10 @@ stdio nocrash printf-safe multiarch -vzsprintf [test $REPLACE_SPRINTF = 1] -isnand-nolibm [test $REPLACE_SPRINTF = 1] -isnanl-nolibm [test $REPLACE_SPRINTF = 1] -frexp-nolibm [test $REPLACE_SPRINTF = 1] -frexpl-nolibm [test $REPLACE_SPRINTF = 1] -printf-frexp [test $REPLACE_SPRINTF = 1] -printf-frexpl [test $REPLACE_SPRINTF = 1] -signbit [test $REPLACE_SPRINTF = 1] -fpucw [test $REPLACE_SPRINTF = 1] -stdint [test $REPLACE_SPRINTF = 1] -errno [test $REPLACE_SPRINTF = 1] +vzsprintf [test $REPLACE_SPRINTF = 1] +mixin/printf-posix [test $REPLACE_SPRINTF = 1] +stdint [test $REPLACE_SPRINTF = 1] +errno [test $REPLACE_SPRINTF = 1] configure.ac: gl_FUNC_SPRINTF_POSIX diff --git a/modules/unistdio/u16-u16-vasnprintf b/modules/unistdio/u16-u16-vasnprintf index 98adbbb37a..0237505d58 100644 --- a/modules/unistdio/u16-u16-vasnprintf +++ b/modules/unistdio/u16-u16-vasnprintf @@ -31,13 +31,7 @@ unistr/u32-strlen unistr/u32-strmblen attribute stdint -isnand-nolibm -isnanl-nolibm -frexpl-nolibm -printf-frexp -printf-frexpl -signbit -fpucw +mixin/printf-posix nocrash printf-safe alloca-opt diff --git a/modules/unistdio/u16-vasnprintf b/modules/unistdio/u16-vasnprintf index de541ef1ca..d92e6dd157 100644 --- a/modules/unistdio/u16-vasnprintf +++ b/modules/unistdio/u16-vasnprintf @@ -31,13 +31,7 @@ unistr/u32-strlen unistr/u32-strmblen attribute stdint -isnand-nolibm -isnanl-nolibm -frexpl-nolibm -printf-frexp -printf-frexpl -signbit -fpucw +mixin/printf-posix nocrash printf-safe alloca-opt diff --git a/modules/unistdio/u32-u32-vasnprintf b/modules/unistdio/u32-u32-vasnprintf index 168cdbd7a9..119a9fe4f4 100644 --- a/modules/unistdio/u32-u32-vasnprintf +++ b/modules/unistdio/u32-u32-vasnprintf @@ -31,13 +31,7 @@ unistr/u32-strlen unistr/u32-strmblen attribute stdint -isnand-nolibm -isnanl-nolibm -frexpl-nolibm -printf-frexp -printf-frexpl -signbit -fpucw +mixin/printf-posix nocrash printf-safe alloca-opt diff --git a/modules/unistdio/u32-vasnprintf b/modules/unistdio/u32-vasnprintf index bdea7468b1..bd094712a2 100644 --- a/modules/unistdio/u32-vasnprintf +++ b/modules/unistdio/u32-vasnprintf @@ -31,13 +31,7 @@ unistr/u32-strlen unistr/u32-strmblen attribute stdint -isnand-nolibm -isnanl-nolibm -frexpl-nolibm -printf-frexp -printf-frexpl -signbit -fpucw +mixin/printf-posix nocrash printf-safe alloca-opt diff --git a/modules/unistdio/u8-u8-vasnprintf b/modules/unistdio/u8-u8-vasnprintf index 5168794bf1..733bc15d3f 100644 --- a/modules/unistdio/u8-u8-vasnprintf +++ b/modules/unistdio/u8-u8-vasnprintf @@ -31,13 +31,7 @@ unistr/u32-strlen unistr/u32-strmblen attribute stdint -isnand-nolibm -isnanl-nolibm -frexpl-nolibm -printf-frexp -printf-frexpl -signbit -fpucw +mixin/printf-posix nocrash printf-safe alloca-opt diff --git a/modules/unistdio/u8-vasnprintf b/modules/unistdio/u8-vasnprintf index cf83b9343c..b86f0d2c19 100644 --- a/modules/unistdio/u8-vasnprintf +++ b/modules/unistdio/u8-vasnprintf @@ -31,13 +31,7 @@ unistr/u32-strlen unistr/u32-strmblen attribute stdint -isnand-nolibm -isnanl-nolibm -frexpl-nolibm -printf-frexp -printf-frexpl -signbit -fpucw +mixin/printf-posix nocrash printf-safe alloca-opt diff --git a/modules/unistdio/ulc-vasnprintf b/modules/unistdio/ulc-vasnprintf index bea310b874..544e39d0ab 100644 --- a/modules/unistdio/ulc-vasnprintf +++ b/modules/unistdio/ulc-vasnprintf @@ -29,13 +29,7 @@ unistr/u32-strmblen attribute stdint mbsnlen -isnand-nolibm -isnanl-nolibm -frexpl-nolibm -printf-frexp -printf-frexpl -signbit -fpucw +mixin/printf-posix nocrash printf-safe alloca-opt diff --git a/modules/vasnprintf-posix b/modules/vasnprintf-posix index 10660f369d..cdc7a8900a 100644 --- a/modules/vasnprintf-posix +++ b/modules/vasnprintf-posix @@ -15,14 +15,7 @@ m4/math_h.m4 Depends-on: vasnprintf -isnand-nolibm -isnanl-nolibm -frexp-nolibm -frexpl-nolibm -printf-frexp -printf-frexpl -signbit -fpucw +mixin/printf-posix nocrash printf-safe multiarch diff --git a/modules/vasnwprintf-posix b/modules/vasnwprintf-posix index 554efe1707..71d6a91717 100644 --- a/modules/vasnwprintf-posix +++ b/modules/vasnwprintf-posix @@ -15,14 +15,7 @@ m4/math_h.m4 Depends-on: vasnwprintf -isnand-nolibm -isnanl-nolibm -frexp-nolibm -frexpl-nolibm -printf-frexp -printf-frexpl -signbit -fpucw +mixin/printf-posix nocrash printf-safe multiarch diff --git a/modules/vasprintf-posix b/modules/vasprintf-posix index 7c0686be9d..2bfb2672ae 100644 --- a/modules/vasprintf-posix +++ b/modules/vasprintf-posix @@ -14,15 +14,8 @@ m4/math_h.m4 Depends-on: vasprintf -vasnprintf [test $HAVE_VASPRINTF = 0 || test $REPLACE_VASPRINTF = 1] -isnand-nolibm -isnanl-nolibm -frexp-nolibm -frexpl-nolibm -printf-frexp -printf-frexpl -signbit -fpucw +vasnprintf [test $HAVE_VASPRINTF = 0 || test $REPLACE_VASPRINTF = 1] +mixin/printf-posix [test $HAVE_VASPRINTF = 0 || test $REPLACE_VASPRINTF = 1] nocrash printf-safe multiarch diff --git a/modules/vdprintf-posix b/modules/vdprintf-posix index 8feca348b1..d4a98805d8 100644 --- a/modules/vdprintf-posix +++ b/modules/vdprintf-posix @@ -18,15 +18,8 @@ vdprintf nocrash printf-safe multiarch -vasnprintf [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1] -isnand-nolibm [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1] -isnanl-nolibm [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1] -frexp-nolibm [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1] -frexpl-nolibm [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1] -printf-frexp [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1] -printf-frexpl [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1] -signbit [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1] -fpucw [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1] +vasnprintf [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1] +mixin/printf-posix [test $ac_cv_func_vdprintf = no || test $REPLACE_VDPRINTF = 1] configure.ac: gl_FUNC_VDPRINTF_POSIX diff --git a/modules/vfprintf-posix b/modules/vfprintf-posix index 47794dd9b1..3bc350d98b 100644 --- a/modules/vfprintf-posix +++ b/modules/vfprintf-posix @@ -18,18 +18,11 @@ stdio nocrash printf-safe multiarch -free-posix [test $REPLACE_VFPRINTF = 1] -fseterr [test $REPLACE_VFPRINTF = 1] -vasnprintf [test $REPLACE_VFPRINTF = 1] -isnand-nolibm [test $REPLACE_VFPRINTF = 1] -isnanl-nolibm [test $REPLACE_VFPRINTF = 1] -frexp-nolibm [test $REPLACE_VFPRINTF = 1] -frexpl-nolibm [test $REPLACE_VFPRINTF = 1] -printf-frexp [test $REPLACE_VFPRINTF = 1] -printf-frexpl [test $REPLACE_VFPRINTF = 1] -signbit [test $REPLACE_VFPRINTF = 1] -fpucw [test $REPLACE_VFPRINTF = 1] -errno [test $REPLACE_VFPRINTF = 1] +free-posix [test $REPLACE_VFPRINTF = 1] +fseterr [test $REPLACE_VFPRINTF = 1] +vasnprintf [test $REPLACE_VFPRINTF = 1] +mixin/printf-posix [test $REPLACE_VFPRINTF = 1] +errno [test $REPLACE_VFPRINTF = 1] configure.ac: gl_FUNC_VFPRINTF_POSIX diff --git a/modules/vsnprintf-posix b/modules/vsnprintf-posix index 88220bf703..720dcedf02 100644 --- a/modules/vsnprintf-posix +++ b/modules/vsnprintf-posix @@ -18,15 +18,8 @@ vsnprintf nocrash printf-safe multiarch -vasnprintf [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1] -isnand-nolibm [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1] -isnanl-nolibm [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1] -frexp-nolibm [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1] -frexpl-nolibm [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1] -printf-frexp [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1] -printf-frexpl [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1] -signbit [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1] -fpucw [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1] +vasnprintf [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1] +mixin/printf-posix [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1] configure.ac: gl_FUNC_VSNPRINTF_POSIX diff --git a/modules/vsprintf-posix b/modules/vsprintf-posix index 2bbb36055b..91b634921a 100644 --- a/modules/vsprintf-posix +++ b/modules/vsprintf-posix @@ -18,17 +18,10 @@ stdio nocrash printf-safe multiarch -vzsprintf [test $REPLACE_VSPRINTF = 1] -isnand-nolibm [test $REPLACE_VSPRINTF = 1] -isnanl-nolibm [test $REPLACE_VSPRINTF = 1] -frexp-nolibm [test $REPLACE_VSPRINTF = 1] -frexpl-nolibm [test $REPLACE_VSPRINTF = 1] -printf-frexp [test $REPLACE_VSPRINTF = 1] -printf-frexpl [test $REPLACE_VSPRINTF = 1] -signbit [test $REPLACE_VSPRINTF = 1] -fpucw [test $REPLACE_VSPRINTF = 1] -stdint [test $REPLACE_VSPRINTF = 1] -errno [test $REPLACE_VSPRINTF = 1] +vzsprintf [test $REPLACE_VSPRINTF = 1] +mixin/printf-posix [test $REPLACE_VSPRINTF = 1] +stdint [test $REPLACE_VSPRINTF = 1] +errno [test $REPLACE_VSPRINTF = 1] configure.ac: gl_FUNC_VSPRINTF_POSIX