Preprocessing primality The challenge:

Given an integer N, 1 &lt; N &lt; 2³¹, write code that uses the C preprocessor 
to determine whether N is prime, and produces a "Hello world" program if N is prime, 
or an error otherwise. Make the code as short as possible. 
It's not very hard, so don't worry that there are so many rules; most 
of them are boilerplate.

The following sample code (in example.c) works for N &lt; 100:

#include &lt;stdio.h&gt;
int main() {
#if (N%2!=0 &amp;&amp; N%3!=0 &amp;&amp; N%5!=0 &amp;&amp; N%7!=0) || (2==N || 3==N || 5==N || 7==N)
printf("Hello world!");
#else
Walkmen;
#endif
}


23 is prime but 99 is not, so:

c:\golf\preprime&gt;gcc -std=c99 -DN=23 example.c

c:\golf\preprime&gt;a
Hello world!
c:\golf\preprime&gt;gcc -std=c99 -DN=99 example.c
example.c: In function 'main':
example.c:6:1: error: 'Walkmen' undeclared (first use in this function)
 Walkmen;
 ^
example.c:6:1: note: each undeclared identifier is reported only once for each function it appears in
c:\golf\preprime&gt;


Rules


1 &lt; N &lt; 2147483648
N will be defined in a macro named N. N will be written using only the characters 0123456789 and will not begin with 0.
The code will be compiled with the command gcc -std=c99 -DN=&lt;number&gt; &lt;filename&gt;.c [-o &lt;outfile&gt;]
If N is prime, a valid C99 program must be successfully compiled. When executed, the program's output to stdout must be precisely Hello world! followed by zero or more newlines.
If N is composite, gcc must emit a compiler error. A linker error is not acceptable.
You may not utilize any GCC extensions.
You may not assume anything about the name of any file.
Note: It is not allowed to use implicit types or implicit function declarations.
Neither gcc nor any "Hello world" program may take more than 20 seconds to execute on a typical computer.
Shortest code length in UTF-8 bytes wins.


For reference, my ungolfed implementation is 571 bytes. Happy golfing!
441 characters

OK, here is another approach — this time breaking things down into a giant binary tree of tests. I was hoping this could be done recursively, but the C preprocessor doesn't support recursive functions...so I did this as a fallback.

Algorithm: This tests N for divisibility by 2 and by all odd numbers up to the square root of 2³². (Note: That's a bit of overkill, because it need only test potential divisors up to the square root of 2³¹, but it's easier to stick to powers of 2.)

#define A(x) (N%(x)||N==x)
#define B(x) A(x)&amp;A(x+2)&amp;A(x+4)&amp;A(x+6)
#define C(x) B(x)&amp;B(x+8)&amp;B(x+16)&amp;B(x+24)
#define D(x) C(x)&amp;C(x+32)&amp;C(x+64)&amp;C(x+96)
#define E(x) D(x)&amp;D(x+128)&amp;D(x+256)&amp;D(x+384)
#define F(x) E(x)&amp;E(x+512)&amp;E(x+1024)&amp;E(x+1536)
#define G(x) F(x)&amp;F(x+2048)&amp;F(x+4096)&amp;F(x+6144)
#define H(x) G(x)&amp;G(x+8192)&amp;G(x+16384)&amp;G(x+24576)
#include &lt;stdio.h&gt;
int main(){
#if A(2)&amp;H(3)&amp;H(32771)
printf("Hello world!");
#else
Walkmen;
#endif
}


Notes:


The value 32771 is really just 3+32768.
Yes, the parentheses around x in N%(x) are indeed needed (but not in N==x).
Compiles as per instructions and obeys rules of output.
Elapsed time for each test of N (e.g., each invocation of the compiler) is about 1/6 second on my machine.