| 1 | // note: include after system headers |
| 2 | |
| 3 | //#pragma GCC diagnostic ignored "-Wparentheses" |
| 4 | |
| 5 | #define u8 uint8_t |
| 6 | #define u16 uint16_t |
| 7 | #define u32 uint32_t |
| 8 | #define u64 uint64_t |
| 9 | #define s8 int8_t |
| 10 | #define s16 int16_t |
| 11 | #define s32 int32_t |
| 12 | #define s64 int64_t |
| 13 | typedef struct { |
| 14 | u64 q; |
| 15 | u32 d[2]; |
| 16 | u16 w[4]; |
| 17 | u8 b[8]; |
| 18 | } mmxr; |
| 19 | |
| 20 | #define bool int |
| 21 | #define _BYTE uint8_t |
| 22 | #define _WORD uint16_t |
| 23 | #define _DWORD uint32_t |
| 24 | #define _UNKNOWN uint8_t |
| 25 | #undef LOBYTE |
| 26 | #undef LOWORD |
| 27 | #undef HIBYTE |
| 28 | #undef HIWORD |
| 29 | #define LOBYTE(x) (*((u8*)&(x))) |
| 30 | #define LOWORD(x) (*((u16*)&(x))) |
| 31 | #define HIBYTE(x) (*((u8*)&(x)+1)) |
| 32 | #define HIWORD(x) (*((u16*)&(x)+1)) |
| 33 | #define BYTE0(x) (*((u8*)&(x)+0)) |
| 34 | #define BYTE1(x) (*((u8*)&(x)+1)) |
| 35 | #define BYTE2(x) (*((u8*)&(x)+2)) |
| 36 | #define BYTE3(x) (*((u8*)&(x)+3)) |
| 37 | |
| 38 | #ifndef __WINE__ |
| 39 | #define DECL_IMPORT __declspec(dllimport) |
| 40 | #else |
| 41 | #define DECL_IMPORT |
| 42 | #endif |
| 43 | |
| 44 | #define memcpy_0 memcpy |
| 45 | |
| 46 | #define noreturn __attribute__((noreturn)) |
| 47 | |
| 48 | static inline BOOL PtInRect_sa(LPCRECT r, int x, int y) |
| 49 | { |
| 50 | POINT p = { x, y }; |
| 51 | return PtInRect(r, p); |
| 52 | } |
| 53 | |
| 54 | static inline int do_parity(unsigned int v) |
| 55 | { |
| 56 | v ^= v >> 4; |
| 57 | v ^= v >> 2; |
| 58 | v ^= v >> 1; |
| 59 | return (v ^ 1) & 1; |
| 60 | } |
| 61 | |
| 62 | #define do_skip_code_abort() \ |
| 63 | printf("%s:%d: skip_code_abort\n", __FILE__, __LINE__); \ |
| 64 | *(volatile int *)0 = 1 |
| 65 | |
| 66 | // vim:ts=2:sw=2:expandtab |