changeset 15408:e2e50853cc09

xalloc: use stdnoreturn.h * lib/xalloc.h: Include <stdnoreturn.h>. (_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn. * modules/xalloc (Depends-on): Add stdnoreturn.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 12 Jul 2011 01:11:41 -0700
parents c541064d0960
children 21013258dc33
files ChangeLog lib/xalloc.h modules/xalloc
diffstat 3 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-07-12  Paul Eggert  <eggert@cs.ucla.edu>
 
+	xalloc: use stdnoreturn.h
+	* lib/xalloc.h: Include <stdnoreturn.h>.
+	(_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn.
+	* modules/xalloc (Depends-on): Add stdnoreturn.
+
 	xstrtol: use stdnoreturn.h
 	* lib/xstrtol.h: Include <stdnoreturn.h>.
 	(_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn.
--- a/lib/xalloc.h
+++ b/lib/xalloc.h
@@ -19,6 +19,7 @@
 # define XALLOC_H_
 
 # include <stddef.h>
+# include <stdnoreturn.h>
 
 # include "xalloc-oversized.h"
 
@@ -27,12 +28,6 @@
 # endif
 
 
-# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
-#  define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
-# else
-#  define _GL_ATTRIBUTE_NORETURN /* empty */
-# endif
-
 # if __GNUC__ >= 3
 #  define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
 # else
@@ -50,7 +45,7 @@
    or by using gnulib's xalloc-die module.  This is the
    function to call when one wants the program to die because of a
    memory allocation failure.  */
-extern void xalloc_die (void) _GL_ATTRIBUTE_NORETURN;
+extern noreturn void xalloc_die (void);
 
 void *xmalloc (size_t s)
       _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1));
--- a/modules/xalloc
+++ b/modules/xalloc
@@ -8,6 +8,7 @@
 
 Depends-on:
 inline
+stdnoreturn
 xalloc-die
 xalloc-oversized