Replace ifdef with if for conditional compilation


I had a problem when I use this library on OS X.
And I found that a conditional compilation is not correct: it should use `#if` instead of `#ifdef`. ([more info](http://stackoverflow.com/questions/13255645/use-pragma-ifdef-to-conditionally-compile-the-same-protocol-header-for-both-mac))