X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=c_auto.h;h=b3b1afc162ae2f8ca249f1c144d6bbabe36f2708;hb=f9d7b4610c82104c07202a6557bae7228e45c6ca;hp=5e4564bb86222321bae479d547596938b40b01a7;hpb=04abc5d640b0c379928b434a9c0df83d5f650788;p=ia32rtools.git diff --git a/c_auto.h b/c_auto.h index 5e4564b..b3b1afc 100644 --- a/c_auto.h +++ b/c_auto.h @@ -35,17 +35,32 @@ typedef struct { #define BYTE2(x) (*((u8*)&(x)+2)) #define BYTE3(x) (*((u8*)&(x)+3)) +#ifndef __WINE__ +#define DECL_IMPORT __declspec(dllimport) +#else +#define DECL_IMPORT +#endif + #define memcpy_0 memcpy #define noreturn __attribute__((noreturn)) -#ifdef __WINE__ -#define PCVOID LPCVOID -#define __VALIST __ms_va_list -#endif - static inline BOOL PtInRect_sa(LPCRECT r, int x, int y) { POINT p = { x, y }; return PtInRect(r, p); } + +static inline int do_parity(unsigned int v) +{ + v ^= v >> 4; + v ^= v >> 2; + v ^= v >> 1; + return (v ^ 1) & 1; +} + +#define do_skip_code_abort() \ + printf("%s:%d: skip_code_abort\n", __FILE__, __LINE__); \ + *(volatile int *)0 = 1 + +// vim:ts=2:sw=2:expandtab