From f6bb30d6d0b05c3b16ea300d9ce775e39243a1b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 22 Feb 2021 20:16:59 +0100 Subject: [PATCH] GL: apparently some of these aren't needed to be called everywhere. StringViews are great -- given that they are trivially destructible, the compiler can now tell me that I have unused variables. If it wouldn't be trivially destructible (like std::string), the destructor is treated as if it has side-effects so the compiler won't complain. --- src/Magnum/GL/Implementation/driverSpecific.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Magnum/GL/Implementation/driverSpecific.cpp b/src/Magnum/GL/Implementation/driverSpecific.cpp index 45ef76398..9b681b544 100644 --- a/src/Magnum/GL/Implementation/driverSpecific.cpp +++ b/src/Magnum/GL/Implementation/driverSpecific.cpp @@ -415,9 +415,15 @@ auto Context::detectedDriver() -> DetectedDrivers { _detectedDrivers = DetectedDrivers{}; + #ifndef MAGNUM_TARGET_WEBGL const Containers::StringView renderer = rendererString(); - const Containers::StringView vendor = vendorString(); + #endif + #if !defined(CORRADE_TARGET_APPLE) && !defined(MAGNUM_TARGET_WEBGL) const Containers::StringView version = versionString(); + #endif + #if (!defined(CORRADE_TARGET_APPLE) && !defined(MAGNUM_TARGET_WEBGL)) || defined(MAGNUM_TARGET_GLES) + const Containers::StringView vendor = vendorString(); + #endif /* Apple has its own drivers */ #if !defined(CORRADE_TARGET_APPLE) && !defined(MAGNUM_TARGET_WEBGL)