18#define DWORD_PTR UINT_PTR
19#define LONG_PTR INT_PTR
20#define ULONG_PTR UINT_PTR
26#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
27# define _TYPE_ALIGNMENT(type) __alignof(type)
28#elif defined(__GNUC__)
29# define _TYPE_ALIGNMENT(type) __alignof__(type)
38#if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus)
39#pragma warning(disable:4116)
42#if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT)
43# define TYPE_ALIGNMENT _TYPE_ALIGNMENT
50#define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size);
53# define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align);
55# define TEST_TYPE_ALIGN(type, align)
59# define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align);
60# define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align);
62# define TEST_TARGET_ALIGN(type, align)
63# define TEST_FIELD_ALIGN(type, field, align)
66#define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset);
68#define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size)
69#define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size)
70#define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0);
71#define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0);