summaryrefslogtreecommitdiffstats
path: root/main.c
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
commit41716fe6c55a74e00a0a9593d42872cd43e56780 (patch)
treeb09d5fe727b0275879aaa6ef5d161b8679995ed5 /main.c
parentd612b79e06155082b6342af68940fa671568998d (diff)
downloadmandoc-41716fe6c55a74e00a0a9593d42872cd43e56780.tar.gz
Using straight-up __attribute__ (inspired by portable openssh).
Diffstat (limited to 'main.c')
-rw-r--r--main.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/main.c b/main.c
index 14d66747..f8b5c597 100644
--- a/main.c
+++ b/main.c
@@ -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)
{