From 55f89c76d93a1c328fa6628212db7bcff3dfcdbb Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Thu, 6 Apr 2023 11:44:31 +0200 Subject: [PATCH] Guard qopenglcontext_p.h with QT_NO_OPENGL Fixes the macos build with the disabled opengl feature. Include inttypes.h that used to be implicitly included by qopenglcontext_p.h. It's needed for 'PRId64' macro. Amends: ef27cc126c38ff14360bebeeb3100671df9e4cf4 Pick-to: 6.5 Fixes: QTBUG-112656 Change-Id: I970329c4aacc70790f50e1ff3a57ab2aa6f6bff7 Reviewed-by: Alexandru Croitor --- src/plugins/platforms/cocoa/qcocoaintegration.h | 4 +++- src/plugins/platforms/cocoa/qcocoaintegration.mm | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.h b/src/plugins/platforms/cocoa/qcocoaintegration.h index 72e5798bd6..09904efbaf 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.h +++ b/src/plugins/platforms/cocoa/qcocoaintegration.h @@ -20,7 +20,9 @@ #include #include #include -#include +#ifndef QT_NO_OPENGL +# include +#endif #include Q_FORWARD_DECLARE_OBJC_CLASS(NSToolbar); diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index 6dd410ad22..56c65a0836 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -33,12 +33,16 @@ #include #include #include -#include +#ifndef QT_NO_OPENGL +# include +#endif #include #include #include +#include + static void initResources() { Q_INIT_RESOURCE(qcocoaresources);