add darwin platform support
Merge pull request #7 from oranzhang/master

add darwin platform support