Revision control

Copy as Markdown

From 6aefb01b0f1547d05dd7eaa549c6f2f435a3b468 Mon Sep 17 00:00:00 2001
From: Tim Blechmann <tim.blechmann@qt.io>
Date: Sun, 11 May 2025 10:26:58 +0200
Subject: [PATCH] tl::expected: disable exceptions with qt's macros
Change-Id: Ifee3f2800e03f7ecd5c9c218acfd3d7359cd6919
---
src/corelib/global/qexpected_p.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/corelib/global/qexpected_p.h b/src/corelib/global/qexpected_p.h
index a54aea1f7d7..45c6196c947 100644
--- a/src/corelib/global/qexpected_p.h
+++ b/src/corelib/global/qexpected_p.h
@@ -34,6 +34,7 @@
#include <QtCore/private/qglobal_p.h>
#include <QtCore/qassert.h>
+#include <QtCore/qtconfiginclude.h>
#include <QtCore/qtconfigmacros.h>
#include <exception>
#include <functional>
@@ -46,6 +47,10 @@
#define TL_EXPECTED_EXCEPTIONS_ENABLED
#endif
+#if defined(TL_EXPECTED_EXCEPTIONS_ENABLED) && defined(QT_NO_EXCEPTIONS)
+# undef TL_EXPECTED_EXCEPTIONS_ENABLED
+#endif
+
#if (defined(_MSC_VER) && _MSC_VER == 1900)
#define TL_EXPECTED_MSVC2015
#define TL_EXPECTED_MSVC2015_CONSTEXPR
--
2.49.0