Mercurial > hg > octave-nkf > gnulib-hg
changeset 15406:4abf2fc74920
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.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Tue, 12 Jul 2011 01:10:31 -0700 |
parents | 7bc53777af61 |
children | c541064d0960 |
files | ChangeLog lib/xmemdup0.h modules/xmemdup0 |
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> + 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.
--- 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);