This is not the way to do mutual exclusion for OS detection. You need to include the mutual OS header dependencies first at the top. Then only do the check for *_OS_DETECTED here. See the "os/bsd.h" header <https://github.com/boostorg/predef/blob/develop/include/boost/predef/os/bsd.h> for an example.