>From 9b9649b8098529adfec2ff2e93fddab0637cfdfa Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 8 May 2020 18:07:17 +0200 Subject: [PATCH 2/4] c32rtomb: Use module 'attribute'. * lib/c32rtomb.c: Include attribute.h. (FALLTHROUGH): Remove macro. * modules/c32rtomb (Depends-on): Add attribute. --- ChangeLog | 7 +++++++ lib/c32rtomb.c | 9 +-------- modules/c32rtomb | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index df4f5d1..43946e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2020-05-08 Bruno Haible + c32rtomb: Use module 'attribute'. + * lib/c32rtomb.c: Include attribute.h. + (FALLTHROUGH): Remove macro. + * modules/c32rtomb (Depends-on): Add attribute. + +2020-05-08 Bruno Haible + xsize: Use module 'attribute'. * lib/xsize.h: Include attribute.h. Use ATTRIBUTE_PURE. * modules/xsize (Depends-on): Add attribute. diff --git a/lib/c32rtomb.c b/lib/c32rtomb.c index ba39929..8e4fb56 100644 --- a/lib/c32rtomb.c +++ b/lib/c32rtomb.c @@ -24,17 +24,10 @@ #include #include +#include "attribute.h" /* FALLTHROUGH */ #include "localcharset.h" #include "streq.h" -#ifndef FALLTHROUGH -# if __GNUC__ < 7 -# define FALLTHROUGH ((void) 0) -# else -# define FALLTHROUGH __attribute__ ((__fallthrough__)) -# endif -#endif - size_t c32rtomb (char *s, char32_t wc, mbstate_t *ps) #undef c32rtomb diff --git a/modules/c32rtomb b/modules/c32rtomb index ea227df..9863d70 100644 --- a/modules/c32rtomb +++ b/modules/c32rtomb @@ -8,6 +8,7 @@ m4/mbrtoc32.m4 Depends-on: uchar +attribute [test $HAVE_C32RTOMB = 0 || test $REPLACE_C32RTOMB = 1] wchar [test $HAVE_C32RTOMB = 0 || test $REPLACE_C32RTOMB = 1] wcrtomb [test $HAVE_C32RTOMB = 0 || test $REPLACE_C32RTOMB = 1] localcharset [{ test $HAVE_C32RTOMB = 0 || test $REPLACE_C32RTOMB = 1; } && test $SMALL_WCHAR_T = 1] -- 2.7.4