diff --git a/src/corelib/kernel/qfunctions_winrt.h b/src/corelib/kernel/qfunctions_winrt.h
index 5f051c3ea6cea63a901db00a83e7effa49a9baa7..c43e8bc902b5ac5c752e9dc1b400cafa617a0601 100644
--- a/src/corelib/kernel/qfunctions_winrt.h
+++ b/src/corelib/kernel/qfunctions_winrt.h
@@ -44,8 +44,6 @@
 
 #include <QtCore/qglobal.h>
 
-#ifdef Q_OS_WINRT
-
 #include <QtCore/QThread>
 #include <QtCore/QAbstractEventDispatcher>
 #include <QtCore/qt_windows.h>
@@ -57,6 +55,8 @@ QT_BEGIN_NAMESPACE
 
 QT_END_NAMESPACE
 
+#ifdef Q_OS_WINRT
+
 // Environment ------------------------------------------------------
 errno_t qt_winrt_getenv_s(size_t*, char*, size_t, const char*);
 errno_t qt_winrt__putenv_s(const char*, const char*);
@@ -122,6 +122,8 @@ generate_inline_return_func2(_putenv_s, errno_t, const char *, const char *)
 generate_inline_return_func0(tzset, void)
 generate_inline_return_func0(_tzset, void)
 
+#endif // Q_OS_WINRT
+
 // Convenience macros for handling HRESULT values
 #define RETURN_IF_FAILED(msg, ret) \
     if (FAILED(hr)) { \
@@ -211,5 +213,4 @@ static inline HRESULT await(const Microsoft::WRL::ComPtr<T> &asyncOp, U *results
 
 } // QWinRTFunctions
 
-#endif // Q_OS_WINRT
 #endif // QFUNCTIONS_WINRT_H