Maybe you can just set "WINDOWS_BUILD" based on value of Q_OS_WIN or Q_WS_WIN and use that as a check for the actual QHTTPSERVER_API defines? Would reduce a lot of code duplication.