summaryrefslogtreecommitdiff
path: root/include/bsd
diff options
context:
space:
mode:
authorGuillem Jover <guillem@hadrons.org>2006-02-14 06:43:04 +0000
committerGuillem Jover <guillem@hadrons.org>2008-05-06 08:50:47 +0300
commit815047342080dc3e8eff1daac0a4694d06e1ae03 (patch)
treeb539e5931ed39a8e4d0c534931ffd7b63ca7f15e /include/bsd
parent5372b7368573739ee3bd38c5bb76b187e8241279 (diff)
downloadlibbsd-815047342080dc3e8eff1daac0a4694d06e1ae03.tar.gz
Move some macros to cdefs.h
Diffstat (limited to 'include/bsd')
-rw-r--r--include/bsd/bsd.h14
-rw-r--r--include/bsd/cdefs.h34
2 files changed, 35 insertions, 13 deletions
diff --git a/include/bsd/bsd.h b/include/bsd/bsd.h
index 6dabec4..57690a1 100644
--- a/include/bsd/bsd.h
+++ b/include/bsd/bsd.h
@@ -2,22 +2,10 @@
#define LIBBSD_H
/*
- * Generic definitions.
- */
-
-#define setproctitle(fmt, args...)
-
-#define __dead2
-#define __unused
-#define __printflike(x,y)
-#define __FBSDID(x)
-
-#include <sys/cdefs.h>
-
-/*
* Include all bsd compat headers.
*/
+#include <bsd/cdefs.h>
#include <bsd/random.h>
#include <bsd/string.h>
#include <bsd/queue.h>
diff --git a/include/bsd/cdefs.h b/include/bsd/cdefs.h
new file mode 100644
index 0000000..a23e15e
--- /dev/null
+++ b/include/bsd/cdefs.h
@@ -0,0 +1,34 @@
+#ifndef LIBBSD_CDEFS_H
+#define LIBBSD_CDEFS_H
+
+#include <sys/cdefs.h>
+
+#ifndef setproctitle
+# define setproctitle(fmt, args...)
+#endif
+
+#ifndef __dead2
+# define __dead2
+#endif
+
+#ifndef __unused
+# ifdef __GNUC__
+# define __unused __attribute__((unused))
+# else
+# define __unused
+# endif
+#endif
+
+#ifndef __printflike
+# ifdef __GNUC__
+# define __printflike(x, y) __attribute((format(printf, (x), (y))))
+# else
+# define __printflike(x, y)
+# endif
+#endif
+
+#ifndef __FBSDID
+# define __FBSDID(x)
+#endif
+
+#endif