Multiuser, Capabilities and Access Controls (#54)
[lunaix-os.git] / lunaix-os / includes / lunaix / types.h
index f74c9b8143839b80925ec8275d29bdc4c6742925..6ce5fcf3b71873e3ea2b7ce4243c03bff658aac0 100644 (file)
@@ -2,6 +2,7 @@
 #define __LUNAIX_TYPES_H
 
 #include <lunaix/compiler.h>
+#include <lunaix/limits.h>
 #include <stdarg.h>
 #include <usr/lunaix/types.h>
 
@@ -47,7 +48,10 @@ typedef int bool;
     })
 
 #define offset(data, off)   \
-            ((void*)(__ptr(data) + (off)))
+            ((typeof(data))(__ptr(data) + (off)))
+
+#define offset_t(data, type, off)   \
+            ((type*)(__ptr(data) + (off)))
 
 #define __ptr(val)      ((ptr_t)(val))