The current code in util/options.cc fails to build for me on OS X because of the two uses of setmode(<file>, _O_BINARY). It seems that I have a setmode function, so HAVE_SETMODE is true, but it's not actually the same thing as you were expecting on Win32.