X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=c_auto.h;h=9b34f885d13c52cec9c57a58866ad0372ed9e0a4;hb=88eed95d8e5111264869e388468d33b20384cdac;hp=31e89e19b3af75ead206e5c1df491d0efd49c213;hpb=11437ea1ca9b117227bb3f417796582be70116e7;p=ia32rtools.git diff --git a/c_auto.h b/c_auto.h index 31e89e1..9b34f88 100644 --- a/c_auto.h +++ b/c_auto.h @@ -45,6 +45,16 @@ static inline BOOL PtInRect_sa(LPCRECT r, int x, int 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