From 9444416a46ee0e6bb0d9d9be9a4883b388644c59 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Mon, 6 May 2019 15:44:49 +0100 Subject: 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 --- src/corelib/global/qglobal.cpp | 7 +++++++ src/corelib/global/qsystemdetection.h | 1 + 2 files changed, 8 insertions(+) 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 @@ -1400,6 +1400,13 @@ bool qSharedBuild() Q_DECL_NOTHROW \l Q_OS_WIN32, \l Q_OS_WIN64, or \l Q_OS_WINRT is defined. */ +/*! + \macro Q_OS_WINDOWS + \relates + + This is a synonym for Q_OS_WIN. +*/ + /*! \macro Q_OS_WIN32 \relates 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 -- cgit v1.2.3