1 // note: include after system headers
3 //#pragma GCC diagnostic ignored "-Wparentheses"
22 #define _WORD uint16_t
23 #define _DWORD uint32_t
24 #define _UNKNOWN uint8_t
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))
39 #define DECL_IMPORT __declspec(dllimport)
44 #define memcpy_0 memcpy
46 #define noreturn __attribute__((noreturn))
48 static inline BOOL PtInRect_sa(LPCRECT r, int x, int y)
51 return PtInRect(r, p);
54 static inline int do_parity(unsigned int v)
62 #define do_skip_code_abort() \
63 printf("%s:%d: skip_code_abort\n", __FILE__, __LINE__); \
64 *(volatile int *)0 = 1
67 asm volatile("" ::: "memory")
69 /* gcc always emits vldr/vstr which requires alignment,
70 * so in some cases these unaligned helpers are needed */
73 static inline float float_load(u32 ptr)
75 register float v asm("s0");
77 asm ("vld1.32 {d0[0]}, [%1]"
78 : "=t"(v) : "r"(ptr));
83 static inline void float_store(float v, u32 ptr)
85 register float v1 asm("s0") = v;
87 asm ("vst1.32 {d0[0]}, [%1]"
88 : : "t"(v1), "r"(ptr) : "memory");
93 static inline float float_load(u32 ptr)
95 return *(const float *)ptr;
98 static inline void float_store(float v, u32 ptr)
105 // vim:ts=2:sw=2:expandtab