diff options
author | ngie <ngie@FreeBSD.org> | 2014-12-21 11:11:17 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2014-12-21 11:11:17 +0000 |
commit | 2e865a9c0a939d6b4f62f97bb58386b24b1c24a7 (patch) | |
tree | 32a095e06e5e14a09ea71f78bc44273449b69e91 /lib/libnetbsd/sys/cdefs.h | |
parent | 88d4dfb90e979f0c4afc90a6fb4425f0855ecf95 (diff) | |
download | FreeBSD-src-2e865a9c0a939d6b4f62f97bb58386b24b1c24a7.zip FreeBSD-src-2e865a9c0a939d6b4f62f97bb58386b24b1c24a7.tar.gz |
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)
Diffstat (limited to 'lib/libnetbsd/sys/cdefs.h')
-rw-r--r-- | lib/libnetbsd/sys/cdefs.h | 22 |
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. */ |