Attempt to fix build for Mac OS X builds with gcc. I've only tested the clang build so far, and it still works fine with this patch.
Please test Sadakazu & Matteo if your problems are gone.