summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGuillem Jover <guillem@hadrons.org>2014-11-01 00:20:23 +0100
committerGuillem Jover <guillem@hadrons.org>2015-09-23 07:59:24 +0200
commit0e4e3ab2698a29a329beb5b85b9da5d425e296a6 (patch)
tree3adf9368d76571cff179f21b62e1c03091683a36 /include
parenta6fe103c1b4ff4ae8d78840ed964dc632ccd4d7c (diff)
Add __DECONST, __DEVOLATILE and __DEQUALIFY macros to sys/cdefs.h
Import from FreeBSD.
Diffstat (limited to 'include')
-rw-r--r--include/bsd/sys/cdefs.h12
1 files changed, 12 insertions, 0 deletions
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