diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-12-08 23:47:10 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-12-10 00:48:07 +0100 |
commit | c3bd5ffdc8a3b459f18ba6e35fca93e29f3b0ab0 (patch) | |
tree | 24d4c1350b6a08d35396377e83301bda3b4addb4 /src/corelib/io | |
parent | 191ac31598ccc9d7c8a2c83730755714f903b7ca (diff) |
Don't wrap feature detection macros with QT_HAS_FOO() variants
Using wrappers for these macros is problematic when for example passing the
-frewrite-includes flag to preprocess sources before shipping off to distcc
or Icecream. It will also start producing warnings when compilers implement
http://eel.is/c++draft/cpp.cond#7.sentence-2. See for example
https://reviews.llvm.org/D49091
Both https://clang.llvm.org/docs/LanguageExtensions.html and the SD-6 document at
https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations
recommend defining '__has_foo(x) 0' as a fallback for compilers without the
macros, so that's what we go for.
Change-Id: I0298cd3b4a6ff6618821e34642a5ddd6728be767
Reviewed-by: Alex Richardson <arichardson.kde@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qprocess.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qstandardpaths.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qstorageinfo_unix.cpp | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index c3abec8989..38cb6a423d 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -55,7 +55,7 @@ #include <stdio.h> #include <errno.h> -#if QT_HAS_INCLUDE(<paths.h>) +#if __has_include(<paths.h>) # include <paths.h> #endif #ifndef _PATH_TMP // from <paths.h> diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index 35ca2542f7..3a77242d7c 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -100,7 +100,7 @@ QT_END_NAMESPACE #include <private/qcore_unix_p.h> #endif -#if QT_HAS_INCLUDE(<paths.h>) +#if __has_include(<paths.h>) #include <paths.h> #endif diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp index 02adda3d6c..bca454fc7a 100644 --- a/src/corelib/io/qstandardpaths.cpp +++ b/src/corelib/io/qstandardpaths.cpp @@ -48,7 +48,7 @@ #include <qcoreapplication.h> #endif -#if QT_HAS_INCLUDE(<paths.h>) +#if __has_include(<paths.h>) #include <paths.h> #endif diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp index 1e72241e68..37b8a60c37 100644 --- a/src/corelib/io/qstorageinfo_unix.cpp +++ b/src/corelib/io/qstorageinfo_unix.cpp @@ -108,7 +108,7 @@ # endif // QT_LARGEFILE_SUPPORT #endif // Q_OS_BSD4 -#if QT_HAS_INCLUDE(<paths.h>) +#if __has_include(<paths.h>) # include <paths.h> #endif #ifndef _PATH_MOUNTED |