[cogl/wip/cogl-1.14: 73/177] Fixes for --disable-glib



commit 13a1433a7e991268f695a9926a74dcb7f2c74525
Author: Neil Roberts <neil linux intel com>
Date:   Thu Nov 22 18:01:10 2012 +0000

    Fixes for --disable-glib
    
    This fixes some problems which were stopping --disable-glib from
    working properly:
    
    â A lot of the public headers were including glib.h. This shouldn't be
      necessary because the API doesn't expose any glib types. Otherwise
      any apps would require glib in order to get the header.
    
    â The public headers were using G_BEGIN_DECLS. There is now a
      replacement macro called COGL_BEGIN_DECLS which is defined in
      cogl-types.h.
    
    â A similar fix has been done for G_GNUC_NULL_TERMINATED and
      G_GNUC_DEPRECATED.
    
    â The CFLAGS were not including $(builddir)/deps/glib which was
      preventing it finding the generated glibconfig.h when building out
      of tree.
    
    Reviewed-by: Robert Bragg <robert linux intel com>
    
    (cherry picked from commit 4138b3141c2f39cddaea3d72bfc04342ed5092d0)

 cogl-pango/cogl-pango-display-list.h   |    4 +-
 cogl-pango/cogl-pango-glyph-cache.h    |    4 +-
 cogl-pango/cogl-pango-pipeline-cache.h |    4 +-
 cogl-pango/cogl-pango-private.h        |    4 +-
 cogl-pango/cogl-pango.h                |    4 +-
 cogl/cogl-attribute-buffer.h           |    4 +-
 cogl/cogl-attribute.h                  |    4 +-
 cogl/cogl-bitmap.h                     |    4 +-
 cogl/cogl-bitmask.h                    |    4 +-
 cogl/cogl-buffer-private.h             |    4 +-
 cogl/cogl-buffer.h                     |    5 +--
 cogl/cogl-clip-state.h                 |    4 +-
 cogl/cogl-clutter-xlib.h               |    4 +-
 cogl/cogl-clutter.h                    |    4 +-
 cogl/cogl-color.h                      |    4 +-
 cogl/cogl-context.h                    |    4 +-
 cogl/cogl-debug.h                      |    4 +-
 cogl/cogl-defines.h.in                 |    6 -----
 cogl/cogl-depth-state.h                |    4 +-
 cogl/cogl-display.h                    |    4 +-
 cogl/cogl-egl.h                        |    4 +-
 cogl/cogl-euler.h                      |    6 +---
 cogl/cogl-fixed.h                      |    4 +-
 cogl/cogl-flags.h                      |    4 +-
 cogl/cogl-framebuffer.h                |   10 +++-----
 cogl/cogl-gles2.h                      |    4 +-
 cogl/cogl-index-buffer.h               |    4 +-
 cogl/cogl-indices.h                    |    4 +-
 cogl/cogl-kms-display.h                |    4 +-
 cogl/cogl-kms-renderer.h               |    4 +-
 cogl/cogl-magazine-private.h           |    8 -------
 cogl/cogl-matrix-private.h             |    4 +-
 cogl/cogl-matrix.h                     |    9 +++++--
 cogl/cogl-memory-stack-private.h       |   10 +--------
 cogl/cogl-meta-texture.h               |    5 +--
 cogl/cogl-offscreen.h                  |    4 +-
 cogl/cogl-onscreen-template.h          |    4 +-
 cogl/cogl-onscreen.h                   |    5 +--
 cogl/cogl-path-functions.h             |    4 +-
 cogl/cogl-path.h                       |    4 +-
 cogl/cogl-pipeline-layer-state.h       |    5 +--
 cogl/cogl-pipeline-snippet-private.h   |    2 +
 cogl/cogl-pipeline-state.h             |    5 +--
 cogl/cogl-pipeline.h                   |    4 +-
 cogl/cogl-pixel-buffer-private.h       |    4 +-
 cogl/cogl-pixel-buffer.h               |    5 +--
 cogl/cogl-point-in-poly-private.h      |    4 +-
 cogl/cogl-poll.h                       |    5 +--
 cogl/cogl-primitive-texture.h          |    4 +-
 cogl/cogl-primitive.h                  |    4 +-
 cogl/cogl-primitives-private.h         |    4 +-
 cogl/cogl-primitives.h                 |    4 +-
 cogl/cogl-private.h                    |    4 +-
 cogl/cogl-quaternion.h                 |    4 +-
 cogl/cogl-rectangle-map.h              |    1 +
 cogl/cogl-renderer.h                   |    6 +---
 cogl/cogl-sdl.h                        |    4 +-
 cogl/cogl-shader.h                     |    4 +-
 cogl/cogl-snippet.h                    |    6 +---
 cogl/cogl-sub-texture.h                |    6 +---
 cogl/cogl-swap-chain.h                 |    4 +-
 cogl/cogl-texture-2d-gl.h              |    6 +---
 cogl/cogl-texture-2d-sliced.h          |    2 -
 cogl/cogl-texture-2d.h                 |    6 +---
 cogl/cogl-texture-3d.h                 |    6 +---
 cogl/cogl-texture-rectangle.h          |    4 +-
 cogl/cogl-texture.h                    |    4 +-
 cogl/cogl-types.h                      |   36 +++++++++++++++++++++++++++++--
 cogl/cogl-vector.h                     |    6 +---
 cogl/cogl-vertex-buffer.h              |    4 +-
 cogl/cogl-wayland-client.h             |    2 -
 cogl/cogl-wayland-renderer.h           |    4 +-
 cogl/cogl-wayland-server.h             |    6 +---
 cogl/cogl-win32-renderer.h             |    4 +-
 cogl/cogl-xlib-renderer.h              |    5 +--
 cogl/cogl-xlib.h                       |    6 ++--
 cogl/cogl.h                            |    2 -
 cogl/cogl1-context.h                   |   10 +++-----
 cogl/cogl2-compatibility.h             |    4 +-
 cogl/cogl2-path.h                      |    4 +-
 cogl/winsys/cogl-texture-pixmap-x11.h  |    6 +---
 configure.ac                           |    3 ++
 tests/conform/test-utils.h             |    2 +
 83 files changed, 195 insertions(+), 214 deletions(-)
---
diff --git a/cogl-pango/cogl-pango-display-list.h b/cogl-pango/cogl-pango-display-list.h
index f98dbc8..98c821d 100644
--- a/cogl-pango/cogl-pango-display-list.h
+++ b/cogl-pango/cogl-pango-display-list.h
@@ -28,7 +28,7 @@
 #include <cogl/cogl.h>
 #include "cogl-pango-pipeline-cache.h"
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 typedef struct _CoglPangoDisplayList CoglPangoDisplayList;
 
@@ -64,6 +64,6 @@ void _cogl_pango_display_list_clear (CoglPangoDisplayList *dl);
 
 void _cogl_pango_display_list_free (CoglPangoDisplayList *dl);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_PANGO_DISPLAY_LIST_H__ */
diff --git a/cogl-pango/cogl-pango-glyph-cache.h b/cogl-pango/cogl-pango-glyph-cache.h
index ba0f0de..5ab0572 100644
--- a/cogl-pango/cogl-pango-glyph-cache.h
+++ b/cogl-pango/cogl-pango-glyph-cache.h
@@ -28,7 +28,7 @@
 #include <cogl/cogl.h>
 #include <pango/pango-font.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 typedef struct _CoglPangoGlyphCache      CoglPangoGlyphCache;
 typedef struct _CoglPangoGlyphCacheValue CoglPangoGlyphCacheValue;
@@ -88,6 +88,6 @@ void
 _cogl_pango_glyph_cache_set_dirty_glyphs (CoglPangoGlyphCache *cache,
                                           CoglPangoGlyphCacheDirtyFunc func);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_PANGO_GLYPH_CACHE_H__ */
diff --git a/cogl-pango/cogl-pango-pipeline-cache.h b/cogl-pango/cogl-pango-pipeline-cache.h
index 23a7771..7d43f71 100644
--- a/cogl-pango/cogl-pango-pipeline-cache.h
+++ b/cogl-pango/cogl-pango-pipeline-cache.h
@@ -31,7 +31,7 @@
 #include <glib.h>
 #include <cogl/cogl.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 typedef struct _CoglPangoPipelineCache CoglPangoPipelineCache;
 
@@ -48,6 +48,6 @@ _cogl_pango_pipeline_cache_get (CoglPangoPipelineCache *cache,
 void
 _cogl_pango_pipeline_cache_free (CoglPangoPipelineCache *cache);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_PANGO_PIPELINE_CACHE_H__ */
diff --git a/cogl-pango/cogl-pango-private.h b/cogl-pango/cogl-pango-private.h
index 0c20129..6d0e2fb 100644
--- a/cogl-pango/cogl-pango-private.h
+++ b/cogl-pango/cogl-pango-private.h
@@ -26,13 +26,13 @@
 
 #include "cogl-pango.h"
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 void           _cogl_pango_renderer_clear_glyph_cache  (CoglPangoRenderer *renderer);
 void           _cogl_pango_renderer_set_use_mipmapping (CoglPangoRenderer *renderer,
                                                         CoglBool           value);
 CoglBool       _cogl_pango_renderer_get_use_mipmapping (CoglPangoRenderer *renderer);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_PANGO_PRIVATE_H__ */
diff --git a/cogl-pango/cogl-pango.h b/cogl-pango/cogl-pango.h
index d237eb7..4b30897 100644
--- a/cogl-pango/cogl-pango.h
+++ b/cogl-pango/cogl-pango.h
@@ -29,7 +29,7 @@
 #include <pango/pangocairo.h>
 #include <cogl/cogl.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /* It's too difficult to actually subclass the pango cairo font
  * map. Instead we just make a fake set of macros that actually just
@@ -80,6 +80,6 @@ void cogl_pango_render_layout_line     (PangoLayoutLine *line,
                                         int              y,
                                         const CoglColor *color);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __PANGO_CLUTTER_H__ */
diff --git a/cogl/cogl-attribute-buffer.h b/cogl/cogl-attribute-buffer.h
index bb69063..7b593e5 100644
--- a/cogl/cogl-attribute-buffer.h
+++ b/cogl/cogl-attribute-buffer.h
@@ -38,7 +38,7 @@ typedef struct _CoglAttributeBuffer CoglAttributeBuffer;
 
 #include <cogl/cogl-context.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-attribute-buffer
@@ -86,7 +86,7 @@ cogl_attribute_buffer_new (CoglContext *context,
 CoglBool
 cogl_is_attribute_buffer (void *object);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_ATTRIBUTE_BUFFER_H__ */
 
diff --git a/cogl/cogl-attribute.h b/cogl/cogl-attribute.h
index 60ffaba..129d4ce 100644
--- a/cogl/cogl-attribute.h
+++ b/cogl/cogl-attribute.h
@@ -39,7 +39,7 @@ typedef struct _CoglAttribute CoglAttribute;
 #include <cogl/cogl-attribute-buffer.h>
 #include <cogl/cogl-indices.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-attribute
@@ -215,7 +215,7 @@ cogl_attribute_set_buffer (CoglAttribute *attribute,
 CoglBool
 cogl_is_attribute (void *object);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_ATTRIBUTE_H__ */
 
diff --git a/cogl/cogl-bitmap.h b/cogl/cogl-bitmap.h
index d82dc15..ba71cda 100644
--- a/cogl/cogl-bitmap.h
+++ b/cogl/cogl-bitmap.h
@@ -37,7 +37,7 @@
 #include <android/asset_manager.h>
 #endif
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 typedef struct _CoglBitmap CoglBitmap;
 
@@ -309,6 +309,6 @@ typedef enum {
 
 uint32_t cogl_bitmap_error_quark (void);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_BITMAP_H__ */
diff --git a/cogl/cogl-bitmask.h b/cogl/cogl-bitmask.h
index dd238e7..78f6fa6 100644
--- a/cogl/cogl-bitmask.h
+++ b/cogl/cogl-bitmask.h
@@ -30,7 +30,7 @@
 #include <glib.h>
 #include "cogl-util.h"
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /*
  * CoglBitmask implements a growable array of bits. A CoglBitmask can
@@ -302,6 +302,6 @@ _cogl_bitmask_popcount_upto (const CoglBitmask *bitmask,
                                  ((1UL << upto) - 1));
 }
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_BITMASK_H */
diff --git a/cogl/cogl-buffer-private.h b/cogl/cogl-buffer-private.h
index 4b21fa3..07a1490 100644
--- a/cogl/cogl-buffer-private.h
+++ b/cogl/cogl-buffer-private.h
@@ -35,7 +35,7 @@
 #include "cogl-context.h"
 #include "cogl-gl-header.h"
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 typedef struct _CoglBufferVtable CoglBufferVtable;
 
@@ -153,6 +153,6 @@ _cogl_buffer_map_for_fill_or_fallback (CoglBuffer *buffer);
 void
 _cogl_buffer_unmap_for_fill_or_fallback (CoglBuffer *buffer);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_BUFFER_PRIVATE_H__ */
diff --git a/cogl/cogl-buffer.h b/cogl/cogl-buffer.h
index 217de11..54c15af 100644
--- a/cogl/cogl-buffer.h
+++ b/cogl/cogl-buffer.h
@@ -32,10 +32,9 @@
 #ifndef __COGL_BUFFER_H__
 #define __COGL_BUFFER_H__
 
-#include <glib.h>
 #include <cogl/cogl-types.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-buffer
@@ -283,6 +282,6 @@ cogl_buffer_set_data (CoglBuffer *buffer,
                       const void *data,
                       size_t size);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_BUFFER_H__ */
diff --git a/cogl/cogl-clip-state.h b/cogl/cogl-clip-state.h
index 70cb63b..d7100a0 100644
--- a/cogl/cogl-clip-state.h
+++ b/cogl/cogl-clip-state.h
@@ -30,7 +30,7 @@
 
 #include <cogl/cogl-types.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * cogl_clip_push_from_path:
@@ -45,6 +45,6 @@ G_BEGIN_DECLS
 void
 cogl_clip_push_from_path (void);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_CLIP_STATE_H */
diff --git a/cogl/cogl-clutter-xlib.h b/cogl/cogl-clutter-xlib.h
index 6c08f58..67c27b6 100644
--- a/cogl/cogl-clutter-xlib.h
+++ b/cogl/cogl-clutter-xlib.h
@@ -30,12 +30,12 @@
 
 #include <X11/Xutil.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 #define cogl_clutter_winsys_xlib_get_visual_info cogl_clutter_winsys_xlib_get_visual_info_CLUTTER
 XVisualInfo *
 cogl_clutter_winsys_xlib_get_visual_info (void);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_CLUTTER_XLIB_H__ */
diff --git a/cogl/cogl-clutter.h b/cogl/cogl-clutter.h
index 2673888..c3dfbe6 100644
--- a/cogl/cogl-clutter.h
+++ b/cogl/cogl-clutter.h
@@ -28,7 +28,7 @@
 #ifndef __COGL_CLUTTER_H__
 #define __COGL_CLUTTER_H__
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 #define cogl_clutter_check_extension cogl_clutter_check_extension_CLUTTER
 CoglBool
@@ -42,6 +42,6 @@ cogl_clutter_winsys_has_feature (CoglWinsysFeature feature);
 void
 cogl_onscreen_clutter_backend_set_size (int width, int height);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_CLUTTER_H__ */
diff --git a/cogl/cogl-color.h b/cogl/cogl-color.h
index 97d6229..513c5d3 100644
--- a/cogl/cogl-color.h
+++ b/cogl/cogl-color.h
@@ -40,7 +40,7 @@
 
 #include <cogl/cogl-types.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * cogl_color_new:
@@ -538,6 +538,6 @@ cogl_color_unpremultiply (CoglColor *color);
 CoglBool
 cogl_color_equal (const void *v1, const void *v2);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_COLOR_H__ */
diff --git a/cogl/cogl-context.h b/cogl/cogl-context.h
index 791d2d3..639fae5 100644
--- a/cogl/cogl-context.h
+++ b/cogl/cogl-context.h
@@ -43,7 +43,7 @@ typedef struct _CoglContext CoglContext;
 #include <android/native_window.h>
 #endif
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-context
@@ -318,7 +318,7 @@ cogl_foreach_feature (CoglContext *context,
 
 #endif /* COGL_ENABLE_EXPERIMENTAL_API */
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_CONTEXT_H__ */
 
diff --git a/cogl/cogl-debug.h b/cogl/cogl-debug.h
index a7ac616..7c39ba3 100644
--- a/cogl/cogl-debug.h
+++ b/cogl/cogl-debug.h
@@ -30,7 +30,7 @@
 
 #include <glib.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 typedef enum {
   COGL_DEBUG_SLICING,
@@ -113,7 +113,7 @@ _cogl_parse_debug_string (const char *value,
                           CoglBool enable,
                           CoglBool ignore_help);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_DEBUG_H__ */
 
diff --git a/cogl/cogl-defines.h.in b/cogl/cogl-defines.h.in
index 6bef0cb..6f0648a 100644
--- a/cogl/cogl-defines.h.in
+++ b/cogl/cogl-defines.h.in
@@ -28,10 +28,6 @@
 #ifndef __COGL_DEFINES_H__
 #define __COGL_DEFINES_H__
 
-#include <glib.h>
-
-G_BEGIN_DECLS
-
 @COGL_DEFINES@
 
 #define COGL_VERSION_MAJOR_INTERNAL 1
@@ -39,6 +35,4 @@ G_BEGIN_DECLS
 #define COGL_VERSION_MICRO_INTERNAL @COGL_1_MICRO_VERSION@
 #define COGL_VERSION_STRING_INTERNAL "@COGL_1_VERSION@"
 
-G_END_DECLS
-
 #endif
diff --git a/cogl/cogl-depth-state.h b/cogl/cogl-depth-state.h
index 072c6b0..f9ecded 100644
--- a/cogl/cogl-depth-state.h
+++ b/cogl/cogl-depth-state.h
@@ -31,7 +31,7 @@
 #ifndef __COGL_DEPTH_STATE_H__
 #define __COGL_DEPTH_STATE_H__
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-depth-state
@@ -255,6 +255,6 @@ cogl_depth_state_get_range (CoglDepthState *state,
                             float *near_val,
                             float *far_val);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_DEPTH_STATE_H__ */
diff --git a/cogl/cogl-display.h b/cogl/cogl-display.h
index 62d5ee5..75a8678 100644
--- a/cogl/cogl-display.h
+++ b/cogl/cogl-display.h
@@ -34,7 +34,7 @@
 #include <cogl/cogl-renderer.h>
 #include <cogl/cogl-onscreen-template.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 #ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
 #include <libgdl.h>
@@ -185,7 +185,7 @@ cogl_gdl_display_set_plane (CoglDisplay *display,
 CoglBool
 cogl_is_display (void *object);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_DISPLAY_H__ */
 
diff --git a/cogl/cogl-egl.h b/cogl/cogl-egl.h
index c9ca786..420a99e 100644
--- a/cogl/cogl-egl.h
+++ b/cogl/cogl-egl.h
@@ -28,7 +28,7 @@
 
 #include "cogl-egl-defines.h"
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 #define NativeDisplayType EGLNativeDisplayType
 #define NativeWindowType EGLNativeWindowType
@@ -53,7 +53,7 @@ G_BEGIN_DECLS
 EGLDisplay
 cogl_egl_context_get_egl_display (CoglContext *context);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* COGL_HAS_EGL_SUPPORT */
 
diff --git a/cogl/cogl-euler.h b/cogl/cogl-euler.h
index a4c988d..c936dca 100644
--- a/cogl/cogl-euler.h
+++ b/cogl/cogl-euler.h
@@ -33,9 +33,7 @@
 
 #include <cogl/cogl-types.h>
 
-#include <glib.h>
-
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-euler
@@ -247,7 +245,7 @@ cogl_euler_copy (const CoglEuler *src);
 void
 cogl_euler_free (CoglEuler *euler);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_EULER_H */
 
diff --git a/cogl/cogl-fixed.h b/cogl/cogl-fixed.h
index a1d6317..0512086 100644
--- a/cogl/cogl-fixed.h
+++ b/cogl/cogl-fixed.h
@@ -66,7 +66,7 @@
  * The fixed point API is available since COGL 1.0.
  */
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * COGL_FIXED_BITS:
@@ -799,6 +799,6 @@ cogl_double_to_int   (double value);
 unsigned int
 cogl_double_to_uint (double value);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_FIXED_H__ */
diff --git a/cogl/cogl-flags.h b/cogl/cogl-flags.h
index d62294a..f2178d7 100644
--- a/cogl/cogl-flags.h
+++ b/cogl/cogl-flags.h
@@ -31,7 +31,7 @@
 
 #include "cogl-util.h"
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /* These are macros used to implement a fixed-size array of bits. This
    should be used instead of CoglBitmask when the maximum bit number
@@ -119,7 +119,7 @@ G_BEGIN_DECLS
 #define COGL_FLAGS_FOREACH_END \
   } } } G_STMT_END
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_FLAGS_H */
 
diff --git a/cogl/cogl-framebuffer.h b/cogl/cogl-framebuffer.h
index c350d8a..8c31147 100644
--- a/cogl/cogl-framebuffer.h
+++ b/cogl/cogl-framebuffer.h
@@ -28,8 +28,6 @@
 #ifndef __COGL_FRAMEBUFFER_H
 #define __COGL_FRAMEBUFFER_H
 
-#include <glib.h>
-
 #ifdef COGL_HAS_WIN32_SUPPORT
 #include <windows.h>
 #endif /* COGL_HAS_WIN32_SUPPORT */
@@ -49,7 +47,7 @@
 #include <cogl/cogl-texture.h>
 #endif
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-framebuffer
@@ -1141,7 +1139,7 @@ cogl_framebuffer_vdraw_attributes (CoglFramebuffer *framebuffer,
                                    CoglVerticesMode mode,
                                    int first_vertex,
                                    int n_vertices,
-                                   ...) G_GNUC_NULL_TERMINATED;
+                                   ...) COGL_GNUC_NULL_TERMINATED;
 
 /**
  * cogl_framebuffer_draw_attributes:
@@ -1249,7 +1247,7 @@ cogl_framebuffer_vdraw_indexed_attributes (CoglFramebuffer *framebuffer,
                                            int first_vertex,
                                            int n_vertices,
                                            CoglIndices *indices,
-                                           ...) G_GNUC_NULL_TERMINATED;
+                                           ...) COGL_GNUC_NULL_TERMINATED;
 
 /**
  * cogl_framebuffer_draw_indexed_attributes:
@@ -1811,7 +1809,7 @@ typedef enum { /*< prefix=COGL_FRAMEBUFFER_ERROR >*/
 CoglBool
 cogl_is_framebuffer (void *object);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_FRAMEBUFFER_H */
 
diff --git a/cogl/cogl-gles2.h b/cogl/cogl-gles2.h
index 8174e7b..01f55ed 100644
--- a/cogl/cogl-gles2.h
+++ b/cogl/cogl-gles2.h
@@ -49,7 +49,7 @@
 #include <cogl/cogl-gles2-types.h>
 #endif
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-gles2
@@ -362,7 +362,7 @@ cogl_gles2_texture_get_handle (CoglTexture *texture,
 CoglBool
 cogl_is_gles2_context (void *object);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_GLES2_H__ */
 
diff --git a/cogl/cogl-index-buffer.h b/cogl/cogl-index-buffer.h
index 663e066..074452c 100644
--- a/cogl/cogl-index-buffer.h
+++ b/cogl/cogl-index-buffer.h
@@ -33,7 +33,7 @@
 
 #include <cogl/cogl-context.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-index-buffer
@@ -79,7 +79,7 @@ cogl_index_buffer_new (CoglContext *context,
 CoglBool
 cogl_is_index_buffer (void *object);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_INDEX_BUFFER_H__ */
 
diff --git a/cogl/cogl-indices.h b/cogl/cogl-indices.h
index c13e425..d56348b 100644
--- a/cogl/cogl-indices.h
+++ b/cogl/cogl-indices.h
@@ -38,7 +38,7 @@ typedef struct _CoglIndices CoglIndices;
 
 #include <cogl/cogl-index-buffer.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-index-range
@@ -140,7 +140,7 @@ cogl_get_rectangle_indices (CoglContext *context, int n_rectangles);
 CoglBool
 cogl_is_indices (void *object);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_INDICES_H__ */
 
diff --git a/cogl/cogl-kms-display.h b/cogl/cogl-kms-display.h
index 85ecc72..d8bfd9e 100644
--- a/cogl/cogl-kms-display.h
+++ b/cogl/cogl-kms-display.h
@@ -32,7 +32,7 @@
 #include <cogl/cogl-types.h>
 #include <cogl/cogl-display.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * cogl_kms_display_queue_modes_reset:
@@ -54,5 +54,5 @@ G_BEGIN_DECLS
 void
 cogl_kms_display_queue_modes_reset (CoglDisplay *display);
 
-G_END_DECLS
+COGL_END_DECLS
 #endif /* __COGL_KMS_DISPLAY_H__ */
diff --git a/cogl/cogl-kms-renderer.h b/cogl/cogl-kms-renderer.h
index 539fa78..fdd8bdf 100644
--- a/cogl/cogl-kms-renderer.h
+++ b/cogl/cogl-kms-renderer.h
@@ -31,7 +31,7 @@
 #include <cogl/cogl-types.h>
 #include <cogl/cogl-renderer.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * cogl_kms_renderer_get_kms_fd:
@@ -47,5 +47,5 @@ G_BEGIN_DECLS
 int
 cogl_kms_renderer_get_kms_fd (CoglRenderer *renderer);
 
-G_END_DECLS
+COGL_END_DECLS
 #endif /* __COGL_KMS_RENDERER_H__ */
diff --git a/cogl/cogl-magazine-private.h b/cogl/cogl-magazine-private.h
index 16e5a61..c07e0fe 100644
--- a/cogl/cogl-magazine-private.h
+++ b/cogl/cogl-magazine-private.h
@@ -21,10 +21,6 @@
  *
  */
 
-#if !defined(__COGL_H_INSIDE__) && !defined(COGL_COMPILATION)
-#error "Only <cogl/cogl.h> can be included directly."
-#endif
-
 #ifndef __COGL_MAGAZINE_PRIVATE_H__
 #define __COGL_MAGAZINE_PRIVATE_H__
 
@@ -32,8 +28,6 @@
 
 #include "cogl-memory-stack-private.h"
 
-G_BEGIN_DECLS
-
 typedef struct _CoglMagazineChunk CoglMagazineChunk;
 
 struct _CoglMagazineChunk
@@ -77,6 +71,4 @@ _cogl_magazine_chunk_free (CoglMagazine *magazine, void *data)
 void
 _cogl_magazine_free (CoglMagazine *magazine);
 
-G_END_DECLS
-
 #endif /* __COGL_MAGAZINE_PRIVATE_H__ */
diff --git a/cogl/cogl-matrix-private.h b/cogl/cogl-matrix-private.h
index 7628082..9a8c885 100644
--- a/cogl/cogl-matrix-private.h
+++ b/cogl/cogl-matrix-private.h
@@ -29,7 +29,7 @@
 
 #include <glib.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 #define _COGL_MATRIX_DEBUG_PRINT(MATRIX) \
   if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_MATRICES))) \
@@ -45,7 +45,7 @@ void
 _cogl_matrix_init_from_matrix_without_inverse (CoglMatrix *matrix,
                                                const CoglMatrix *src);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_MATRIX_PRIVATE_H */
 
diff --git a/cogl/cogl-matrix.h b/cogl/cogl-matrix.h
index c50670e..926f4c8 100644
--- a/cogl/cogl-matrix.h
+++ b/cogl/cogl-matrix.h
@@ -27,14 +27,17 @@
 #ifndef __COGL_MATRIX_H
 #define __COGL_MATRIX_H
 
-#include <glib.h>
+#ifdef COGL_HAS_GTYPE_SUPPORT
+#include <glib-object.h>
+#endif /* COGL_HAS_GTYPE_SUPPORT */
+
 #include "cogl-types.h"
 
 #ifdef COGL_ENABLE_EXPERIMENTAL_API
 #include "cogl-quaternion.h"
 #endif
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-matrix
@@ -789,7 +792,7 @@ cogl_gtype_matrix_get_type (void);
 
 #endif /* _COGL_SUPPORTS_GTYPE_INTEGRATION */
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_MATRIX_H */
 
diff --git a/cogl/cogl-memory-stack-private.h b/cogl/cogl-memory-stack-private.h
index d6d5a9c..4e077f2 100644
--- a/cogl/cogl-memory-stack-private.h
+++ b/cogl/cogl-memory-stack-private.h
@@ -21,16 +21,10 @@
  *
  */
 
-#if !defined(__COGL_H_INSIDE__) && !defined(COGL_COMPILATION)
-#error "Only <cogl/cogl.h> can be included directly."
-#endif
-
-#include <glib.h>
-
 #ifndef __COGL_MEMORY_STACK__
 #define __COGL_MEMORY_STACK__
 
-G_BEGIN_DECLS
+#include <glib.h>
 
 typedef struct _CoglMemoryStack CoglMemoryStack;
 
@@ -46,6 +40,4 @@ _cogl_memory_stack_rewind (CoglMemoryStack *stack);
 void
 _cogl_memory_stack_free (CoglMemoryStack *stack);
 
-G_END_DECLS
-
 #endif /* __COGL_MEMORY_STACK__ */
diff --git a/cogl/cogl-meta-texture.h b/cogl/cogl-meta-texture.h
index b896cd0..28ec979 100644
--- a/cogl/cogl-meta-texture.h
+++ b/cogl/cogl-meta-texture.h
@@ -30,9 +30,8 @@
 #define __COGL_META_TEXTURE_H__
 
 #include <cogl/cogl-pipeline-layer-state.h>
-#include <glib.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-meta-texture
@@ -176,6 +175,6 @@ cogl_meta_texture_foreach_in_region (CoglMetaTexture *meta_texture,
                                      CoglMetaTextureCallback callback,
                                      void *user_data);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_META_TEXTURE_H__ */
diff --git a/cogl/cogl-offscreen.h b/cogl/cogl-offscreen.h
index e3ca11b..ca73747 100644
--- a/cogl/cogl-offscreen.h
+++ b/cogl/cogl-offscreen.h
@@ -31,7 +31,7 @@
 #include <cogl/cogl-types.h>
 #include <cogl/cogl-texture.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-offscreen
@@ -112,6 +112,6 @@ cogl_offscreen_unref (void *offscreen) G_GNUC_DEPRECATED;
 
 #endif /* COGL_DISABLE_DEPRECATED */
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_OFFSCREEN_H__ */
diff --git a/cogl/cogl-onscreen-template.h b/cogl/cogl-onscreen-template.h
index 3df8f0f..58d88d4 100644
--- a/cogl/cogl-onscreen-template.h
+++ b/cogl/cogl-onscreen-template.h
@@ -33,7 +33,7 @@
 
 #include <cogl/cogl-swap-chain.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 typedef struct _CoglOnscreenTemplate	      CoglOnscreenTemplate;
 
@@ -101,6 +101,6 @@ cogl_onscreen_template_set_swap_throttled (
 CoglBool
 cogl_is_onscreen_template (void *object);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_ONSCREEN_TEMPLATE_H__ */
diff --git a/cogl/cogl-onscreen.h b/cogl/cogl-onscreen.h
index c4c4dfd..735dd96 100644
--- a/cogl/cogl-onscreen.h
+++ b/cogl/cogl-onscreen.h
@@ -34,9 +34,8 @@
 
 #include <cogl/cogl-context.h>
 #include <cogl/cogl-framebuffer.h>
-#include <glib.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 typedef struct _CoglOnscreen CoglOnscreen;
 #define COGL_ONSCREEN(X) ((CoglOnscreen *)(X))
@@ -532,6 +531,6 @@ cogl_onscreen_remove_resize_handler (CoglOnscreen *onscreen,
 CoglBool
 cogl_is_onscreen (void *object);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_ONSCREEN_H */
diff --git a/cogl/cogl-path-functions.h b/cogl/cogl-path-functions.h
index cb12508..f953a03 100644
--- a/cogl/cogl-path-functions.h
+++ b/cogl/cogl-path-functions.h
@@ -34,7 +34,7 @@
 
 #include <cogl/cogl-types.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * cogl_is_path:
@@ -424,7 +424,7 @@ cogl_set_path (CoglPath *path);
 CoglPath *
 cogl_path_copy (CoglPath *path);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_PATH_FUNCTIONS_H__ */
 
diff --git a/cogl/cogl-path.h b/cogl/cogl-path.h
index b29fdee..740c0a3 100644
--- a/cogl/cogl-path.h
+++ b/cogl/cogl-path.h
@@ -30,7 +30,7 @@
 
 #include <cogl/cogl-types.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-paths
@@ -97,7 +97,7 @@ typedef enum {
   COGL_PATH_FILL_RULE_EVEN_ODD
 } CoglPathFillRule;
 
-G_END_DECLS
+COGL_END_DECLS
 
 #include "cogl-path-functions.h"
 
diff --git a/cogl/cogl-pipeline-layer-state.h b/cogl/cogl-pipeline-layer-state.h
index 62f09f6..220995b 100644
--- a/cogl/cogl-pipeline-layer-state.h
+++ b/cogl/cogl-pipeline-layer-state.h
@@ -32,9 +32,8 @@
 #include <cogl/cogl-color.h>
 #include <cogl/cogl-matrix.h>
 #include <cogl/cogl-texture.h>
-#include <glib.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 #ifdef COGL_ENABLE_EXPERIMENTAL_API
 
@@ -603,6 +602,6 @@ cogl_pipeline_add_layer_snippet (CoglPipeline *pipeline,
 
 #endif /* COGL_ENABLE_EXPERIMENTAL_API */
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_PIPELINE_LAYER_STATE_H__ */
diff --git a/cogl/cogl-pipeline-snippet-private.h b/cogl/cogl-pipeline-snippet-private.h
index bfc9d5d..b10b6ca 100644
--- a/cogl/cogl-pipeline-snippet-private.h
+++ b/cogl/cogl-pipeline-snippet-private.h
@@ -28,6 +28,8 @@
 #ifndef __COGL_PIPELINE_SNIPPET_PRIVATE_H
 #define __COGL_PIPELINE_SNIPPET_PRIVATE_H
 
+#include <glib.h>
+
 #include "cogl-snippet.h"
 #include "cogl-queue.h"
 
diff --git a/cogl/cogl-pipeline-state.h b/cogl/cogl-pipeline-state.h
index 9915e62..2f361cb 100644
--- a/cogl/cogl-pipeline-state.h
+++ b/cogl/cogl-pipeline-state.h
@@ -31,9 +31,8 @@
 #include <cogl/cogl-pipeline.h>
 #include <cogl/cogl-color.h>
 #include <cogl/cogl-depth-state.h>
-#include <glib.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 #ifdef COGL_ENABLE_EXPERIMENTAL_API
 
@@ -915,6 +914,6 @@ cogl_pipeline_add_snippet (CoglPipeline *pipeline,
 
 #endif /* COGL_ENABLE_EXPERIMENTAL_API */
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_PIPELINE_STATE_H__ */
diff --git a/cogl/cogl-pipeline.h b/cogl/cogl-pipeline.h
index 67b777a..0ca53df 100644
--- a/cogl/cogl-pipeline.h
+++ b/cogl/cogl-pipeline.h
@@ -37,7 +37,7 @@ typedef struct _CoglPipeline CoglPipeline;
 #include <cogl/cogl-context.h>
 #include <cogl/cogl-snippet.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 #ifdef COGL_ENABLE_EXPERIMENTAL_API
 
@@ -168,6 +168,6 @@ cogl_pipeline_get_uniform_location (CoglPipeline *pipeline,
 
 #endif /* COGL_ENABLE_EXPERIMENTAL_API */
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_PIPELINE_H__ */
diff --git a/cogl/cogl-pixel-buffer-private.h b/cogl/cogl-pixel-buffer-private.h
index 974afa6..d6ee07b 100644
--- a/cogl/cogl-pixel-buffer-private.h
+++ b/cogl/cogl-pixel-buffer-private.h
@@ -33,13 +33,13 @@
 
 #include <glib.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 struct _CoglPixelBuffer
 {
   CoglBuffer            _parent;
 };
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_PIXEL_BUFFER_PRIVATE_H__ */
diff --git a/cogl/cogl-pixel-buffer.h b/cogl/cogl-pixel-buffer.h
index 3934c3a..09ee5e9 100644
--- a/cogl/cogl-pixel-buffer.h
+++ b/cogl/cogl-pixel-buffer.h
@@ -32,11 +32,10 @@
 #ifndef __COGL_PIXEL_BUFFER_H__
 #define __COGL_PIXEL_BUFFER_H__
 
-#include <glib.h>
 #include <cogl/cogl-types.h>
 #include <cogl/cogl-context.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 #define COGL_PIXEL_BUFFER(buffer) ((CoglPixelBuffer *)(buffer))
 
@@ -110,6 +109,6 @@ cogl_pixel_buffer_set_region (CoglPixelBuffer *buffer,
                               unsigned int dst_y);
 #endif
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_PIXEL_BUFFER_H__ */
diff --git a/cogl/cogl-point-in-poly-private.h b/cogl/cogl-point-in-poly-private.h
index 6b534b6..1f7f5f6 100644
--- a/cogl/cogl-point-in-poly-private.h
+++ b/cogl/cogl-point-in-poly-private.h
@@ -25,7 +25,7 @@
 
 #include <glib.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 int
 _cogl_util_point_in_screen_poly (float point_x,
@@ -34,7 +34,7 @@ _cogl_util_point_in_screen_poly (float point_x,
                                  size_t stride,
                                  int n_vertices);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_POINT_INT_POLYGON_PRIVATE_H */
 
diff --git a/cogl/cogl-poll.h b/cogl/cogl-poll.h
index 2a319bd..6496c7d 100644
--- a/cogl/cogl-poll.h
+++ b/cogl/cogl-poll.h
@@ -31,11 +31,10 @@
 #ifndef __COGL_POLL_H__
 #define __COGL_POLL_H__
 
-#include <glib.h>
 #include <cogl/cogl-defines.h>
 #include <cogl/cogl-context.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-poll
@@ -163,6 +162,6 @@ cogl_poll_dispatch (CoglContext *context,
                     const CoglPollFD *poll_fds,
                     int n_poll_fds);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_POLL_H__ */
diff --git a/cogl/cogl-primitive-texture.h b/cogl/cogl-primitive-texture.h
index 39c3c41..5bd32c7 100644
--- a/cogl/cogl-primitive-texture.h
+++ b/cogl/cogl-primitive-texture.h
@@ -31,7 +31,7 @@
 
 #include "cogl-types.h"
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-primitive-texture
@@ -93,6 +93,6 @@ void
 cogl_primitive_texture_set_auto_mipmap (CoglPrimitiveTexture *primitive_texture,
                                         CoglBool value);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_PRIMITIVE_TEXTURE_H__ */
diff --git a/cogl/cogl-primitive.h b/cogl/cogl-primitive.h
index 0df3ab4..1c36875 100644
--- a/cogl/cogl-primitive.h
+++ b/cogl/cogl-primitive.h
@@ -39,7 +39,7 @@ typedef struct _CoglPrimitive CoglPrimitive;
 #include <cogl/cogl-vertex-buffer.h> /* for CoglVerticesMode */
 #include <cogl/cogl-attribute.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-primitive
@@ -868,7 +868,7 @@ cogl_primitive_foreach_attribute (CoglPrimitive *primitive,
                                   CoglPrimitiveAttributeCallback callback,
                                   void *user_data);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_PRIMITIVE_H__ */
 
diff --git a/cogl/cogl-primitives-private.h b/cogl/cogl-primitives-private.h
index 91b457f..0d53925 100644
--- a/cogl/cogl-primitives-private.h
+++ b/cogl/cogl-primitives-private.h
@@ -26,7 +26,7 @@
 
 #include <glib.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /* Draws a rectangle without going through the journal so that it will
    be flushed immediately. This should only be used in situations
@@ -55,6 +55,6 @@ _cogl_framebuffer_draw_multitextured_rectangles (
                                         int n_rects,
                                         CoglBool disable_legacy_state);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_PRIMITIVES_PRIVATE_H */
diff --git a/cogl/cogl-primitives.h b/cogl/cogl-primitives.h
index e1f3617..44ef870 100644
--- a/cogl/cogl-primitives.h
+++ b/cogl/cogl-primitives.h
@@ -26,7 +26,7 @@
 
 #include <glib.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-primitives
@@ -185,6 +185,6 @@ cogl_polygon (const CoglTextureVertex  *vertices,
               unsigned int              n_vertices,
               CoglBool                  use_color);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_PRIMITIVES_H */
diff --git a/cogl/cogl-private.h b/cogl/cogl-private.h
index 10eebac..6644bd8 100644
--- a/cogl/cogl-private.h
+++ b/cogl/cogl-private.h
@@ -28,7 +28,7 @@
 
 #include "cogl-context.h"
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 CoglBool
 _cogl_check_extension (const char *name, char * const *ext);
@@ -96,6 +96,6 @@ _cogl_pixel_format_is_endian_dependant (CoglPixelFormat format);
 #define COGL_PIXEL_FORMAT_CAN_HAVE_PREMULT(format) \
   (((format) & COGL_A_BIT) && (format) != COGL_PIXEL_FORMAT_A_8)
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_PRIVATE_H__ */
diff --git a/cogl/cogl-quaternion.h b/cogl/cogl-quaternion.h
index a1b3cfb..91798f9 100644
--- a/cogl/cogl-quaternion.h
+++ b/cogl/cogl-quaternion.h
@@ -34,7 +34,7 @@
 #include <cogl/cogl-types.h>
 #include <cogl/cogl-vector.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-quaternion
@@ -523,7 +523,7 @@ cogl_get_static_identity_quaternion (void);
 const CoglQuaternion *
 cogl_get_static_zero_quaternion (void);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_QUATERNION_H__ */
 
diff --git a/cogl/cogl-rectangle-map.h b/cogl/cogl-rectangle-map.h
index 0b724fc..06c89af 100644
--- a/cogl/cogl-rectangle-map.h
+++ b/cogl/cogl-rectangle-map.h
@@ -24,6 +24,7 @@
 #ifndef __COGL_RECTANGLE_MAP_H
 #define __COGL_RECTANGLE_MAP_H
 
+#include <glib.h>
 #include "cogl-types.h"
 
 typedef struct _CoglRectangleMap      CoglRectangleMap;
diff --git a/cogl/cogl-renderer.h b/cogl/cogl-renderer.h
index 383eeac..427b8ba 100644
--- a/cogl/cogl-renderer.h
+++ b/cogl/cogl-renderer.h
@@ -28,13 +28,11 @@
 #ifndef __COGL_RENDERER_H__
 #define __COGL_RENDERER_H__
 
-#include <glib.h>
-
 #include <cogl/cogl-types.h>
 #include <cogl/cogl-onscreen-template.h>
 #include <cogl/cogl-error.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-renderer
@@ -385,7 +383,7 @@ cogl_renderer_set_driver (CoglRenderer *renderer,
 CoglDriver
 cogl_renderer_get_driver (CoglRenderer *renderer);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_RENDERER_H__ */
 
diff --git a/cogl/cogl-sdl.h b/cogl/cogl-sdl.h
index 0508649..b6841f6 100644
--- a/cogl/cogl-sdl.h
+++ b/cogl/cogl-sdl.h
@@ -41,7 +41,7 @@
 #pragma comment (lib, "SDLmain.lib")
 #endif
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-sdl
@@ -219,6 +219,6 @@ cogl_sdl_onscreen_get_window (CoglOnscreen *onscreen);
 
 #endif /* SDL_MAJOR_VERSION */
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_SDL_H__ */
diff --git a/cogl/cogl-shader.h b/cogl/cogl-shader.h
index ae9a2d0..7d503b1 100644
--- a/cogl/cogl-shader.h
+++ b/cogl/cogl-shader.h
@@ -31,7 +31,7 @@
 #include <cogl/cogl-types.h>
 #include <cogl/cogl-defines.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-shaders
@@ -649,6 +649,6 @@ cogl_program_uniform_matrix (int          uniform_no,
 
 #endif /* COGL_DISABLE_DEPRECATED */
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_SHADER_H__ */
diff --git a/cogl/cogl-snippet.h b/cogl/cogl-snippet.h
index f20cc98..84c6746 100644
--- a/cogl/cogl-snippet.h
+++ b/cogl/cogl-snippet.h
@@ -32,9 +32,7 @@
 #ifndef __COGL_SNIPPET_H__
 #define __COGL_SNIPPET_H__
 
-#include <glib.h>
-
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-snippet
@@ -751,6 +749,6 @@ cogl_snippet_set_post (CoglSnippet *snippet,
 const char *
 cogl_snippet_get_post (CoglSnippet *snippet);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_SNIPPET_H__ */
diff --git a/cogl/cogl-sub-texture.h b/cogl/cogl-sub-texture.h
index 92bbe4e..6532801 100644
--- a/cogl/cogl-sub-texture.h
+++ b/cogl/cogl-sub-texture.h
@@ -31,9 +31,7 @@
 #ifndef __COGL_SUB_TEXTURE_H
 #define __COGL_SUB_TEXTURE_H
 
-#include <glib.h>
-
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-sub-texture
@@ -119,6 +117,6 @@ cogl_sub_texture_get_parent (CoglSubTexture *sub_texture);
 CoglBool
 cogl_is_sub_texture (void *object);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_SUB_TEXTURE_H */
diff --git a/cogl/cogl-swap-chain.h b/cogl/cogl-swap-chain.h
index 21908e9..05596a8 100644
--- a/cogl/cogl-swap-chain.h
+++ b/cogl/cogl-swap-chain.h
@@ -28,7 +28,7 @@
 #ifndef __COGL_SWAP_CHAIN_H__
 #define __COGL_SWAP_CHAIN_H__
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 typedef struct _CoglSwapChain CoglSwapChain;
 
@@ -46,6 +46,6 @@ cogl_swap_chain_set_length (CoglSwapChain *swap_chain,
 CoglBool
 cogl_is_swap_chain (void *object);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_SWAP_CHAIN_H__ */
diff --git a/cogl/cogl-texture-2d-gl.h b/cogl/cogl-texture-2d-gl.h
index c70f4c3..49ae47d 100644
--- a/cogl/cogl-texture-2d-gl.h
+++ b/cogl/cogl-texture-2d-gl.h
@@ -34,9 +34,7 @@
 #include "cogl-context.h"
 #include "cogl-texture-2d.h"
 
-#include <glib.h>
-
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * cogl_texture_2d_new_from_foreign:
@@ -70,6 +68,6 @@ cogl_texture_2d_new_from_foreign (CoglContext *ctx,
                                   CoglPixelFormat format,
                                   CoglError **error);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* _COGL_TEXTURE_2D_GL_H_ */
diff --git a/cogl/cogl-texture-2d-sliced.h b/cogl/cogl-texture-2d-sliced.h
index 3173d14..363d6d8 100644
--- a/cogl/cogl-texture-2d-sliced.h
+++ b/cogl/cogl-texture-2d-sliced.h
@@ -30,8 +30,6 @@
 #include "cogl-context.h"
 #include "cogl-types.h"
 
-#include <glib.h>
-
 /**
  * SECTION:cogl-texture-2d-sliced
  * @short_description: Functions for creating and manipulating 2D meta
diff --git a/cogl/cogl-texture-2d.h b/cogl/cogl-texture-2d.h
index d07cdef..fcd86f7 100644
--- a/cogl/cogl-texture-2d.h
+++ b/cogl/cogl-texture-2d.h
@@ -34,9 +34,7 @@
 #include "cogl-context.h"
 #include "cogl-bitmap.h"
 
-#include <glib.h>
-
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-texture-2d
@@ -187,6 +185,6 @@ cogl_texture_2d_new_from_bitmap (CoglBitmap *bitmap,
                                  CoglPixelFormat internal_format,
                                  CoglError **error);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_TEXTURE_2D_H */
diff --git a/cogl/cogl-texture-3d.h b/cogl/cogl-texture-3d.h
index 1956b4d..1ddde33 100644
--- a/cogl/cogl-texture-3d.h
+++ b/cogl/cogl-texture-3d.h
@@ -31,9 +31,7 @@
 #ifndef __COGL_TEXTURE_3D_H
 #define __COGL_TEXTURE_3D_H
 
-#include <glib.h>
-
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-texture-3d
@@ -180,6 +178,6 @@ cogl_texture_3d_new_from_bitmap (CoglBitmap *bitmap,
 CoglBool
 cogl_is_texture_3d (void *object);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_TEXTURE_3D_H */
diff --git a/cogl/cogl-texture-rectangle.h b/cogl/cogl-texture-rectangle.h
index 20de97d..447866f 100644
--- a/cogl/cogl-texture-rectangle.h
+++ b/cogl/cogl-texture-rectangle.h
@@ -29,7 +29,7 @@
 
 #include "cogl-context.h"
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-texture-rectangle
@@ -199,6 +199,6 @@ cogl_texture_rectangle_new_from_foreign (CoglContext *ctx,
                                          CoglPixelFormat format,
                                          CoglError **error);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_TEXURE_RECTANGLE_H */
diff --git a/cogl/cogl-texture.h b/cogl/cogl-texture.h
index cd3f394..c1462ed 100644
--- a/cogl/cogl-texture.h
+++ b/cogl/cogl-texture.h
@@ -40,7 +40,7 @@ typedef struct _CoglTexture CoglTexture;
 #endif
 #include <cogl/cogl-bitmap.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-texture
@@ -517,6 +517,6 @@ cogl_texture_unref (void *texture) G_GNUC_DEPRECATED;
 
 #endif /* COGL_DISABLE_DEPRECATED */
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_TEXTURE_H__ */
diff --git a/cogl/cogl-types.h b/cogl/cogl-types.h
index 9d91e70..16e9fb5 100644
--- a/cogl/cogl-types.h
+++ b/cogl/cogl-types.h
@@ -29,11 +29,24 @@
 #define __COGL_TYPES_H__
 
 #include <stdint.h>
-#include <glib-object.h>
+#include <stddef.h>
 
 #include <cogl/cogl-defines.h>
 
-G_BEGIN_DECLS
+#ifdef COGL_HAS_GTYPE_SUPPORT
+#include <glib-object.h>
+#endif /* COGL_HAS_GTYPE_SUPPORT */
+
+/* Guard C code in headers, while including them from C++ */
+#ifdef  __cplusplus
+#define COGL_BEGIN_DECLS  extern "C" {
+#define COGL_END_DECLS    }
+#else
+#define COGL_BEGIN_DECLS
+#define COGL_END_DECLS
+#endif
+
+COGL_BEGIN_DECLS
 
 /**
  * CoglBool:
@@ -73,6 +86,19 @@ typedef int CoglBool;
 #define FALSE 0
 #endif
 
+#if __GNUC__ >= 4
+#define COGL_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
+#else
+#define COGL_GNUC_NULL_TERMINATED
+#endif
+
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+#define COGL_GNUC_DEPRECATED                       \
+  __attribute__((__deprecated__))
+#else
+#define COGL_GNUC_DEPRECATED
+#endif /* __GNUC__ */
+
 /* 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
@@ -109,10 +135,14 @@ typedef void * CoglHandle;
  */
 #define COGL_INVALID_HANDLE NULL
 
+#ifdef COGL_HAS_GTYPE_SUPPORT
+
 #define COGL_TYPE_HANDLE        (cogl_handle_get_type ())
 GType
 cogl_handle_get_type (void) G_GNUC_CONST;
 
+#endif /* COGL_HAS_GTYPE_SUPPORT */
+
 /**
  * cogl_handle_ref:
  * @handle: a #CoglHandle
@@ -856,6 +886,6 @@ typedef enum { /*< prefix=COGL_READ_PIXELS >*/
   COGL_READ_PIXELS_COLOR_BUFFER = 1L << 0
 } CoglReadPixelsFlags;
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_TYPES_H__ */
diff --git a/cogl/cogl-vector.h b/cogl/cogl-vector.h
index 3156b15..81ff473 100644
--- a/cogl/cogl-vector.h
+++ b/cogl/cogl-vector.h
@@ -31,9 +31,7 @@
 #ifndef __COGL_VECTOR_H
 #define __COGL_VECTOR_H
 
-#include <glib.h>
-
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-vector
@@ -347,7 +345,7 @@ cogl_vector3_dot_product (const float *a, const float *b);
 float
 cogl_vector3_distance (const float *a, const float *b);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_VECTOR_H */
 
diff --git a/cogl/cogl-vertex-buffer.h b/cogl/cogl-vertex-buffer.h
index b47188b..c3ce4b1 100644
--- a/cogl/cogl-vertex-buffer.h
+++ b/cogl/cogl-vertex-buffer.h
@@ -35,7 +35,7 @@
 #include <cogl/cogl-defines.h>
 #include <cogl/cogl-types.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-vertex-buffer
@@ -404,6 +404,6 @@ cogl_is_vertex_buffer (CoglHandle handle);
 CoglBool
 cogl_is_vertex_buffer_indices (CoglHandle handle);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_VERTEX_BUFFER_H__ */
diff --git a/cogl/cogl-wayland-client.h b/cogl/cogl-wayland-client.h
index 3f290dc..610f558 100644
--- a/cogl/cogl-wayland-client.h
+++ b/cogl/cogl-wayland-client.h
@@ -24,8 +24,6 @@
 #ifndef __COGL_WAYLAND_CLIENT_H
 #define __COGL_WAYLAND_CLIENT_H
 
-#include <glib.h>
-
 #define __COGL_H_INSIDE__
 #include <cogl/cogl-wayland-renderer.h>
 
diff --git a/cogl/cogl-wayland-renderer.h b/cogl/cogl-wayland-renderer.h
index f5a760f..1d9d5fa 100644
--- a/cogl/cogl-wayland-renderer.h
+++ b/cogl/cogl-wayland-renderer.h
@@ -33,7 +33,7 @@
 
 #include <wayland-client.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * cogl_wayland_renderer_set_foreign_display:
@@ -159,6 +159,6 @@ cogl_wayland_renderer_set_foreign_shell (CoglRenderer *renderer,
 struct wl_shell *
 cogl_wayland_renderer_get_shell (CoglRenderer *renderer);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_WAYLAND_RENDERER_H__ */
diff --git a/cogl/cogl-wayland-server.h b/cogl/cogl-wayland-server.h
index 6e66292..567a9f9 100644
--- a/cogl/cogl-wayland-server.h
+++ b/cogl/cogl-wayland-server.h
@@ -24,15 +24,13 @@
 #ifndef __COGL_WAYLAND_SERVER_H
 #define __COGL_WAYLAND_SERVER_H
 
-#include <glib.h>
-
 #include <wayland-server.h>
 
 #define __COGL_H_INSIDE__
 #include <cogl/cogl-context.h>
 #include <cogl/cogl-texture-2d.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * cogl_wayland_display_set_compositor_display:
@@ -79,6 +77,6 @@ cogl_wayland_texture_2d_new_from_buffer (CoglContext *ctx,
                                          struct wl_buffer *buffer,
                                          CoglError **error);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_WAYLAND_SERVER_H */
diff --git a/cogl/cogl-win32-renderer.h b/cogl/cogl-win32-renderer.h
index f05a620..f65bc8f 100644
--- a/cogl/cogl-win32-renderer.h
+++ b/cogl/cogl-win32-renderer.h
@@ -31,7 +31,7 @@
 #include <cogl/cogl-types.h>
 #include <cogl/cogl-renderer.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * cogl_win32_renderer_handle_event:
@@ -87,6 +87,6 @@ cogl_win32_renderer_remove_filter (CoglRenderer *renderer,
                                    CoglWin32FilterFunc func,
                                    void *data);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_WIN32_RENDERER_H__ */
diff --git a/cogl/cogl-xlib-renderer.h b/cogl/cogl-xlib-renderer.h
index 58dc866..a9277c6 100644
--- a/cogl/cogl-xlib-renderer.h
+++ b/cogl/cogl-xlib-renderer.h
@@ -29,12 +29,11 @@
 #define __COGL_XLIB_RENDERER_H__
 
 #include <X11/Xlib.h>
-#include <glib.h>
 
 #define __COGL_H_INSIDE__
 #include <cogl/cogl-renderer.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /*
  * cogl_xlib_renderer_handle_event:
@@ -140,6 +139,6 @@ cogl_xlib_renderer_set_event_retrieval_enabled (CoglRenderer *renderer,
 Display *
 cogl_xlib_renderer_get_display (CoglRenderer *renderer);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_XLIB_RENDERER_H__ */
diff --git a/cogl/cogl-xlib.h b/cogl/cogl-xlib.h
index 079a322..7a6bc7e 100644
--- a/cogl/cogl-xlib.h
+++ b/cogl/cogl-xlib.h
@@ -24,16 +24,16 @@
 #ifndef __COGL_XLIB_H__
 #define __COGL_XLIB_H__
 
-#include <glib.h>
-
 #include <X11/Xlib.h>
 
 #define __COGL_XLIB_H_INSIDE__
+#define __COGL_H_INSIDE__
 
+#include <cogl/cogl-types.h>
 #include <cogl/cogl-clutter-xlib.h>
 #include <cogl/cogl-xlib-renderer.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /*
  * cogl_xlib_get_display:
diff --git a/cogl/cogl.h b/cogl/cogl.h
index 681b708..b5e87b6 100644
--- a/cogl/cogl.h
+++ b/cogl/cogl.h
@@ -25,8 +25,6 @@
 #ifndef __COGL_H__
 #define __COGL_H__
 
-#include <glib.h>
-
 #define __COGL_H_INSIDE__
 
 #ifdef COGL_ENABLE_EXPERIMENTAL_2_0_API
diff --git a/cogl/cogl1-context.h b/cogl/cogl1-context.h
index f9cf946..014c05d 100644
--- a/cogl/cogl1-context.h
+++ b/cogl/cogl1-context.h
@@ -31,13 +31,11 @@
 #ifndef __COGL_1_CONTEXT_H__
 #define __COGL_1_CONTEXT_H__
 
-#include <glib.h>
-
 #include <cogl/cogl-types.h>
 #include <cogl/cogl-texture.h>
 #include <cogl/cogl-framebuffer.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * cogl_get_option_group:
@@ -1005,7 +1003,7 @@ cogl_set_draw_buffer (CoglBufferTarget target,
  * Deprecated: 1.2: The draw buffer API was replaced with a framebuffer API
  */
 void
-cogl_push_draw_buffer (void) G_GNUC_DEPRECATED;
+cogl_push_draw_buffer (void) COGL_GNUC_DEPRECATED;
 
 /**
  * cogl_pop_draw_buffer:
@@ -1015,7 +1013,7 @@ cogl_push_draw_buffer (void) G_GNUC_DEPRECATED;
  * Deprecated: 1.2: The draw buffer API was replaced with a framebuffer API
  */
 void
-cogl_pop_draw_buffer (void) G_GNUC_DEPRECATED;
+cogl_pop_draw_buffer (void) COGL_GNUC_DEPRECATED;
 
 #endif /* COGL_DISABLE_DEPRECATED */
 
@@ -1166,6 +1164,6 @@ cogl_begin_gl (void);
 void
 cogl_end_gl (void);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_1_CONTEXT_H__ */
diff --git a/cogl/cogl2-compatibility.h b/cogl/cogl2-compatibility.h
index 4707787..d1155a1 100644
--- a/cogl/cogl2-compatibility.h
+++ b/cogl/cogl2-compatibility.h
@@ -31,7 +31,7 @@
 #include <cogl/cogl-types.h>
 #include <cogl/cogl2-path.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 #define cogl_clip_push_from_path cogl2_clip_push_from_path
 /**
@@ -49,7 +49,7 @@ G_BEGIN_DECLS
 void
 cogl_clip_push_from_path (CoglPath *path);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL2_COMPATIBILITY_H__ */
 
diff --git a/cogl/cogl2-path.h b/cogl/cogl2-path.h
index 196e4c3..a751f88 100644
--- a/cogl/cogl2-path.h
+++ b/cogl/cogl2-path.h
@@ -30,7 +30,7 @@
 
 #include <cogl/cogl-types.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 /**
  * SECTION:cogl-paths
@@ -500,7 +500,7 @@ cogl_path_fill (CoglPath *path);
 void
 cogl_path_stroke (CoglPath *path);
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL2_PATH_H__ */
 
diff --git a/cogl/winsys/cogl-texture-pixmap-x11.h b/cogl/winsys/cogl-texture-pixmap-x11.h
index 9770bfa..5d78af3 100644
--- a/cogl/winsys/cogl-texture-pixmap-x11.h
+++ b/cogl/winsys/cogl-texture-pixmap-x11.h
@@ -26,11 +26,9 @@
 
 #define __COGL_H_INSIDE__
 
-#include <glib.h>
-
 #include <cogl/cogl-context.h>
 
-G_BEGIN_DECLS
+COGL_BEGIN_DECLS
 
 #ifdef COGL_ENABLE_EXPERIMENTAL_API
 
@@ -187,6 +185,6 @@ cogl_is_texture_pixmap_x11 (void *object);
 
 #endif /* COGL_ENABLE_EXPERIMENTAL_API */
 
-G_END_DECLS
+COGL_END_DECLS
 
 #endif /* __COGL_TEXTURE_PIXMAP_X11_H */
diff --git a/configure.ac b/configure.ac
index f68be9b..9ac5538 100644
--- a/configure.ac
+++ b/configure.ac
@@ -401,8 +401,11 @@ AS_IF([test "x$enable_glib" = "xyes"],
       [
         AS_GLIBCONFIG([deps/glib])
         COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -I\$(top_srcdir)/deps"
+        COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -I\$(top_builddir)/deps"
         COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -I\$(top_srcdir)/deps/glib"
+        COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -I\$(top_builddir)/deps/glib"
         COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -I\$(top_srcdir)/deps/gmodule"
+        COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -I\$(top_builddir)/deps/gmodule"
         EXPERIMENTAL_CONFIG=yes
         EXPERIMENTAL_OPTIONS="$EXPERIMENTAL_OPTIONS --disable-glib,"
         enable_nls=no
diff --git a/tests/conform/test-utils.h b/tests/conform/test-utils.h
index 68741b2..22254fc 100644
--- a/tests/conform/test-utils.h
+++ b/tests/conform/test-utils.h
@@ -1,6 +1,8 @@
 #ifndef _TEST_UTILS_H_
 #define _TEST_UTILS_H_
 
+#include <glib.h>
+
 /* We don't really care about functions that are defined without a
    header for the unit tests so we can just disable it here */
 #ifdef __GNUC__



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]