changeset 15404:8b6031ce6910

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.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 12 Jul 2011 01:09:30 -0700
parents 73b69bb944ff
children 7bc53777af61
files ChangeLog lib/openat.h modules/openat
diffstat 3 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-07-12  Paul Eggert  <eggert@cs.ucla.edu>
 
+	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.
--- 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 @@
 
 #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
--- a/modules/openat
+++ b/modules/openat
@@ -32,6 +32,7 @@
 rmdir           [test $REPLACE_UNLINKAT = 1]
 save-cwd
 stdbool
+stdnoreturn
 sys_stat
 unistd
 unlink          [test $REPLACE_UNLINKAT = 1]