From: Robert Spalek Date: Sat, 1 Jun 2002 09:48:20 +0000 (+0000) Subject: added macro UNALIGNED_PART() X-Git-Tag: holmes-import~1414 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=937ac91933e73a4fafc867f1e3dda4fd1d9e25de;hp=94e33264ee8afcfef49be5f9e098bc87510a5213;p=libucw.git added macro UNALIGNED_PART() --- diff --git a/lib/lib.h b/lib/lib.h index dea7c10c..7b406dd9 100644 --- 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 */