From: Guillem Jover Date: Fri, 31 Oct 2014 23:20:23 +0000 (+0100) Subject: Add __DECONST, __DEVOLATILE and __DEQUALIFY macros to sys/cdefs.h X-Git-Tag: 0.8.0~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0e4e3ab2698a29a329beb5b85b9da5d425e296a6;p=thirdparty%2Flibbsd.git Add __DECONST, __DEVOLATILE and __DEQUALIFY macros to sys/cdefs.h Import from FreeBSD. --- diff --git a/include/bsd/sys/cdefs.h b/include/bsd/sys/cdefs.h index c08d68d..c1567be 100644 --- a/include/bsd/sys/cdefs.h +++ b/include/bsd/sys/cdefs.h @@ -138,4 +138,16 @@ # define __COPYRIGHT(x) #endif +#ifndef __DECONST +#define __DECONST(type, var) ((type)(__uintptr_t)(const void *)(var)) +#endif + +#ifndef __DEVOLATILE +#define __DEVOLATILE(type, var) ((type)(__uintptr_t)(volatile void *)(var)) +#endif + +#ifndef __DEQUALIFY +#define __DEQUALIFY(type, var) ((type)(__uintptr_t)(const volatile void *)(var)) +#endif + #endif