]> rtime.felk.cvut.cz Git - ulut.git/blobdiff - ulut/ul_utdefs.h
Added constructor, destructor and always_inline attributes to the uLUt definitions.
[ulut.git] / ulut / ul_utdefs.h
index 3cf4b27d0c8a9b275450425b42cede361543295a..5c6526d92237f10bbcc92128588b4f739e7f08cc 100644 (file)
@@ -20,7 +20,7 @@ extern "C" {
 #ifndef UL_OFFSETOF
 /* offset of structure field */
 #define UL_OFFSETOF(_type,_member) \
-                ((int)&(((_type*)0)->_member))
+                ((size_t)&(((_type*)0)->_member))
 #endif /*UL_OFFSET*/
 
 #ifndef UL_CONTAINEROF
@@ -74,6 +74,12 @@ extern "C" {
   __attribute__((const))
 #define        UL_ATTR_UNUSED                          \
   __attribute__((unused))
+#define UL_ATTR_CONSTRUCTOR                    \
+  __attribute__((constructor))
+#define        UL_ATTR_DESCRUCTOR                      \
+  __attribute__((destructor))
+#define        UL_ATTR_ALWAYS_INLINE                   \
+  __attribute__((always_inline))
 #endif  /*UL_ATTR_UNUSED*/
 #else  /* !__GNUC__ */
 #ifndef UL_ATTR_UNUSED
@@ -83,6 +89,9 @@ extern "C" {
 #define UL_ATTR_NORETURN
 #define UL_ATTR_CONST
 #define UL_ATTR_UNUSED
+#define        UL_ATTR_CONSTRUCTOR
+#define        UL_ATTR_DESCRUCTOR
+#define        UL_ATTR_ALWAYS_INLINE
 #endif  /*UL_ATTR_UNUSED*/
 #endif /* !__GNUC__ */