bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 16/19] xmemdup0: use stdnoreturn.h


From: Paul Eggert
Subject: [PATCH 16/19] xmemdup0: use stdnoreturn.h
Date: Sun, 10 Jul 2011 22:27:15 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10

* lib/xmemdup0.h: Include <stdnoreturn.h>.
(_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn.
* modules/xmemdup0 (Depends-on): Add stdnoreturn.
---
 ChangeLog        |    5 +++++
 lib/xmemdup0.h   |    9 ++-------
 modules/xmemdup0 |    1 +
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9d45f7c..832ca2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-07-10  Paul Eggert  <address@hidden>
 
+       xmemdup0: use stdnoreturn.h
+       * lib/xmemdup0.h: Include <stdnoreturn.h>.
+       (_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn.
+       * modules/xmemdup0 (Depends-on): Add stdnoreturn.
+
        sigpipe-die: use stdnoreturn.h
        * lib/sigpipe-die.h: Include <stdnoreturn.h>.
        (_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn.
diff --git a/lib/xmemdup0.h b/lib/xmemdup0.h
index 8a64e70..fe083b7 100644
--- a/lib/xmemdup0.h
+++ b/lib/xmemdup0.h
@@ -19,24 +19,19 @@
 # define XMEMDUP_H_
 
 # include <stddef.h>
+# include <stdnoreturn.h>
 
 
 # ifdef __cplusplus
 extern "C" {
 # endif
 
-# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
-#  define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
-# else
-#  define _GL_ATTRIBUTE_NORETURN /* empty */
-# endif
-
 /* This function is always triggered when memory is exhausted.
    It must be defined by the application, either explicitly
    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);
 
 char *xmemdup0 (void const *p, size_t s);
 
diff --git a/modules/xmemdup0 b/modules/xmemdup0
index d7ea438..aa60a82 100644
--- a/modules/xmemdup0
+++ b/modules/xmemdup0
@@ -6,6 +6,7 @@ lib/xmemdup0.h
 lib/xmemdup0.c
 
 Depends-on:
+stdnoreturn
 xalloc
 
 configure.ac:
-- 
1.7.4.4



reply via email to

[Prev in Thread] Current Thread [Next in Thread]