Browse Source

GL: don't mark a local inner struct with MAGNUM_GL_LOCAL.

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.
pull/686/head
Vladimír Vondruš 4 months ago
parent
commit
c7c7f8d87f
  1. 3
      doc/changelog.dox
  2. 2
      src/Magnum/GL/Mesh.h

3
doc/changelog.dox

@ -1231,6 +1231,9 @@ See also:
also for any use of @ref Platform application classes, fixing that would also for any use of @ref Platform application classes, fixing that would
however only add warning suppression noise or force destructors to be 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). `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 @subsection changelog-latest-bugfixes Bug fixes

2
src/Magnum/GL/Mesh.h

@ -1203,7 +1203,7 @@ class MAGNUM_GL_EXPORT Mesh: public AbstractObject {
friend MeshView; friend MeshView;
friend Implementation::MeshState; friend Implementation::MeshState;
struct MAGNUM_GL_LOCAL AttributeLayout; struct AttributeLayout;
/* Used by wrap() */ /* Used by wrap() */
explicit Mesh(GLuint id, MeshPrimitive primitive, ObjectFlags flags); explicit Mesh(GLuint id, MeshPrimitive primitive, ObjectFlags flags);

Loading…
Cancel
Save