aboutsummaryrefslogtreecommitdiff
path: root/nmm.c
diff options
context:
space:
mode:
authorRyan Kavanagh <rak@debian.org>2013-03-07 18:57:38 -0500
committerRyan Kavanagh <rak@debian.org>2013-03-07 18:57:38 -0500
commit50d80131875ddf15204098a927235fd5ba270ec6 (patch)
tree957ee94b7eddda1fe67f04682b7820a6547ee790 /nmm.c
parentRelease nmm version 1.0~beta1 (diff)
Add some magic to define __dead on non-BSD systems/where it's undefined
Diffstat (limited to 'nmm.c')
-rw-r--r--nmm.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/nmm.c b/nmm.c
index cac1f9b..53997c9 100644
--- a/nmm.c
+++ b/nmm.c
@@ -33,6 +33,22 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/cdefs.h>
+
+/*
+ * __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);