changeset 15407:c541064d0960

xstrtol: use stdnoreturn.h * lib/xstrtol.h: Include <stdnoreturn.h>. (_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn. * modules/xstrtol (Depends-on): Add stdnoreturn.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 12 Jul 2011 01:11:07 -0700
parents 4abf2fc74920
children e2e50853cc09
files ChangeLog lib/xstrtol.h modules/xstrtol
diffstat 3 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-07-12  Paul Eggert  <eggert@cs.ucla.edu>
 
+	xstrtol: use stdnoreturn.h
+	* lib/xstrtol.h: Include <stdnoreturn.h>.
+	(_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn.
+	* modules/xstrtol (Depends-on): Add stdnoreturn.
+
 	xmemdup0: use stdnoreturn.h
 	* lib/xmemdup0.h: Include <stdnoreturn.h>.
 	(_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn.
--- a/lib/xstrtol.h
+++ b/lib/xstrtol.h
@@ -21,6 +21,7 @@
 
 # include <getopt.h>
 # include <inttypes.h>
+# include <stdnoreturn.h>
 
 # ifndef _STRTOL_ERROR
 enum strtol_error
@@ -51,12 +52,6 @@
 _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 @@
 
    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_ */
--- a/modules/xstrtol
+++ b/modules/xstrtol
@@ -15,6 +15,7 @@
 gettext-h
 intprops
 inttypes-incomplete
+stdnoreturn
 
 configure.ac:
 gl_XSTRTOL