From b067a2ba8fa66bf01717a4e8561c4db858055069 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 12 Jul 2011 01:11:07 -0700 Subject: [PATCH] xstrtol: use stdnoreturn.h * lib/xstrtol.h: Include . (_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn. * modules/xstrtol (Depends-on): Add stdnoreturn. --- ChangeLog | 5 +++++ lib/xstrtol.h | 13 ++++--------- modules/xstrtol | 1 + 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index d8bbfd3851..0265180684 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2011-07-12 Paul Eggert + xstrtol: use stdnoreturn.h + * lib/xstrtol.h: Include . + (_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn. + * modules/xstrtol (Depends-on): Add stdnoreturn. + xmemdup0: use stdnoreturn.h * lib/xmemdup0.h: Include . (_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn. diff --git a/lib/xstrtol.h b/lib/xstrtol.h index 716a94ff94..171c3efbef 100644 --- a/lib/xstrtol.h +++ b/lib/xstrtol.h @@ -21,6 +21,7 @@ # include # include +# include # ifndef _STRTOL_ERROR enum strtol_error @@ -51,12 +52,6 @@ _DECLARE_XSTRTOL (xstrtoll, long long int) _DECLARE_XSTRTOL (xstrtoull, unsigned long long int) #endif -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8) -# define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) -#else -# define _GL_ATTRIBUTE_NORETURN /* empty */ -#endif - /* Report an error for an invalid integer in an option argument. ERR is the error code returned by one of the xstrto* functions. @@ -72,8 +67,8 @@ _DECLARE_XSTRTOL (xstrtoull, unsigned long long int) After reporting an error, exit with a failure status. */ -void xstrtol_fatal (enum strtol_error, - int, char, struct option const *, - char const *) _GL_ATTRIBUTE_NORETURN; +void noreturn xstrtol_fatal (enum strtol_error, + int, char, struct option const *, + char const *); #endif /* not XSTRTOL_H_ */ diff --git a/modules/xstrtol b/modules/xstrtol index 66e53427eb..b7c79f1569 100644 --- a/modules/xstrtol +++ b/modules/xstrtol @@ -15,6 +15,7 @@ getopt-gnu gettext-h intprops inttypes-incomplete +stdnoreturn configure.ac: gl_XSTRTOL -- 2.30.2