Fix includes to get needed prototype.
Add OSX specific hack as it seems to hide information we need.