Fix compilation on Mac.

Fixes issue 3167.
Merge pull request #867 from kacfengine/mac_compile_fix

Fix compilation on Mac.