summaryrefslogtreecommitdiffstats
path: root/src/core/qtwebenginecoreglobal.h
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@theqtcompany.com>2015-01-14 17:06:03 +0100
committerPierre Rossi <pierre.rossi@theqtcompany.com>2015-01-22 20:01:40 +0100
commit82bef8eb423bc7a9f607fda95cd980a8b2816056 (patch)
tree4e49034442bb2bad4fb84beb0cf3fd719e197a99 /src/core/qtwebenginecoreglobal.h
parent4c724c022664286191558803632d45cd28749ae4 (diff)
Introduce ASSERT_ENUMS_MATCH macro
For our common use case of compile-time checking enums that we want to keep in sync. Change-Id: I102d737ad986bf3dfff4d11a91afa3f3819a7947 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'src/core/qtwebenginecoreglobal.h')
-rw-r--r--src/core/qtwebenginecoreglobal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/qtwebenginecoreglobal.h b/src/core/qtwebenginecoreglobal.h
index 9a222f43f..541406f87 100644
--- a/src/core/qtwebenginecoreglobal.h
+++ b/src/core/qtwebenginecoreglobal.h
@@ -57,4 +57,6 @@
# define QWEBENGINE_EXPORT
#endif
+#define ASSERT_ENUMS_MATCH(A, B) Q_STATIC_ASSERT_X(static_cast<int>(A) == static_cast<int>(B), "The enum values must match");
+
#endif // QTWEBENGINECOREGLOBAL_H