]> mj.ucw.cz Git - libucw.git/blobdiff - lib/lib.h
added macro UNALIGNED_PART()
[libucw.git] / lib / lib.h
index dea7c10c8929fa7fe923d24f69bbb78d12204e0a..7b406dd90fa36289f665a47dbc40453b14c5cede 100644 (file)
--- a/lib/lib.h
+++ b/lib/lib.h
@@ -24,6 +24,7 @@
 #define OFFSETOF(s, i) ((unsigned int)&((s *)0)->i)
 #define SKIP_BACK(s, i, p) ((s *)((char *)p - OFFSETOF(s, i)))
 #define ALIGN(s, a) (((s)+a-1)&~(a-1))
+#define UNALIGNED_PART(ptr, type) (((long) (ptr)) % sizeof(type))
 
 /* Some other macros */