1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#define mask 0xffff0000L #define value 0xabcd0000L long foo (long x) { if ((x & mask) == value) return x & 0xffffL; return 1; } int main (void) { if (foo (value) != 0 || foo (0) != 1) abort (); exit (0); }