summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorSergio Martins <sergio.martins@kdab.com>2019-05-06 15:44:49 +0100
committerSérgio Martins <sergio.martins@kdab.com>2019-05-08 17:22:01 +0000
commit9444416a46ee0e6bb0d9d9be9a4883b388644c59 (patch)
treeac43b3a6bd23a431744ba2ad70bb92ac516ea7d1 /src/corelib
parentc6bee8e4b2c48775247c67ef8e7569f623655c61 (diff)
Define Q_OS_WINDOWS, make it an alias to Q_OS_WIN
As seen in several occasions, both in user code and in Qt proper, people make these mistakes. What makes it harder to spot is that it doesn't look like a typo, and feels natural (natural as Q_OS_LINUX instead of Q_OS_LIN feels). There's been a P1 in qtdeclarative/ and currently there's a Q_OS_WINDOWS usage in qtwebengine. This is a recurring problem, no matter how much people test and review these errors will happen, so the alias is justified. Change-Id: If6943b52e17f0c8b238c36bb1f7834802123f12a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qglobal.cpp7
-rw-r--r--src/corelib/global/qsystemdetection.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 8d80a32ad5..555b04dcd5 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1401,6 +1401,13 @@ bool qSharedBuild() Q_DECL_NOTHROW
*/
/*!
+ \macro Q_OS_WINDOWS
+ \relates <QtGlobal>
+
+ This is a synonym for Q_OS_WIN.
+*/
+
+/*!
\macro Q_OS_WIN32
\relates <QtGlobal>
diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h
index aabe46f3c2..a2e51fa330 100644
--- a/src/corelib/global/qsystemdetection.h
+++ b/src/corelib/global/qsystemdetection.h
@@ -176,6 +176,7 @@
#endif
#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) || defined(Q_OS_WINRT)
+# define Q_OS_WINDOWS
# define Q_OS_WIN
#endif