@@ -280,22 +280,22 @@ typedef unsigned char byte;
#endif
/* Compile time assertions */
#if defined(__OS2__)
#define assert_compile(expr)
#else
#define assert_compile(expr) extern "C" void __ct_assert__(int a[1 - 2 * !(expr)])
#define assert_compile(expr) extern const int __ct_assert__[1 - 2 * !(expr)]
#endif /* __OS2__ */
/* Check if the types have the bitsizes like we are using them */
assert_compile(sizeof(uint64) == 8);
assert_compile(sizeof(uint32) == 4);
assert_compile(sizeof(uint16) == 2);
assert_compile(sizeof(uint8) == 1);
#define lengthof(x) (sizeof(x)/sizeof(x[0]))
#define lengthof(x) (sizeof(x) / sizeof(x[0]))
#define endof(x) (&x[lengthof(x)])
#define lastof(x) (&x[lengthof(x) - 1])
#define cpp_offsetof(s, m) (((size_t)&reinterpret_cast<const volatile char&>((((s*)(char*)8)->m))) - 8)
#if !defined(offsetof)
#define offsetof(s, m) cpp_offsetof(s, m)