bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH 14/19] openat: use stdnoreturn.h


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

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

diff --git a/ChangeLog b/ChangeLog
index fff4c98..aa37a49 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-07-10  Paul Eggert  <address@hidden>
 
+       openat: use stdnoreturn.h
+       * lib/openat.h: Include <stdnoreturn.h>.
+       (_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn.
+       * modules/openat (Depends-on): Add stdnoreturn.
+
        * lib/openat-die.c (openat_save_fail): Modernize comment.
 
        * lib/xalloc-die.c (xalloc_die): Modernize comment.
diff --git a/lib/openat.h b/lib/openat.h
index 5cb1866..d1e7433 100644
--- a/lib/openat.h
+++ b/lib/openat.h
@@ -26,12 +26,7 @@
 #include <dirent.h>
 #include <unistd.h>
 #include <stdbool.h>
-
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
-# define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
-#else
-# define _GL_ATTRIBUTE_NORETURN /* empty */
-#endif
+#include <stdnoreturn.h>
 
 #if !HAVE_OPENAT
 
@@ -47,8 +42,8 @@ bool openat_needs_fchdir (void);
 
 #endif
 
-void openat_restore_fail (int) _GL_ATTRIBUTE_NORETURN;
-void openat_save_fail (int) _GL_ATTRIBUTE_NORETURN;
+noreturn void openat_restore_fail (int);
+noreturn void openat_save_fail (int);
 
 /* Using these function names makes application code
    slightly more readable than it would be with
diff --git a/modules/openat b/modules/openat
index b9ce4d4..06a4c75 100644
--- a/modules/openat
+++ b/modules/openat
@@ -32,6 +32,7 @@ openat-die
 rmdir           [test $REPLACE_UNLINKAT = 1]
 save-cwd
 stdbool
+stdnoreturn
 sys_stat
 unistd
 unlink          [test $REPLACE_UNLINKAT = 1]
-- 
1.7.4.4



reply via email to

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