]> mj.ucw.cz Git - libucw.git/commitdiff
added macro UNALIGNED_PART()
authorRobert Spalek <robert@ucw.cz>
Sat, 1 Jun 2002 09:48:20 +0000 (09:48 +0000)
committerRobert Spalek <robert@ucw.cz>
Sat, 1 Jun 2002 09:48:20 +0000 (09:48 +0000)
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 */