From c7c7f8d87f512f832307b6df0ec94f43c20aee46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 7 Jan 2026 22:09:10 +0100 Subject: [PATCH] GL: don't mark a local inner struct with MAGNUM_GL_LOCAL. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Causes the following warning on GCC on a static build if user code isn't compiled with -fvisibility=hidden: warning: ‘Magnum::GL::Mesh’ declared with greater visibility than the type of its field ‘Magnum::GL::Mesh::_attributes’ [-Wattributes] According to quick testing, given that the struct definition isn't public, presence of the MAGNUM_GL_LOCAL has no effect on the symbol being exported. On the contrary, inner classes that are meant to be exported (such as the ones in GL::Framebuffer) have to contain MAGNUM_GL_EXPORT, otherwise it leads to linker errors. Furthermore, all other inner structs with local definitions holding PIMPL state and such don't have a MAGNUM_*_LOCAL macro applied anywhere Thus the macro was likely redundant, and is removed. --- doc/changelog.dox | 3 +++ src/Magnum/GL/Mesh.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index c7fbd3631..2be862289 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -1231,6 +1231,9 @@ See also: also for any use of @ref Platform application classes, fixing that would however only add warning suppression noise or force destructors to be `virtual` for no reason, so it's not done there. See [mosra/magnum#665](https://github.com/mosra/magnum/issues/665). +- Fixed a GCC warning about mismatched symbol export in @ref GL::Mesh on + static builds where user code didn't compile with `-fvisiblity=hidden` + (see [mosra/magnum#683](https://github.com/mosra/magnum/issues/683)) @subsection changelog-latest-bugfixes Bug fixes diff --git a/src/Magnum/GL/Mesh.h b/src/Magnum/GL/Mesh.h index 4a348b8fe..3d3d0595d 100644 --- a/src/Magnum/GL/Mesh.h +++ b/src/Magnum/GL/Mesh.h @@ -1203,7 +1203,7 @@ class MAGNUM_GL_EXPORT Mesh: public AbstractObject { friend MeshView; friend Implementation::MeshState; - struct MAGNUM_GL_LOCAL AttributeLayout; + struct AttributeLayout; /* Used by wrap() */ explicit Mesh(GLuint id, MeshPrimitive primitive, ObjectFlags flags);