From 50d80131875ddf15204098a927235fd5ba270ec6 Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Thu, 7 Mar 2013 18:57:38 -0500 Subject: Add some magic to define __dead on non-BSD systems/where it's undefined --- nmm.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/nmm.c b/nmm.c index cac1f9b..53997c9 100644 --- a/nmm.c +++ b/nmm.c @@ -33,6 +33,22 @@ #include #include #include +#include + +/* + * __dead isn't defined everywhere; although it's typically installed + * in sys/cdefs.h. The following is based off of OpenBSD's + * sys/cdefs.h + */ +#if !defined(__dead) && defined(__dead2) +#define __dead __dead2 +#elif !defined(__dead) && defined(__GNUC__) && !defined(__STRICT_ANSI__) +#define __dead __volatile +#elif !defined(__dead) && !defined(__STRICT_ANSI__) +#define __dead __atribute__((__noreturn__)) +#elif !defined(__dead) +#define __dead /* NORETURN */ +#endif #define VERSION "1.0~beta1" @@ -146,7 +162,7 @@ char *getgname(const game *); void full_redraw(scrgame *); void printinstrs(scrgame *); int gameend(const scrgame *); -__dead void quit(void); +__dead void quit(void); /* During game */ int inmill(const point *); point *mill_handler(scrgame *, char *, int); -- cgit v1.2.3