add to support OS X platform

This patch adds the feature to support OS X platform.

Thanks