Browse Source

GCC 4.6 compatibility: no friend declarations without class/struct.

Vladimír Vondruš 11 years ago
parent
commit
a951ef9f39
  1. 3
      src/Magnum/AbstractFramebuffer.h
  2. 3
      src/Magnum/AbstractObject.h
  3. 3
      src/Magnum/AbstractQuery.h
  4. 3
      src/Magnum/AbstractResourceLoader.h
  5. 9
      src/Magnum/AbstractShaderProgram.h
  6. 5
      src/Magnum/AbstractTexture.h
  7. 3
      src/Magnum/Buffer.h
  8. 3
      src/Magnum/BufferTexture.h
  9. 6
      src/Magnum/Context.h
  10. 3
      src/Magnum/CubeMapTexture.h
  11. 9
      src/Magnum/DebugOutput.h
  12. 3
      src/Magnum/DefaultFramebuffer.h
  13. 6
      src/Magnum/Framebuffer.h
  14. 5
      src/Magnum/Mesh.h
  15. 3
      src/Magnum/MeshView.h
  16. 9
      src/Magnum/Platform/AbstractXApplication.h
  17. 9
      src/Magnum/Platform/GlutApplication.h
  18. 7
      src/Magnum/Platform/Screen.h
  19. 7
      src/Magnum/Platform/ScreenedApplication.h
  20. 9
      src/Magnum/Platform/Sdl2Application.h
  21. 3
      src/Magnum/Renderbuffer.h
  22. 5
      src/Magnum/Renderer.h
  23. 3
      src/Magnum/Resource.h
  24. 3
      src/Magnum/ResourceManager.h
  25. 5
      src/Magnum/SceneGraph/AbstractFeature.h
  26. 3
      src/Magnum/SceneGraph/AbstractGroupedFeature.h
  27. 7
      src/Magnum/SceneGraph/AbstractObject.h
  28. 3
      src/Magnum/SceneGraph/Animable.h
  29. 3
      src/Magnum/SceneGraph/AnimableGroup.h
  30. 3
      src/Magnum/SceneGraph/FeatureGroup.h
  31. 5
      src/Magnum/SceneGraph/Object.h
  32. 3
      src/Magnum/Shapes/Composition.h
  33. 3
      src/Magnum/Shapes/Shape.h
  34. 3
      src/Magnum/Shapes/ShapeGroup.h
  35. 3
      src/Magnum/TransformFeedback.h

3
src/Magnum/AbstractFramebuffer.h

@ -184,7 +184,8 @@ If @extension{ARB,robustness} is available, @ref read() operations are
protected from buffer overflow.
*/
class MAGNUM_EXPORT AbstractFramebuffer {
friend Implementation::FramebufferState;
/* GCC 4.6 needs the struct keyword */
friend struct Implementation::FramebufferState;
public:
/** @todo `GL_IMPLEMENTATION_COLOR_READ_FORMAT`, `GL_IMPLEMENTATION_COLOR_READ_TYPE`, seems to be depending on currently bound FB (aargh) (@extension{ARB,ES2_compatibility}). */

3
src/Magnum/AbstractObject.h

@ -44,7 +44,8 @@ namespace Implementation { struct DebugState; }
@brief Base for all OpenGL objects
*/
class MAGNUM_EXPORT AbstractObject {
friend Implementation::DebugState;
/* GCC 4.6 needs the struct keyword */
friend struct Implementation::DebugState;
public:
/**

3
src/Magnum/AbstractQuery.h

@ -47,7 +47,8 @@ more information.
@todo `QUERY_COUNTER_BITS` (not sure since when this is supported)
*/
class MAGNUM_EXPORT AbstractQuery: public AbstractObject {
friend Implementation::QueryState;
/* GCC 4.6 needs the struct keyword */
friend struct Implementation::QueryState;
public:
/** @brief Copying is not allowed */

3
src/Magnum/AbstractResourceLoader.h

@ -101,7 +101,8 @@ Resource<Mesh> myMesh = manager->get<Mesh>("my-mesh");
buffers), should that be allowed?
*/
template<class T> class AbstractResourceLoader {
friend Implementation::ResourceManagerData<T>;
/* GCC 4.6 needs the class keyword */
friend class Implementation::ResourceManagerData<T>;
public:
explicit AbstractResourceLoader(): manager(nullptr), _requestedCount(0), _loadedCount(0), _notFoundCount(0) {}

9
src/Magnum/AbstractShaderProgram.h

@ -392,10 +392,11 @@ comes in handy.
@todo `GL_NUM_{PROGRAM,SHADER}_BINARY_FORMATS` + `GL_{PROGRAM,SHADER}_BINARY_FORMATS` (vector), (@extension{ARB,ES2_compatibility})
*/
class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
friend Mesh;
friend MeshView;
friend TransformFeedback;
friend Implementation::ShaderProgramState;
/* GCC 4.6 needs the class/struct keyword */
friend class Mesh;
friend class MeshView;
friend class TransformFeedback;
friend struct Implementation::ShaderProgramState;
public:
#ifndef MAGNUM_TARGET_GLES2

5
src/Magnum/AbstractTexture.h

@ -144,8 +144,9 @@ functions do nothing.
@todo Query for immutable levels (@extension{ARB,ES3_compatibility})
*/
class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
friend Implementation::TextureState;
friend CubeMapTexture;
/* GCC 4.6 needs the class/struct keyword */
friend struct Implementation::TextureState;
friend class CubeMapTexture;
public:
#ifdef MAGNUM_BUILD_DEPRECATED

3
src/Magnum/Buffer.h

@ -214,7 +214,8 @@ by OpenGL in order to preserve the data. If running on OpenGL ES or extension
functions do nothing.
*/
class MAGNUM_EXPORT Buffer: public AbstractObject {
friend Implementation::BufferState;
/* GCC 4.6 needs the struct keyword */
friend struct Implementation::BufferState;
public:
/**

3
src/Magnum/BufferTexture.h

@ -200,7 +200,8 @@ and respective function documentation for more information.
@requires_gl Texture buffers are not available in OpenGL ES.
*/
class MAGNUM_EXPORT BufferTexture: public AbstractTexture {
friend Implementation::TextureState;
/* GCC 4.6 needs the struct keyword */
friend struct Implementation::TextureState;
public:
/**

6
src/Magnum/Context.h

@ -60,7 +60,8 @@ See also @ref Extensions namespace, which contain compile-time information
about OpenGL extensions.
*/
class MAGNUM_EXPORT Extension {
friend Context;
/* GCC 4.6 needs the class keyword */
friend class Context;
public:
/** @brief All extensions for given OpenGL version */
@ -98,7 +99,8 @@ using @ref Platform::Context subclass, see @ref platform documentation for more
information.
*/
class MAGNUM_EXPORT Context {
friend Platform::Context;
/* GCC 4.6 needs the class keyword */
friend class Platform::Context;
public:
/**

3
src/Magnum/CubeMapTexture.h

@ -80,7 +80,8 @@ which intersects one of the six sides of the cube map. See
@ref MultisampleTexture
*/
class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
friend Implementation::TextureState;
/* GCC 4.6 needs the struct keyword */
friend struct Implementation::TextureState;
public:
/** @brief Cube map coordinate */

9
src/Magnum/DebugOutput.h

@ -120,7 +120,8 @@ objects with labels. See @ref AbstractQuery::setLabel(),
@ref TransformFeedback::setLabel() for more information.
*/
class MAGNUM_EXPORT DebugOutput {
friend Implementation::DebugState;
/* GCC 4.6 needs the struct keyword */
friend struct Implementation::DebugState;
public:
/**
@ -455,7 +456,8 @@ result in any allocations and thus won't have any negative performance effects.
@see @ref DebugGroup
*/
class MAGNUM_EXPORT DebugMessage {
friend Implementation::DebugState;
/* GCC 4.6 needs the struct keyword */
friend struct Implementation::DebugState;
public:
/**
@ -762,7 +764,8 @@ result in any allocations and thus won't have any negative performance effects.
@see @ref DebugMessage
*/
class MAGNUM_EXPORT DebugGroup {
friend Implementation::DebugState;
/* GCC 4.6 needs the struct keyword */
friend struct Implementation::DebugState;
public:
/**

3
src/Magnum/DefaultFramebuffer.h

@ -80,7 +80,8 @@ use DSA to avoid unnecessary calls to @fn_gl{BindFramebuffer}. See their
respective documentation for more information.
*/
class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
friend Context;
/* GCC 4.6 needs the class keyword */
friend class Context;
public:
/**

6
src/Magnum/Framebuffer.h

@ -105,7 +105,8 @@ information.
@todo `MAX_COLOR_ATTACHMENTS`
*/
class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObject {
friend Implementation::FramebufferState;
/* GCC 4.6 needs the struct keyword */
friend struct Implementation::FramebufferState;
public:
/**
@ -116,7 +117,8 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* @ref attachCubeMapTexture(), @ref attachTexture3D()
*/
class ColorAttachment {
friend Framebuffer;
/* GCC 4.6 needs the class keyword */
friend class Framebuffer;
public:
/**

5
src/Magnum/Mesh.h

@ -340,8 +340,9 @@ drawing commands are used on desktop OpenGL and OpenGL ES 3.0. See also
@ref draw() for more information.
*/
class MAGNUM_EXPORT Mesh: public AbstractObject {
friend MeshView;
friend Implementation::MeshState;
/* GCC 4.6 needs the class/struct keyword */
friend class MeshView;
friend struct Implementation::MeshState;
public:
/**

3
src/Magnum/MeshView.h

@ -64,7 +64,8 @@ You must ensure that the original mesh remains available for whole view
lifetime.
*/
class MAGNUM_EXPORT MeshView {
friend Implementation::MeshState;
/* GCC 4.6 needs the struct keyword */
friend struct Implementation::MeshState;
public:
/**

9
src/Magnum/Platform/AbstractXApplication.h

@ -354,7 +354,8 @@ CORRADE_ENUMSET_OPERATORS(AbstractXApplication::InputEvent::Buttons)
@see @ref keyPressEvent(), @ref keyReleaseEvent()
*/
class AbstractXApplication::KeyEvent: public AbstractXApplication::InputEvent {
friend AbstractXApplication;
/* GCC 4.6 needs the class keyword */
friend class AbstractXApplication;
public:
/**
@ -454,7 +455,8 @@ class AbstractXApplication::KeyEvent: public AbstractXApplication::InputEvent {
@see @ref MouseMoveEvent, @ref mousePressEvent(), @ref mouseReleaseEvent()
*/
class AbstractXApplication::MouseEvent: public AbstractXApplication::InputEvent {
friend AbstractXApplication;
/* GCC 4.6 needs the class keyword */
friend class AbstractXApplication;
public:
/**
@ -489,7 +491,8 @@ class AbstractXApplication::MouseEvent: public AbstractXApplication::InputEvent
@see @ref MouseEvent, @ref mouseMoveEvent()
*/
class AbstractXApplication::MouseMoveEvent: public AbstractXApplication::InputEvent {
friend AbstractXApplication;
/* GCC 4.6 needs the class keyword */
friend class AbstractXApplication;
public:
/** @brief Position */

9
src/Magnum/Platform/GlutApplication.h

@ -447,7 +447,8 @@ inline GlutApplication::InputEvent::~InputEvent() = default;
@see @ref keyPressEvent()
*/
class GlutApplication::KeyEvent: public GlutApplication::InputEvent {
friend GlutApplication;
/* GCC 4.6 needs the class keyword */
friend class GlutApplication;
public:
/**
@ -546,7 +547,8 @@ class GlutApplication::KeyEvent: public GlutApplication::InputEvent {
@see @ref MouseMoveEvent, @ref mousePressEvent(), @ref mouseReleaseEvent()
*/
class GlutApplication::MouseEvent: public GlutApplication::InputEvent {
friend GlutApplication;
/* GCC 4.6 needs the class keyword */
friend class GlutApplication;
public:
/**
@ -581,7 +583,8 @@ class GlutApplication::MouseEvent: public GlutApplication::InputEvent {
@see @ref MouseEvent, @ref mouseMoveEvent()
*/
class GlutApplication::MouseMoveEvent: public GlutApplication::InputEvent {
friend GlutApplication;
/* GCC 4.6 needs the class keyword */
friend class GlutApplication;
public:
/**

7
src/Magnum/Platform/Screen.h

@ -67,9 +67,10 @@ The following specialization are explicitly compiled into each particular
- @ref XEglApplication "BasicScreen<XEglApplication>"
*/
template<class Application> class BasicScreen: private Containers::LinkedListItem<BasicScreen<Application>, BasicScreenedApplication<Application>> {
friend Containers::LinkedListItem<BasicScreen<Application>, BasicScreenedApplication<Application>>;
friend Containers::LinkedList<BasicScreen<Application>>;
friend BasicScreenedApplication<Application>;
/* GCC 4.6 needs the class keyword */
friend class Containers::LinkedListItem<BasicScreen<Application>, BasicScreenedApplication<Application>>;
friend class Containers::LinkedList<BasicScreen<Application>>;
friend class BasicScreenedApplication<Application>;
public:
#ifdef DOXYGEN_GENERATING_OUTPUT

7
src/Magnum/Platform/ScreenedApplication.h

@ -95,9 +95,10 @@ The following specialization are explicitly compiled into each particular
- @ref XEglApplication "BasicScreenedApplication<XEglApplication>"
*/
template<class Application> class BasicScreenedApplication: public Application, private Containers::LinkedList<BasicScreen<Application>> {
friend Containers::LinkedList<BasicScreen<Application>>;
friend Containers::LinkedListItem<BasicScreen<Application>, BasicScreenedApplication<Application>>;
friend BasicScreen<Application>;
/* GCC 4.6 needs the class keyword */
friend class Containers::LinkedList<BasicScreen<Application>>;
friend class Containers::LinkedListItem<BasicScreen<Application>, BasicScreenedApplication<Application>>;
friend class BasicScreen<Application>;
public:
/**

9
src/Magnum/Platform/Sdl2Application.h

@ -730,7 +730,8 @@ inline Sdl2Application::InputEvent::~InputEvent() = default;
@see @ref keyPressEvent(), @ref keyReleaseEvent()
*/
class Sdl2Application::KeyEvent: public Sdl2Application::InputEvent {
friend Sdl2Application;
/* GCC 4.6 needs the class keyword */
friend class Sdl2Application;
public:
/**
@ -830,7 +831,8 @@ class Sdl2Application::KeyEvent: public Sdl2Application::InputEvent {
@see @ref MouseMoveEvent, @ref mousePressEvent(), @ref mouseReleaseEvent()
*/
class Sdl2Application::MouseEvent: public Sdl2Application::InputEvent {
friend Sdl2Application;
/* GCC 4.6 needs the class keyword */
friend class Sdl2Application;
public:
/**
@ -874,7 +876,8 @@ class Sdl2Application::MouseEvent: public Sdl2Application::InputEvent {
@see @ref MouseEvent, @ref mouseMoveEvent()
*/
class Sdl2Application::MouseMoveEvent: public Sdl2Application::InputEvent {
friend Sdl2Application;
/* GCC 4.6 needs the class keyword */
friend class Sdl2Application;
public:
/**

3
src/Magnum/Renderbuffer.h

@ -64,7 +64,8 @@ information.
@requires_gl30 Extension @extension{ARB,framebuffer_object}
*/
class MAGNUM_EXPORT Renderbuffer: public AbstractObject {
friend Implementation::FramebufferState;
/* GCC 4.6 needs the struct keyword */
friend struct Implementation::FramebufferState;
public:
/**

5
src/Magnum/Renderer.h

@ -48,8 +48,9 @@ namespace Implementation { struct RendererState; }
@todo `GL_MAX_CLIP_DISTANCES`...
*/
class MAGNUM_EXPORT Renderer {
friend Context;
friend Implementation::RendererState;
/* GCC 4.6 needs the class/struct keyword */
friend class Context;
friend struct Implementation::RendererState;
public:
Renderer() = delete;

3
src/Magnum/Resource.h

@ -122,7 +122,8 @@ template<class T, class U = T>
template<class T, class U>
#endif
class Resource {
friend Implementation::ResourceManagerData<T>;
/* GCC 4.6 needs the class keyword */
friend class Implementation::ResourceManagerData<T>;
public:
/**

3
src/Magnum/ResourceManager.h

@ -96,7 +96,8 @@ namespace Implementation {
template<class T> class ResourceManagerData {
template<class, class> friend class Magnum::Resource;
friend AbstractResourceLoader<T>;
/* GCC 4.6 needs the class keyword */
friend class AbstractResourceLoader<T>;
public:
ResourceManagerData(const ResourceManagerData<T>&) = delete;

5
src/Magnum/SceneGraph/AbstractFeature.h

@ -156,8 +156,9 @@ template<UnsignedInt dimensions, class T> class AbstractFeature
: private Containers::LinkedListItem<AbstractFeature<dimensions, T>, AbstractObject<dimensions, T>>
#endif
{
friend Containers::LinkedList<AbstractFeature<dimensions, T>>;
friend Containers::LinkedListItem<AbstractFeature<dimensions, T>, AbstractObject<dimensions, T>>;
/* GCC 4.6 needs the class keyword */
friend class Containers::LinkedList<AbstractFeature<dimensions, T>>;
friend class Containers::LinkedListItem<AbstractFeature<dimensions, T>, AbstractObject<dimensions, T>>;
template<class> friend class Object;
public:

3
src/Magnum/SceneGraph/AbstractGroupedFeature.h

@ -68,7 +68,8 @@ errors. See also @ref compilation-speedup-hpp for more information.
@ref AbstractGroupedFeature3D, @ref FeatureGroup
*/
template<UnsignedInt dimensions, class Derived, class T> class AbstractGroupedFeature: public AbstractFeature<dimensions, T> {
friend FeatureGroup<dimensions, Derived, T>;
/* GCC 4.6 needs the class keyword */
friend class FeatureGroup<dimensions, Derived, T>;
public:
/**

7
src/Magnum/SceneGraph/AbstractObject.h

@ -89,9 +89,10 @@ template<UnsignedInt dimensions, class T> class AbstractObject
: private Containers::LinkedList<AbstractFeature<dimensions, T>>
#endif
{
friend Containers::LinkedList<AbstractFeature<dimensions, T>>;
friend Containers::LinkedListItem<AbstractFeature<dimensions, T>, AbstractObject<dimensions, T>>;
friend AbstractFeature<dimensions, T>;
/* GCC 4.6 needs the class keyword */
friend class Containers::LinkedList<AbstractFeature<dimensions, T>>;
friend class Containers::LinkedListItem<AbstractFeature<dimensions, T>, AbstractObject<dimensions, T>>;
friend class AbstractFeature<dimensions, T>;
public:
/** @brief Matrix type */

3
src/Magnum/SceneGraph/Animable.h

@ -145,7 +145,8 @@ errors. See also @ref compilation-speedup-hpp for more information.
@ref Animable2D, @ref Animable3D, @ref AnimableGroup
*/
template<UnsignedInt dimensions, class T> class Animable: public AbstractGroupedFeature<dimensions, Animable<dimensions, T>, T> {
friend AnimableGroup<dimensions, T>;
/* GCC 4.6 needs the class keyword */
friend class AnimableGroup<dimensions, T>;
public:
/**

3
src/Magnum/SceneGraph/AnimableGroup.h

@ -42,7 +42,8 @@ See @ref Animable for more information.
@ref AnimableGroup2D, @ref AnimableGroup3D
*/
template<UnsignedInt dimensions, class T> class AnimableGroup: public FeatureGroup<dimensions, Animable<dimensions, T>, T> {
friend Animable<dimensions, T>;
/* GCC 4.6 needs the class keyword */
friend class Animable<dimensions, T>;
public:
/**

3
src/Magnum/SceneGraph/FeatureGroup.h

@ -62,7 +62,8 @@ See @ref AbstractGroupedFeature for more information.
@ref FeatureGroup2D, @ref FeatureGroup3D
*/
template<UnsignedInt dimensions, class Feature, class T> class FeatureGroup: public AbstractFeatureGroup<dimensions, T> {
friend AbstractGroupedFeature<dimensions, Feature, T>;
/* GCC 4.6 needs the class keyword */
friend class AbstractGroupedFeature<dimensions, Feature, T>;
public:
explicit FeatureGroup();

5
src/Magnum/SceneGraph/Object.h

@ -111,8 +111,9 @@ template<class Transformation> class Object: public AbstractObject<Transformatio
, private Containers::LinkedList<Object<Transformation>>, private Containers::LinkedListItem<Object<Transformation>, Object<Transformation>>
#endif
{
friend Containers::LinkedList<Object<Transformation>>;
friend Containers::LinkedListItem<Object<Transformation>, Object<Transformation>>;
/* GCC 4.6 needs the class keyword */
friend class Containers::LinkedList<Object<Transformation>>;
friend class Containers::LinkedListItem<Object<Transformation>, Object<Transformation>>;
public:
/** @brief Matrix type */

3
src/Magnum/Shapes/Composition.h

@ -73,7 +73,8 @@ template<UnsignedInt dimensions> class MAGNUM_SHAPES_EXPORT Composition {
template<UnsignedInt dimensions_> friend Implementation::AbstractShape<dimensions_>& Implementation::getAbstractShape(Composition<dimensions_>&, std::size_t);
template<UnsignedInt dimensions_> friend const Implementation::AbstractShape<dimensions_>& Implementation::getAbstractShape(const Composition<dimensions_>&, std::size_t);
#endif
friend Implementation::ShapeHelper<Composition<dimensions>>;
/* GCC 4.6 needs the struct keyword */
friend struct Implementation::ShapeHelper<Composition<dimensions>>;
public:
enum: UnsignedInt {

3
src/Magnum/Shapes/Shape.h

@ -67,7 +67,8 @@ Shapes::AbstractShape3D* firstCollision = shapes.firstCollision(shape);
@ref DebugTools::ShapeRenderer
*/
template<class T> class Shape: public AbstractShape<T::Dimensions> {
friend Implementation::ShapeHelper<T>;
/* GCC 4.6 needs the struct keyword */
friend struct Implementation::ShapeHelper<T>;
public:
/**

3
src/Magnum/Shapes/ShapeGroup.h

@ -44,7 +44,8 @@ See @ref Shape for more information. See @ref shapes for brief introduction.
@see @ref scenegraph, @ref ShapeGroup2D, @ref ShapeGroup3D
*/
template<UnsignedInt dimensions> class MAGNUM_SHAPES_EXPORT ShapeGroup: public SceneGraph::FeatureGroup<dimensions, AbstractShape<dimensions>, Float> {
friend AbstractShape<dimensions>;
/* GCC 4.6 needs the class keyword */
friend class AbstractShape<dimensions>;
public:
/**

3
src/Magnum/TransformFeedback.h

@ -61,7 +61,8 @@ documentation for more information.
@todo @extension{AMD,transform_feedback3_lines_triangles}?
*/
class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
friend Implementation::TransformFeedbackState;
/* GCC 4.6 needs the struct keyword */
friend struct Implementation::TransformFeedbackState;
public:
/**

Loading…
Cancel
Save