Doing switch at compile time rather than runtime

This works as different binaries are built for 32bit and 64bit code.