summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-11-02 08:08:23 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-11-02 08:08:23 +0000
commit64a6f8da1322c7f2c0fb8c8b27bba3d8a0be8f4e (patch)
tree76a08011e0b2972cbb96da41ebf1f54a8903aa79
parenta39b97ef0c1432973b5d815709925a82507c100b (diff)
downloadmandoc-64a6f8da1322c7f2c0fb8c8b27bba3d8a0be8f4e.tar.gz
mandoc-64a6f8da1322c7f2c0fb8c8b27bba3d8a0be8f4e.tar.zst
mandoc-64a6f8da1322c7f2c0fb8c8b27bba3d8a0be8f4e.zip
Using straight-up __attribute__ (inspired by portable openssh).
-rw-r--r--main.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/main.c b/main.c
index 43eba1df..f06831b3 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.54 2009/10/31 06:17:19 kristaps Exp $ */
+/* $Id: main.c,v 1.55 2009/11/02 08:08:23 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -30,18 +30,15 @@
#define UNCONST(a) ((void *)(uintptr_t)(const void *)(a))
-/* Account for FreeBSD and Linux in our declarations. */
+/* FIXME: Intel's compiler? LLVM? pcc? */
+
+#if !defined(__GNUC__) || (__GNUC__ < 2)
+# define __attribute__(x)
+#endif /* !defined(__GNUC__) || (__GNUC__ < 2) */
#ifdef __linux__
extern int getsubopt(char **, char * const *, char **);
extern size_t strlcat(char *, const char *, size_t);
-# ifndef __dead
-# define __dead __attribute__((__noreturn__))
-# endif
-#elif defined(__dead2)
-# ifndef __dead
-# define __dead __dead2
-# endif
#endif
typedef void (*out_mdoc)(void *, const struct mdoc *);
@@ -105,8 +102,8 @@ static int pset(const char *, int, struct curparse *,
struct man **, struct mdoc **);
static struct man *man_init(struct curparse *);
static struct mdoc *mdoc_init(struct curparse *);
-__dead static void version(void);
-__dead static void usage(void);
+static void version(void) __attribute__((noreturn));
+static void usage(void) __attribute__((noreturn));
static const char *progname;
@@ -212,7 +209,7 @@ main(int argc, char *argv[])
}
-__dead static void
+static void
version(void)
{
@@ -221,7 +218,7 @@ version(void)
}
-__dead static void
+static void
usage(void)
{