Changed #if directives to #if defined.
Merge pull request #586 from Morwenn/if_to_ifdef

Changed #if directives to #if defined.