From: Paul Eggert Date: Tue, 12 Jul 2011 08:10:31 +0000 (-0700) Subject: xmemdup0: use stdnoreturn.h X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c2ff7eed84740f5bba5fe72a613e38426ade504;p=pspp xmemdup0: use stdnoreturn.h * lib/xmemdup0.h: Include . (_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn. * modules/xmemdup0 (Depends-on): Add stdnoreturn. --- diff --git a/ChangeLog b/ChangeLog index 1ccafeb050..d8bbfd3851 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2011-07-12 Paul Eggert + xmemdup0: use stdnoreturn.h + * lib/xmemdup0.h: Include . + (_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 . (_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn. diff --git a/lib/xmemdup0.h b/lib/xmemdup0.h index 8a64e70718..fe083b7bd6 100644 --- a/lib/xmemdup0.h +++ b/lib/xmemdup0.h @@ -19,24 +19,19 @@ # define XMEMDUP_H_ # include +# include # 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 d7ea438d7f..aa60a82f39 100644 --- a/modules/xmemdup0 +++ b/modules/xmemdup0 @@ -6,6 +6,7 @@ lib/xmemdup0.h lib/xmemdup0.c Depends-on: +stdnoreturn xalloc configure.ac: