Make #ifdef Q_OS_WIN work as intended
(cherry picked from commit 80a709a19579b8ecb8bfc3a44f37f15b0f5a87b7)