diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2022-11-21 15:34:11 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-11-22 10:49:44 +0000 |
commit | e43eddc8799919d4e0270743d67a340e1b2aea3f (patch) | |
tree | 63cfc7f7e72104753c622252361e5354653bf243 | |
parent | 4abb08378b8568ba25d6a2d2bdd7b9825b870827 (diff) | |
download | qtwebsockets-e43eddc8799919d4e0270743d67a340e1b2aea3f.tar.gz |
Replace QT_HAS_INCLUDE() wrapper macro with __has_include()
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
See qtbase change c3bd5ffdc8a3b459f18ba6e35fca93e29f3b0ab0.
Change-Id: I79d15f92c4d1af3ae3cdd2c0c615dca36c761d1a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
-rw-r--r-- | src/websockets/qwebsocketserver.h | 4 | ||||
-rw-r--r-- | tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/websockets/qwebsocketserver.h b/src/websockets/qwebsocketserver.h index 1ef7fbb..4dd04da 100644 --- a/src/websockets/qwebsocketserver.h +++ b/src/websockets/qwebsocketserver.h @@ -16,7 +16,7 @@ #include <QtNetwork/QSslError> #endif -#if QT_HAS_INCLUDE(<chrono>) +#if __has_include(<chrono>) #include <chrono> #endif @@ -54,7 +54,7 @@ public: void setMaxPendingConnections(int numConnections); int maxPendingConnections() const; -#if QT_HAS_INCLUDE(<chrono>) || defined(Q_QDOC) +#if __has_include(<chrono>) || defined(Q_QDOC) void setHandshakeTimeout(std::chrono::milliseconds msec) { setHandshakeTimeout(int(msec.count())); diff --git a/tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp b/tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp index cd568f3..118a5c2 100644 --- a/tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp +++ b/tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp @@ -256,7 +256,7 @@ void tst_QWebSocketServer::tst_settersAndGetters() server.setHandshakeTimeout(64); QCOMPARE(server.handshakeTimeoutMS(), 64); -#if QT_HAS_INCLUDE(<chrono>) +#if __has_include(<chrono>) auto expected = std::chrono::milliseconds(64); QCOMPARE(server.handshakeTimeout(), expected); |