diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-08-07 21:33:04 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-08-07 21:33:04 +0000 |
commit | 39a6e64a5761ac6741b602ccf1bfadee1a8a7f57 (patch) | |
tree | 243f4cfc0a477d49114de03830f65981fbfc6bd9 /sys | |
parent | f07218a3cfdef56cf901360d3ea6fd46979f4509 (diff) |
For gcc >= 2.5 #define __dead and __pure using the __noreturn__
and __const__ attributes.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/cdefs.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 8b9266896a6..c4fb3c9a9cf 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cdefs.h,v 1.6 2001/08/07 19:13:23 art Exp $ */ +/* $OpenBSD: cdefs.h,v 1.7 2001/08/07 21:33:03 millert Exp $ */ /* $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $ */ /* @@ -123,9 +123,9 @@ * GCC1 and some versions of GCC2 declare dead (non-returning) and * pure (no side effects) functions using "volatile" and "const"; * unfortunately, these then cause warnings under "-ansi -pedantic". - * GCC2 uses a new, peculiar __attribute__((attrs)) style. All of - * these work for GNU C++ (modulo a slight glitch in the C++ grammar - * in the distribution version of 2.5.5). + * GCC >= 2.5 uses the __attribute__((attrs)) style. All of these + * work for GNU C++ (modulo a slight glitch in the C++ grammar in + * the distribution version of 2.5.5). */ #if !__GNUC_PREREQ__(2, 5) @@ -134,6 +134,9 @@ #define __dead __volatile #define __pure __const #endif +#elif !defined(__STRICT_ANSI__) +#define __dead __attribute__((__noreturn__)) +#define __pure __attribute__((__const__)) #endif /* |