summaryrefslogtreecommitdiffstats
path: root/lib/libnetbsd/sys
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2014-10-22 21:04:54 +0000
committerngie <ngie@FreeBSD.org>2014-10-22 21:04:54 +0000
commit2968266dee4823f1a3ca123abdaec941c303de06 (patch)
tree40bbf35c3c2322d735e78db5b3f1f2ef7ac45c6c /lib/libnetbsd/sys
parent5777570c4bae8462e162a47640808c4025fd8108 (diff)
downloadFreeBSD-src-2968266dee4823f1a3ca123abdaec941c303de06.zip
FreeBSD-src-2968266dee4823f1a3ca123abdaec941c303de06.tar.gz
The NetBSD libc tests use several definitions/macros that aren't available in
FreeBSD Add the missing compat definitions/macros to lib/libnetbsd so the testcases can be compiled with libnetbsd without having to invent ad hoc #define's, or having to convert things over to FreeBSD idioms Reviewed by: brooks Phabric: D993 Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'lib/libnetbsd/sys')
-rw-r--r--lib/libnetbsd/sys/cdefs.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/libnetbsd/sys/cdefs.h b/lib/libnetbsd/sys/cdefs.h
index 09a7ca4..051959f 100644
--- a/lib/libnetbsd/sys/cdefs.h
+++ b/lib/libnetbsd/sys/cdefs.h
@@ -42,6 +42,28 @@
#endif
/*
+ * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
+ * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
+ * The __CONCAT macro is a bit tricky -- make sure you don't put spaces
+ * in between its arguments. __CONCAT can also concatenate double-quoted
+ * strings produced by the __STRING macro, but this only works with ANSI C.
+ */
+
+#define ___STRING(x) __STRING(x)
+#define ___CONCAT(x,y) __CONCAT(x,y)
+
+/*
+ * The following macro is used to remove const cast-away warnings
+ * from gcc -Wcast-qual; it should be used with caution because it
+ * can hide valid errors; in particular most valid uses are in
+ * situations where the API requires it, not to cast away string
+ * constants. We don't use *intptr_t on purpose here and we are
+ * explicit about unsigned long so that we don't have additional
+ * dependencies.
+ */
+#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
+
+/*
* Return the number of elements in a statically-allocated array,
* __x.
*/
OpenPOWER on IntegriCloud