]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
Move some macros to cdefs.h
authorGuillem Jover <guillem@hadrons.org>
Tue, 14 Feb 2006 06:43:04 +0000 (06:43 +0000)
committerGuillem Jover <guillem@hadrons.org>
Tue, 6 May 2008 05:50:47 +0000 (08:50 +0300)
ChangeLog
Makefile
include/bsd/bsd.h
include/bsd/cdefs.h [new file with mode: 0644]

index 7e04cd6a6125a1b0b0463104224b4f6433a95da9..08c0fcd88d69a79fd585bcf238113580b88db2de 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-02-14  Guillem Jover  <guillem@debian.org>
+
+       * include/bsd/bsd.h (setproctitle, __dead2, __unused, __printflike)
+       (__FBSDID): Moved to ...
+       * include/bsd/cdefs.h: ... here.
+       (__unused, __printflike) [__GNUC__]: Use proper __attribute__.
+       * Makefile (LIB_INCLUDES): Add 'cdefs.h'.
+
 2006-02-14  Guillem Jover  <guillem@debian.org>
 
        * arc4random.c: Move to ...
index 3e6b2ccfd18722ac619cb1e655edb47f82eb4049..eea93c2999d451c199fbcb1a71a008f36e0c5a1b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ LIB_SRCS := arc4random.c bsd_getopt.c err.c fgetln.c inet_net_pton.c \
 LIB_SRCS := $(patsubst %,src/%,$(LIB_SRCS))
 
 LIB_INCLUDES := err.h getopt.h ip_icmp.h random.h queue.h md5.h string.h \
-               bsd.h stdlib.h
+               bsd.h cdefs.h stdlib.h
 LIB_INCLUDES := $(patsubst %,include/bsd/%,$(LIB_INCLUDES))
 
 LIB_MANS := arc4random.3 strlcpy.3 fgetln.3 fmtcheck.3
index 6dabec42be3a32f16edc10ce0179a6af9ee7d612..57690a1fd29a78a4f79cdeac002fc52ad5822baf 100644 (file)
@@ -1,23 +1,11 @@
 #ifndef LIBBSD_H
 #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 (file)
index 0000000..a23e15e
--- /dev/null
@@ -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