Commit 0e4e3ab2698a29a329beb5b85b9da5d425e296a6

Guillem Jover 2014-11-01T00:20:23

Add __DECONST, __DEVOLATILE and __DEQUALIFY macros to sys/cdefs.h Import from FreeBSD.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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