xalloc: use stdnoreturn.h
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 12 Jul 2011 08:11:41 +0000 (01:11 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 12 Jul 2011 08:11:41 +0000 (01:11 -0700)
* lib/xalloc.h: Include <stdnoreturn.h>.
(_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn.
* modules/xalloc (Depends-on): Add stdnoreturn.

ChangeLog
lib/xalloc.h
modules/xalloc

index 0265180684fbaa4f9b57b68f10b56777916d22f5..e555f5a9fa0175a2251108621bc45a20b2e240ba 100644 (file)
--- 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.
index c1bbe7e5b6cedda5e8e39b515fada57a40fc9f41..7dbcc79bb3e85395b3e72aaef8794876d9c0bd02 100644 (file)
@@ -19,6 +19,7 @@
 # define XALLOC_H_
 
 # include <stddef.h>
+# include <stdnoreturn.h>
 
 # include "xalloc-oversized.h"
 
@@ -27,12 +28,6 @@ extern "C" {
 # 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 @@ extern "C" {
    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));
index 19e7a0b93e426e239ef189523985a145d4216371..e96d0574c4682b6141b9a66a34144e826136e913 100644 (file)
@@ -8,6 +8,7 @@ m4/xalloc.m4
 
 Depends-on:
 inline
+stdnoreturn
 xalloc-die
 xalloc-oversized