zaks.anna added a comment. You conditionally defined when you build ON Windows machine, not when you build FOR Windows. You should be able to query the compiler to check which targets it's building for. http://reviews.llvm.org/D18073