diff --git a/cogl/cogl-matrix.h b/cogl/cogl-matrix.h index 80b828e66..0d6d72752 100644 --- a/cogl/cogl-matrix.h +++ b/cogl/cogl-matrix.h @@ -28,6 +28,7 @@ #define __COGL_MATRIX_H #include +#include "cogl-types.h" G_BEGIN_DECLS @@ -100,10 +101,10 @@ struct _CoglMatrix /* Note: we may want to extend this later with private flags * and a cache of the inverse transform matrix. */ - float inv[16]; - unsigned long type; - unsigned long flags; - unsigned long _padding3; + float COGL_PRIVATE (inv)[16]; + unsigned long COGL_PRIVATE (type); + unsigned long COGL_PRIVATE (flags); + unsigned long COGL_PRIVATE (_padding3); }; /** diff --git a/cogl/cogl-types.h b/cogl/cogl-types.h index b45bad41e..547ed129a 100644 --- a/cogl/cogl-types.h +++ b/cogl/cogl-types.h @@ -32,6 +32,16 @@ G_BEGIN_DECLS +/* Some structures are meant to be opaque but they have public + definitions because we want the size to be public so they can be + allocated on the stack. This macro is used to ensure that users + don't accidentally access private members */ +#ifdef CLUTTER_COMPILATION +#define COGL_PRIVATE(x) x +#else +#define COGL_PRIVATE(x) private_member_ ## x +#endif + /** * CoglHandle: * @@ -251,17 +261,17 @@ typedef enum struct _CoglColor { /*< private >*/ - guint8 red; - guint8 green; - guint8 blue; + guint8 COGL_PRIVATE (red); + guint8 COGL_PRIVATE (green); + guint8 COGL_PRIVATE (blue); - guint8 alpha; + guint8 COGL_PRIVATE (alpha); /* padding in case we want to change to floats at * some point */ - guint32 padding0; - guint32 padding1; - guint32 padding2; + guint32 COGL_PRIVATE (padding0); + guint32 COGL_PRIVATE (padding1); + guint32 COGL_PRIVATE (padding2); }; /**