tools: Fix compiling issues on Mac