You are right. Most compilers targeting Microsoft Windows implicitly define _WIN32. A few compilers define WIN32 instead. I do not know which of them exactly, but WIN32 and _WIN32 macros check are mostly used in OpenCV in pare.