Use constantnames
Fix headerfileguard
Fix compilation on osx
Fix some warnings on osx and bsd
Differentiate between bsd and osx