add conditions for mac os
Merge pull request #145 from hpicgs/apple_support/preproc

add conditions for mac os