From af5250b2cbd34f4b7999d0fed7fafceb3cf063fa Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Wed, 13 Jul 2022 21:33:22 +0200 Subject: [PATCH] Ladybird: Fix compilation on macOS/Clang - Silences the -Wuser-defined-literals warning which is triggered by our use of the `sv` suffix for StringView - Removes an unused captured `this` pointer [-Wunused-lambda-capture] - Changes a JSONArray.h include to JSONObject.h to get the definition for `JSONValue::serialize`. This is needed because template functions are not exported for dylibs on macOS. This is a hack; the JSON headers should be refactored so that each one includes the definition of the template functions it sees. -- Maybe we should build with -fvisibility-inlines-hidden on Linux to catch issues like this? --- Ladybird/CMakeLists.txt | 1 + Ladybird/RequestManagerQt.cpp | 2 +- Ladybird/Tab.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Ladybird/CMakeLists.txt b/Ladybird/CMakeLists.txt index f32d108f5a..242fc7e604 100644 --- a/Ladybird/CMakeLists.txt +++ b/Ladybird/CMakeLists.txt @@ -28,6 +28,7 @@ include(cmake/FetchLagom.cmake) # Lagom warnings include(${Lagom_SOURCE_DIR}/../CMake/lagom_compile_options.cmake) add_compile_options(-Wno-expansion-to-defined) +add_compile_options(-Wno-user-defined-literals) set(CMAKE_AUTOMOC ON) find_package(Qt6 REQUIRED COMPONENTS Core Widgets Network) diff --git a/Ladybird/RequestManagerQt.cpp b/Ladybird/RequestManagerQt.cpp index de21e7ff10..c1ed1368da 100644 --- a/Ladybird/RequestManagerQt.cpp +++ b/Ladybird/RequestManagerQt.cpp @@ -5,7 +5,7 @@ */ #include "RequestManagerQt.h" -#include +#include RequestManagerQt::RequestManagerQt() { diff --git a/Ladybird/Tab.cpp b/Ladybird/Tab.cpp index bc24670b86..b010bbd2d6 100644 --- a/Ladybird/Tab.cpp +++ b/Ladybird/Tab.cpp @@ -53,7 +53,7 @@ Tab::Tab(QMainWindow* window) const QPoint* pos = new QPoint(0, size().height() - 15); QToolTip::showText(*pos, title, this); }); - QObject::connect(m_view, &WebView::linkUnhovered, [this] { + QObject::connect(m_view, &WebView::linkUnhovered, [] { QToolTip::hideText(); });