24#define DWORD_PTR UINT_PTR
25#define LONG_PTR INT_PTR
26#define ULONG_PTR UINT_PTR
32#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
33# define _TYPE_ALIGNMENT(type) __alignof(type)
34#elif defined(__GNUC__)
35# define _TYPE_ALIGNMENT(type) __alignof__(type)
44#if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus)
45#pragma warning(disable:4116)
48#if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT)
49# define TYPE_ALIGNMENT _TYPE_ALIGNMENT
56#define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size);
59# define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align);
61# define TEST_TYPE_ALIGN(type, align)
65# define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align);
66# define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align);
68# define TEST_TARGET_ALIGN(type, align)
69# define TEST_FIELD_ALIGN(type, field, align)
72#define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset);
74#define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size)
75#define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size)
76#define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0);
77#define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0);