From 2e865a9c0a939d6b4f62f97bb58386b24b1c24a7 Mon Sep 17 00:00:00 2001 From: ngie Date: Sun, 21 Dec 2014 11:11:17 +0000 Subject: MFC r273482,r274078: r273482: 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 r274078: Commit missing header for sys/time.h compat on NetBSD to unbreak the amd64/i386 build Pointyhat to: me (forgot to svn add it sooner) --- lib/libnetbsd/sys/cdefs.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'lib/libnetbsd/sys/cdefs.h') 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. */ -- cgit v1.1