[cogl/cogl.msvc.new: 6/19] cogl: Mark public symbols for export



commit 3d03375d8df8817adf46cf307b95b52cf1c77c9c
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Feb 11 16:55:26 2019 +0800

    cogl: Mark public symbols for export
    
    This way we can reduce the maintenance burden for updating the
    cogl.symbols files for the Visual Studio builds, as we can now export
    symbols using __declspec(dllexport).  The cogl.symbols file is still
    kept to remind us of the usage of private Cogl symbols in Cogl-Path
    and Cogl-Pango that we want to replace with public with public symbols.

 cogl/cogl-atlas-texture.h        |  11 ++--
 cogl/cogl-attribute-buffer.h     |   7 ++-
 cogl/cogl-attribute.h            |  33 +++++-----
 cogl/cogl-bitmap.h               |  26 ++++----
 cogl/cogl-bitmask.h              |  24 ++++---
 cogl/cogl-buffer.h               |  18 +++---
 cogl/cogl-color.h                |  71 ++++++++++-----------
 cogl/cogl-context.h              |  19 +++---
 cogl/cogl-defines.h.in           |  14 +++++
 cogl/cogl-defines.h.win32.in     |  14 +++++
 cogl/cogl-defines.h.win32_SDL.in |  14 +++++
 cogl/cogl-depth-state.h          |  20 +++---
 cogl/cogl-display.h              |  13 ++--
 cogl/cogl-egl.h                  |   4 +-
 cogl/cogl-enum-types.h.in        |   3 +
 cogl/cogl-error.h                |   6 +-
 cogl/cogl-euler.h                |  13 ++--
 cogl/cogl-fence.h                |   6 +-
 cogl/cogl-frame-info.h           |   8 ++-
 cogl/cogl-framebuffer.h          | 131 ++++++++++++++++++++-------------------
 cogl/cogl-gles2.h                |  19 +++---
 cogl/cogl-glib-source.h          |   4 +-
 cogl/cogl-glx.h                  |   2 +-
 cogl/cogl-index-buffer.h         |   5 +-
 cogl/cogl-indices.h              |  17 ++---
 cogl/cogl-kms-display.h          |   4 +-
 cogl/cogl-kms-renderer.h         |   6 +-
 cogl/cogl-macros.h               |  91 +++++++++++++--------------
 cogl/cogl-matrix-stack.h         |  52 ++++++++--------
 cogl/cogl-matrix.h               |  59 +++++++++---------
 cogl/cogl-meta-texture.h         |   2 +-
 cogl/cogl-mir-renderer.h         |   8 +--
 cogl/cogl-object.h               |  13 ++--
 cogl/cogl-offscreen.h            |   5 +-
 cogl/cogl-onscreen-template.h    |  11 ++--
 cogl/cogl-onscreen.h             |  64 ++++++++++---------
 cogl/cogl-output.h               |  17 ++---
 cogl/cogl-pipeline-layer-state.h |  42 ++++++-------
 cogl/cogl-pipeline-state.h       |  80 ++++++++++++------------
 cogl/cogl-pipeline.h             |  11 ++--
 cogl/cogl-pixel-buffer.h         |   7 ++-
 cogl/cogl-poll.h                 |   4 +-
 cogl/cogl-primitive-texture.h    |   4 +-
 cogl/cogl-primitive.h            |  47 +++++++-------
 cogl/cogl-primitives.h           |  14 +++--
 cogl/cogl-quaternion.h           |  51 +++++++--------
 cogl/cogl-renderer.h             |  27 ++++----
 cogl/cogl-sdl.h                  |  12 ++--
 cogl/cogl-snippet.h              |  25 ++++----
 cogl/cogl-sub-texture.h          |   9 ++-
 cogl/cogl-swap-chain.h           |   9 +--
 cogl/cogl-texture-2d-gl.h        |   2 +-
 cogl/cogl-texture-2d-sliced.h    |  11 ++--
 cogl/cogl-texture-2d.h           |  11 ++--
 cogl/cogl-texture-3d.h           |  11 ++--
 cogl/cogl-texture-rectangle.h    |   9 +--
 cogl/cogl-texture.h              |  32 +++++-----
 cogl/cogl-types.h                |  12 ++--
 cogl/cogl-vector.h               |  34 +++++-----
 cogl/cogl-wayland-renderer.h     |   6 +-
 cogl/cogl-wayland-server.h       |   6 +-
 cogl/cogl-win32-renderer.h       |   8 +--
 cogl/cogl-xlib-renderer.h        |  16 ++---
 cogl/cogl1-context.h             |   4 +-
 64 files changed, 722 insertions(+), 616 deletions(-)
---
diff --git a/cogl/cogl-atlas-texture.h b/cogl/cogl-atlas-texture.h
index 79c15b9e..c0828bf3 100644
--- a/cogl/cogl-atlas-texture.h
+++ b/cogl/cogl-atlas-texture.h
@@ -77,6 +77,7 @@ typedef struct _CoglAtlasTexture CoglAtlasTexture;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_atlas_texture_get_gtype (void);
 #endif
 
@@ -112,7 +113,7 @@ GType cogl_atlas_texture_get_gtype (void);
  * Since: 1.16
  * Stability: unstable
  */
-CoglAtlasTexture *
+COGL_API CoglAtlasTexture *
 cogl_atlas_texture_new_with_size (CoglContext *ctx,
                                   int width,
                                   int height);
@@ -150,7 +151,7 @@ cogl_atlas_texture_new_with_size (CoglContext *ctx,
  * Since: 1.16
  * Stability: unstable
  */
-CoglAtlasTexture *
+COGL_API CoglAtlasTexture *
 cogl_atlas_texture_new_from_file (CoglContext *ctx,
                                   const char *filename,
                                   CoglError **error);
@@ -195,7 +196,7 @@ cogl_atlas_texture_new_from_file (CoglContext *ctx,
  * Since: 1.16
  * Stability: unstable
  */
-CoglAtlasTexture *
+COGL_API CoglAtlasTexture *
 cogl_atlas_texture_new_from_data (CoglContext *ctx,
                                   int width,
                                   int height,
@@ -235,7 +236,7 @@ cogl_atlas_texture_new_from_data (CoglContext *ctx,
  * Since: 1.16
  * Stability: unstable
  */
-CoglAtlasTexture *
+COGL_API CoglAtlasTexture *
 cogl_atlas_texture_new_from_bitmap (CoglBitmap *bmp);
 
 /**
@@ -250,7 +251,7 @@ cogl_atlas_texture_new_from_bitmap (CoglBitmap *bmp);
  * Since: 1.16
  * Stability: Unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_atlas_texture (void *object);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-attribute-buffer.h b/cogl/cogl-attribute-buffer.h
index 189d81eb..4c4d283c 100644
--- a/cogl/cogl-attribute-buffer.h
+++ b/cogl/cogl-attribute-buffer.h
@@ -67,6 +67,7 @@ COGL_BEGIN_DECLS
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_attribute_buffer_get_gtype (void);
 #endif
 
@@ -93,7 +94,7 @@ GType cogl_attribute_buffer_get_gtype (void);
  *
  * Stability: Unstable
  */
-CoglAttributeBuffer *
+COGL_API CoglAttributeBuffer *
 cogl_attribute_buffer_new_with_size (CoglContext *context,
                                      size_t bytes);
 
@@ -126,7 +127,7 @@ cogl_attribute_buffer_new_with_size (CoglContext *context,
  * Since: 1.4
  * Stability: Unstable
  */
-CoglAttributeBuffer *
+COGL_API CoglAttributeBuffer *
 cogl_attribute_buffer_new (CoglContext *context,
                            size_t bytes,
                            const void *data);
@@ -143,7 +144,7 @@ cogl_attribute_buffer_new (CoglContext *context,
  * Since: 1.4
  * Stability: Unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_attribute_buffer (void *object);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-attribute.h b/cogl/cogl-attribute.h
index 736b0c67..82d4254b 100644
--- a/cogl/cogl-attribute.h
+++ b/cogl/cogl-attribute.h
@@ -66,6 +66,7 @@ COGL_BEGIN_DECLS
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_attribute_get_gtype (void);
 #endif
 
@@ -159,7 +160,7 @@ GType cogl_attribute_get_gtype (void);
  */
 /* XXX: look for a precedent to see if the stride/offset args should
  * have a different order. */
-CoglAttribute *
+COGL_API CoglAttribute *
 cogl_attribute_new (CoglAttributeBuffer *attribute_buffer,
                     const char *name,
                     size_t stride,
@@ -187,7 +188,7 @@ cogl_attribute_new (CoglAttributeBuffer *attribute_buffer,
  * Return value: (transfer full): A newly allocated #CoglAttribute
  *          representing the given constant @value.
  */
-CoglAttribute *
+COGL_API CoglAttribute *
 cogl_attribute_new_const_1f (CoglContext *context,
                              const char *name,
                              float value);
@@ -214,7 +215,7 @@ cogl_attribute_new_const_1f (CoglContext *context,
  * Return value: (transfer full): A newly allocated #CoglAttribute
  *          representing the given constant vector.
  */
-CoglAttribute *
+COGL_API CoglAttribute *
 cogl_attribute_new_const_2f (CoglContext *context,
                              const char *name,
                              float component0,
@@ -246,7 +247,7 @@ cogl_attribute_new_const_2f (CoglContext *context,
  * Return value: (transfer full): A newly allocated #CoglAttribute
  *          representing the given constant vector.
  */
-CoglAttribute *
+COGL_API CoglAttribute *
 cogl_attribute_new_const_3f (CoglContext *context,
                              const char *name,
                              float component0,
@@ -281,7 +282,7 @@ cogl_attribute_new_const_3f (CoglContext *context,
  * Return value: (transfer full): A newly allocated #CoglAttribute
  *          representing the given constant vector.
  */
-CoglAttribute *
+COGL_API CoglAttribute *
 cogl_attribute_new_const_4f (CoglContext *context,
                              const char *name,
                              float component0,
@@ -310,7 +311,7 @@ cogl_attribute_new_const_4f (CoglContext *context,
  * Return value: (transfer full): A newly allocated #CoglAttribute
  *          representing the given constant vector.
  */
-CoglAttribute *
+COGL_API CoglAttribute *
 cogl_attribute_new_const_2fv (CoglContext *context,
                               const char *name,
                               const float *value);
@@ -339,7 +340,7 @@ cogl_attribute_new_const_2fv (CoglContext *context,
  * Return value: (transfer full): A newly allocated #CoglAttribute
  *          representing the given constant vector.
  */
-CoglAttribute *
+COGL_API CoglAttribute *
 cogl_attribute_new_const_3fv (CoglContext *context,
                               const char *name,
                               const float *value);
@@ -369,7 +370,7 @@ cogl_attribute_new_const_3fv (CoglContext *context,
  * Return value: (transfer full): A newly allocated #CoglAttribute
  *          representing the given constant vector.
  */
-CoglAttribute *
+COGL_API CoglAttribute *
 cogl_attribute_new_const_4fv (CoglContext *context,
                               const char *name,
                               const float *value);
@@ -402,7 +403,7 @@ cogl_attribute_new_const_4fv (CoglContext *context,
  * Return value: (transfer full): A newly allocated #CoglAttribute
  *          representing the given constant matrix.
  */
-CoglAttribute *
+COGL_API CoglAttribute *
 cogl_attribute_new_const_2x2fv (CoglContext *context,
                                 const char *name,
                                 const float *matrix2x2,
@@ -437,7 +438,7 @@ cogl_attribute_new_const_2x2fv (CoglContext *context,
  * Return value: (transfer full): A newly allocated #CoglAttribute
  *          representing the given constant matrix.
  */
-CoglAttribute *
+COGL_API CoglAttribute *
 cogl_attribute_new_const_3x3fv (CoglContext *context,
                                 const char *name,
                                 const float *matrix3x3,
@@ -472,7 +473,7 @@ cogl_attribute_new_const_3x3fv (CoglContext *context,
  * Return value: (transfer full): A newly allocated #CoglAttribute
  *          representing the given constant matrix.
  */
-CoglAttribute *
+COGL_API CoglAttribute *
 cogl_attribute_new_const_4x4fv (CoglContext *context,
                                 const char *name,
                                 const float *matrix4x4,
@@ -496,7 +497,7 @@ cogl_attribute_new_const_4x4fv (CoglContext *context,
  * Stability: unstable
  * Since: 1.10
  */
-void
+COGL_API void
 cogl_attribute_set_normalized (CoglAttribute *attribute,
                                CoglBool normalized);
 
@@ -510,7 +511,7 @@ cogl_attribute_set_normalized (CoglAttribute *attribute,
  * Stability: unstable
  * Since: 1.10
  */
-CoglBool
+COGL_API CoglBool
 cogl_attribute_get_normalized (CoglAttribute *attribute);
 
 /**
@@ -523,7 +524,7 @@ cogl_attribute_get_normalized (CoglAttribute *attribute);
  * Stability: unstable
  * Since: 1.10
  */
-CoglAttributeBuffer *
+COGL_API CoglAttributeBuffer *
 cogl_attribute_get_buffer (CoglAttribute *attribute);
 
 /**
@@ -536,7 +537,7 @@ cogl_attribute_get_buffer (CoglAttribute *attribute);
  * Stability: unstable
  * Since: 1.10
  */
-void
+COGL_API void
 cogl_attribute_set_buffer (CoglAttribute *attribute,
                            CoglAttributeBuffer *attribute_buffer);
 
@@ -549,7 +550,7 @@ cogl_attribute_set_buffer (CoglAttribute *attribute,
  * Return value: %TRUE if the @object references a #CoglAttribute,
  *   %FALSE otherwise
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_attribute (void *object);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-bitmap.h b/cogl/cogl-bitmap.h
index 13b5cd2b..bd507f1f 100644
--- a/cogl/cogl-bitmap.h
+++ b/cogl/cogl-bitmap.h
@@ -60,6 +60,7 @@ COGL_BEGIN_DECLS
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_bitmap_get_gtype (void);
 #endif
 
@@ -87,7 +88,7 @@ GType cogl_bitmap_get_gtype (void);
  *
  * Since: 1.0
  */
-CoglBitmap *
+COGL_API CoglBitmap *
 cogl_bitmap_new_from_file (const char *filename,
                            CoglError **error);
 
@@ -106,7 +107,7 @@ cogl_bitmap_new_from_file (const char *filename,
  *
  * Since: 2.0
  */
-CoglBitmap *
+COGL_API CoglBitmap *
 cogl_android_bitmap_new_from_asset (CoglContext *context,
                                     AAssetManager *manager,
                                     const char *filename,
@@ -134,7 +135,7 @@ cogl_android_bitmap_new_from_asset (CoglContext *context,
  * Since: 1.8
  * Stability: unstable
  */
-CoglBitmap *
+COGL_API CoglBitmap *
 cogl_bitmap_new_from_buffer (CoglBuffer *buffer,
                              CoglPixelFormat format,
                              int width,
@@ -171,7 +172,7 @@ cogl_bitmap_new_from_buffer (CoglBuffer *buffer,
  * Since: 1.10
  * Stability: Unstable
  */
-CoglBitmap *
+COGL_API CoglBitmap *
 cogl_bitmap_new_with_size (CoglContext *context,
                            unsigned int width,
                            unsigned int height,
@@ -197,7 +198,7 @@ cogl_bitmap_new_with_size (CoglContext *context,
  * Since: 1.10
  * Stability: unstable
  */
-CoglBitmap *
+COGL_API CoglBitmap *
 cogl_bitmap_new_for_data (CoglContext *context,
                           int width,
                           int height,
@@ -213,7 +214,7 @@ cogl_bitmap_new_for_data (CoglContext *context,
  * Since: 1.10
  * Stability: unstable
  */
-CoglPixelFormat
+COGL_API CoglPixelFormat
 cogl_bitmap_get_format (CoglBitmap *bitmap);
 
 /**
@@ -224,7 +225,7 @@ cogl_bitmap_get_format (CoglBitmap *bitmap);
  * Since: 1.10
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_bitmap_get_width (CoglBitmap *bitmap);
 
 /**
@@ -235,7 +236,7 @@ cogl_bitmap_get_width (CoglBitmap *bitmap);
  * Since: 1.10
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_bitmap_get_height (CoglBitmap *bitmap);
 
 /**
@@ -248,7 +249,7 @@ cogl_bitmap_get_height (CoglBitmap *bitmap);
  * Since: 1.10
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_bitmap_get_rowstride (CoglBitmap *bitmap);
 
 /**
@@ -262,7 +263,7 @@ cogl_bitmap_get_rowstride (CoglBitmap *bitmap);
  * Stability: unstable
  * Since: 1.10
  */
-CoglPixelBuffer *
+COGL_API CoglPixelBuffer *
 cogl_bitmap_get_buffer (CoglBitmap *bitmap);
 
 #endif /* COGL_ENABLE_EXPERIMENTAL_API */
@@ -280,7 +281,7 @@ cogl_bitmap_get_buffer (CoglBitmap *bitmap);
  *
  * Since: 1.0
  */
-CoglBool
+COGL_API CoglBool
 cogl_bitmap_get_size_from_file (const char *filename,
                                 int *width,
                                 int *height);
@@ -296,7 +297,7 @@ cogl_bitmap_get_size_from_file (const char *filename,
  *
  * Since: 1.0
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_bitmap (void *object);
 
 /**
@@ -329,6 +330,7 @@ typedef enum {
   COGL_BITMAP_ERROR_CORRUPT_IMAGE
 } CoglBitmapError;
 
+COGL_API 
 uint32_t cogl_bitmap_error_quark (void);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-bitmask.h b/cogl/cogl-bitmask.h
index e0db3df2..4365e094 100644
--- a/cogl/cogl-bitmask.h
+++ b/cogl/cogl-bitmask.h
@@ -62,22 +62,28 @@ COGL_BEGIN_DECLS
 typedef struct _CoglBitmaskImaginaryType *CoglBitmask;
 
 /* These are internal helper macros */
+#if defined (G_OS_WIN32) && (GLIB_SIZEOF_VOID_P == 8)
+# define COGL_PTR_APPEND_SUFFIX(x) x##ULL
+#else
+# define COGL_PTR_APPEND_SUFFIX(x) x##UL
+#endif
+
 #define _cogl_bitmask_to_number(bitmask) \
-  ((unsigned long) (*bitmask))
+  ((size_t) (*bitmask))
 #define _cogl_bitmask_to_bits(bitmask) \
-  (_cogl_bitmask_to_number (bitmask) >> 1UL)
+  (_cogl_bitmask_to_number (bitmask) >> COGL_PTR_APPEND_SUFFIX (1))
 /* The least significant bit is set to mark that no array has been
    allocated yet */
 #define _cogl_bitmask_from_bits(bits) \
-  ((void *) ((((unsigned long) (bits)) << 1UL) | 1UL))
+  ((void *) ((((size_t) (bits)) << COGL_PTR_APPEND_SUFFIX (1)) | COGL_PTR_APPEND_SUFFIX (1)))
 
 /* Internal helper macro to determine whether this bitmask has a
    GArray allocated or whether the pointer is just used directly */
 #define _cogl_bitmask_has_array(bitmask) \
-  (!(_cogl_bitmask_to_number (bitmask) & 1UL))
+  (!(_cogl_bitmask_to_number (bitmask) & COGL_PTR_APPEND_SUFFIX (1)))
 
 /* Number of bits we can use before needing to allocate an array */
-#define COGL_BITMASK_MAX_DIRECT_BITS (sizeof (unsigned long) * 8 - 1)
+#define COGL_BITMASK_MAX_DIRECT_BITS (sizeof (size_t) * 8 - 1)
 
 /*
  * _cogl_bitmask_init:
@@ -173,7 +179,7 @@ _cogl_bitmask_get (const CoglBitmask *bitmask, unsigned int bit_num)
   else if (bit_num >= COGL_BITMASK_MAX_DIRECT_BITS)
     return FALSE;
   else
-    return !!(_cogl_bitmask_to_bits (bitmask) & (1UL << bit_num));
+    return !!(_cogl_bitmask_to_bits (bitmask) & (COGL_PTR_APPEND_SUFFIX (1) << bit_num));
 }
 
 /*
@@ -192,10 +198,10 @@ _cogl_bitmask_set (CoglBitmask *bitmask, unsigned int bit_num, CoglBool value)
     _cogl_bitmask_set_in_array (bitmask, bit_num, value);
   else if (value)
     *bitmask = _cogl_bitmask_from_bits (_cogl_bitmask_to_bits (bitmask) |
-                                        (1UL << bit_num));
+                                        (COGL_PTR_APPEND_SUFFIX (1) << bit_num));
   else
     *bitmask = _cogl_bitmask_from_bits (_cogl_bitmask_to_bits (bitmask) &
-                                        ~(1UL << bit_num));
+                                        ~(COGL_PTR_APPEND_SUFFIX (1) << bit_num));
 }
 
 /*
@@ -304,7 +310,7 @@ _cogl_bitmask_popcount_upto (const CoglBitmask *bitmask,
     return _cogl_util_popcountl (_cogl_bitmask_to_bits (bitmask));
   else
     return _cogl_util_popcountl (_cogl_bitmask_to_bits (bitmask) &
-                                 ((1UL << upto) - 1));
+                                 ((COGL_PTR_APPEND_SUFFIX (1) << upto) - 1));
 }
 
 COGL_END_DECLS
diff --git a/cogl/cogl-buffer.h b/cogl/cogl-buffer.h
index adbc51f9..6ae88e83 100644
--- a/cogl/cogl-buffer.h
+++ b/cogl/cogl-buffer.h
@@ -92,7 +92,7 @@ typedef enum { /*< prefix=COGL_BUFFER_ERROR >*/
   COGL_BUFFER_ERROR_MAP
 } CoglBufferError;
 
-uint32_t
+COGL_API uint32_t
 _cogl_buffer_error_domain (void);
 
 /**
@@ -106,7 +106,7 @@ _cogl_buffer_error_domain (void);
  * Since: 1.2
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_buffer (void *object);
 
 /**
@@ -120,7 +120,7 @@ cogl_is_buffer (void *object);
  * Since: 1.2
  * Stability: unstable
  */
-unsigned int
+COGL_API unsigned int
 cogl_buffer_get_size (CoglBuffer *buffer);
 
 /**
@@ -153,7 +153,7 @@ typedef enum { /*< prefix=COGL_BUFFER_UPDATE_HINT >*/
  * Since: 1.2
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_buffer_set_update_hint (CoglBuffer          *buffer,
                              CoglBufferUpdateHint hint);
 
@@ -168,7 +168,7 @@ cogl_buffer_set_update_hint (CoglBuffer          *buffer,
  * Since: 1.2
  * Stability: unstable
  */
-CoglBufferUpdateHint
+COGL_API CoglBufferUpdateHint
 cogl_buffer_get_update_hint (CoglBuffer *buffer);
 
 /**
@@ -240,7 +240,7 @@ typedef enum { /*< prefix=COGL_BUFFER_MAP_HINT >*/
  * Since: 1.2
  * Stability: unstable
  */
-void *
+COGL_API void *
 cogl_buffer_map (CoglBuffer *buffer,
                  CoglBufferAccess access,
                  CoglBufferMapHint hints);
@@ -277,7 +277,7 @@ cogl_buffer_map (CoglBuffer *buffer,
  * Since: 2.0
  * Stability: unstable
  */
-void *
+COGL_API void *
 cogl_buffer_map_range (CoglBuffer *buffer,
                        size_t offset,
                        size_t size,
@@ -294,7 +294,7 @@ cogl_buffer_map_range (CoglBuffer *buffer,
  * Since: 1.2
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_buffer_unmap (CoglBuffer *buffer);
 
 /**
@@ -313,7 +313,7 @@ cogl_buffer_unmap (CoglBuffer *buffer);
  * Since: 1.2
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_buffer_set_data (CoglBuffer *buffer,
                       size_t offset,
                       const void *data,
diff --git a/cogl/cogl-color.h b/cogl/cogl-color.h
index bdb0bfaf..e41eca0f 100644
--- a/cogl/cogl-color.h
+++ b/cogl/cogl-color.h
@@ -60,6 +60,7 @@ COGL_BEGIN_DECLS
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_color_get_gtype (void);
 #endif
 
@@ -73,7 +74,7 @@ GType cogl_color_get_gtype (void);
  *
  * Since: 1.0
  */
-CoglColor *
+COGL_API CoglColor *
 cogl_color_new (void);
 
 /**
@@ -87,7 +88,7 @@ cogl_color_new (void);
  *
  * Since: 1.0
  */
-CoglColor *
+COGL_API CoglColor *
 cogl_color_copy (const CoglColor *color);
 
 /**
@@ -98,7 +99,7 @@ cogl_color_copy (const CoglColor *color);
  *
  * Since: 1.0
  */
-void
+COGL_API void
 cogl_color_free (CoglColor *color);
 
 /**
@@ -113,7 +114,7 @@ cogl_color_free (CoglColor *color);
  *
  * Since: 1.4
  */
-void
+COGL_API void
 cogl_color_init_from_4ub (CoglColor *color,
                           uint8_t red,
                           uint8_t green,
@@ -153,7 +154,7 @@ cogl_color_set_from_4ub (CoglColor *color,
  *
  * Since: 1.4
  */
-void
+COGL_API void
 cogl_color_init_from_4f (CoglColor *color,
                          float red,
                          float green,
@@ -190,7 +191,7 @@ cogl_color_set_from_4f (CoglColor *color,
  *
  * Since: 1.4
  */
-void
+COGL_API void
 cogl_color_init_from_4fv (CoglColor *color,
                           const float *color_array);
 
@@ -205,7 +206,7 @@ cogl_color_init_from_4fv (CoglColor *color,
  *
  * Since: 1.0
  */
-unsigned char
+COGL_API unsigned char
 cogl_color_get_red_byte (const CoglColor *color);
 
 /**
@@ -219,7 +220,7 @@ cogl_color_get_red_byte (const CoglColor *color);
  *
  * Since: 1.0
  */
-unsigned char
+COGL_API unsigned char
 cogl_color_get_green_byte (const CoglColor *color);
 
 /**
@@ -233,7 +234,7 @@ cogl_color_get_green_byte (const CoglColor *color);
  *
  * Since: 1.0
  */
-unsigned char
+COGL_API unsigned char
 cogl_color_get_blue_byte (const CoglColor *color);
 
 /**
@@ -247,7 +248,7 @@ cogl_color_get_blue_byte (const CoglColor *color);
  *
  * Since: 1.0
  */
-unsigned char
+COGL_API unsigned char
 cogl_color_get_alpha_byte (const CoglColor *color);
 
 /**
@@ -261,7 +262,7 @@ cogl_color_get_alpha_byte (const CoglColor *color);
  *
  * Since: 1.0
  */
-float
+COGL_API float
 cogl_color_get_red_float (const CoglColor *color);
 
 /**
@@ -275,7 +276,7 @@ cogl_color_get_red_float (const CoglColor *color);
  *
  * Since: 1.0
  */
-float
+COGL_API float
 cogl_color_get_green_float (const CoglColor *color);
 
 /**
@@ -289,7 +290,7 @@ cogl_color_get_green_float (const CoglColor *color);
  *
  * Since: 1.0
  */
-float
+COGL_API float
 cogl_color_get_blue_float (const CoglColor *color);
 
 /**
@@ -303,7 +304,7 @@ cogl_color_get_blue_float (const CoglColor *color);
  *
  * Since: 1.0
  */
-float
+COGL_API float
 cogl_color_get_alpha_float (const CoglColor *color);
 
 /**
@@ -317,7 +318,7 @@ cogl_color_get_alpha_float (const CoglColor *color);
  *
  * Since: 1.0
  */
-float
+COGL_API float
 cogl_color_get_red (const CoglColor *color);
 
 /**
@@ -331,7 +332,7 @@ cogl_color_get_red (const CoglColor *color);
  *
  * Since: 1.0
  */
-float
+COGL_API float
 cogl_color_get_green (const CoglColor *color);
 
 /**
@@ -345,7 +346,7 @@ cogl_color_get_green (const CoglColor *color);
  *
  * Since: 1.0
  */
-float
+COGL_API float
 cogl_color_get_blue (const CoglColor *color);
 
 /**
@@ -359,7 +360,7 @@ cogl_color_get_blue (const CoglColor *color);
  *
  * Since: 1.0
  */
-float
+COGL_API float
 cogl_color_get_alpha (const CoglColor *color);
 
 /**
@@ -371,7 +372,7 @@ cogl_color_get_alpha (const CoglColor *color);
  *
  * Since: 1.4
  */
-void
+COGL_API void
 cogl_color_set_red_byte (CoglColor     *color,
                          unsigned char  red);
 
@@ -384,7 +385,7 @@ cogl_color_set_red_byte (CoglColor     *color,
  *
  * Since: 1.4
  */
-void
+COGL_API void
 cogl_color_set_green_byte (CoglColor     *color,
                            unsigned char  green);
 
@@ -397,7 +398,7 @@ cogl_color_set_green_byte (CoglColor     *color,
  *
  * Since: 1.4
  */
-void
+COGL_API void
 cogl_color_set_blue_byte (CoglColor     *color,
                           unsigned char  blue);
 
@@ -410,7 +411,7 @@ cogl_color_set_blue_byte (CoglColor     *color,
  *
  * Since: 1.4
  */
-void
+COGL_API void
 cogl_color_set_alpha_byte (CoglColor     *color,
                            unsigned char  alpha);
 
@@ -423,7 +424,7 @@ cogl_color_set_alpha_byte (CoglColor     *color,
  *
  * since: 1.4
  */
-void
+COGL_API void
 cogl_color_set_red_float (CoglColor *color,
                           float      red);
 
@@ -436,7 +437,7 @@ cogl_color_set_red_float (CoglColor *color,
  *
  * since: 1.4
  */
-void
+COGL_API void
 cogl_color_set_green_float (CoglColor *color,
                             float      green);
 
@@ -449,7 +450,7 @@ cogl_color_set_green_float (CoglColor *color,
  *
  * since: 1.4
  */
-void
+COGL_API void
 cogl_color_set_blue_float (CoglColor *color,
                            float      blue);
 
@@ -462,7 +463,7 @@ cogl_color_set_blue_float (CoglColor *color,
  *
  * since: 1.4
  */
-void
+COGL_API void
 cogl_color_set_alpha_float (CoglColor *color,
                             float      alpha);
 
@@ -475,7 +476,7 @@ cogl_color_set_alpha_float (CoglColor *color,
  *
  * Since: 1.4
  */
-void
+COGL_API void
 cogl_color_set_red (CoglColor *color,
                     float      red);
 
@@ -488,7 +489,7 @@ cogl_color_set_red (CoglColor *color,
  *
  * Since: 1.4
  */
-void
+COGL_API void
 cogl_color_set_green (CoglColor *color,
                       float green);
 
@@ -501,7 +502,7 @@ cogl_color_set_green (CoglColor *color,
  *
  * Since: 1.4
  */
-void
+COGL_API void
 cogl_color_set_blue (CoglColor *color,
                      float blue);
 
@@ -514,7 +515,7 @@ cogl_color_set_blue (CoglColor *color,
  *
  * Since: 1.4
  */
-void
+COGL_API void
 cogl_color_set_alpha (CoglColor *color,
                       float alpha);
 
@@ -528,7 +529,7 @@ cogl_color_set_alpha (CoglColor *color,
  *
  * Since: 1.0
  */
-void
+COGL_API void
 cogl_color_premultiply (CoglColor *color);
 
 /**
@@ -541,7 +542,7 @@ cogl_color_premultiply (CoglColor *color);
  *
  * Since: 1.4
  */
-void
+COGL_API void
 cogl_color_unpremultiply (CoglColor *color);
 
 /**
@@ -558,7 +559,7 @@ cogl_color_unpremultiply (CoglColor *color);
  *
  * Since: 1.0
  */
-CoglBool
+COGL_API CoglBool
 cogl_color_equal (const void *v1, const void *v2);
 
 /**
@@ -575,7 +576,7 @@ cogl_color_equal (const void *v1, const void *v2);
  *
  * Since: 1.16
  */
-void
+COGL_API void
 cogl_color_to_hsl (const CoglColor *color,
                    float           *hue,
                    float           *saturation,
@@ -593,7 +594,7 @@ cogl_color_to_hsl (const CoglColor *color,
  *
  * Since: 1.16
  */
-void
+COGL_API void
 cogl_color_init_from_hsl (CoglColor *color,
                           float      hue,
                           float      saturation,
diff --git a/cogl/cogl-context.h b/cogl/cogl-context.h
index 07badeb4..6b6399c9 100644
--- a/cogl/cogl-context.h
+++ b/cogl/cogl-context.h
@@ -107,6 +107,7 @@ COGL_BEGIN_DECLS
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_context_get_gtype (void);
 #endif
 
@@ -122,7 +123,7 @@ GType cogl_context_get_gtype (void);
  * Since: 1.8
  * Stability: unstable
  */
-CoglContext *
+COGL_API CoglContext *
 cogl_context_new (CoglDisplay *display,
                   CoglError **error);
 
@@ -141,7 +142,7 @@ cogl_context_new (CoglDisplay *display,
  * Since: 1.8
  * Stability: unstable
  */
-CoglDisplay *
+COGL_API CoglDisplay *
 cogl_context_get_display (CoglContext *context);
 
 /**
@@ -160,7 +161,7 @@ cogl_context_get_display (CoglContext *context);
  * Since: 1.16
  * Stability: unstable
  */
-CoglRenderer *
+COGL_API CoglRenderer *
 cogl_context_get_renderer (CoglContext *context);
 
 #ifdef COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT
@@ -176,7 +177,7 @@ cogl_context_get_renderer (CoglContext *context);
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_android_set_native_window (ANativeWindow *window);
 #endif
 
@@ -192,7 +193,7 @@ cogl_android_set_native_window (ANativeWindow *window);
  * Since: 1.10
  * Stability: Unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_context (void *object);
 
 #endif /* COGL_ENABLE_EXPERIMENTAL_2_0_API */
@@ -316,7 +317,7 @@ typedef enum _CoglFeatureID
  * Since: 1.10
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_has_feature (CoglContext *context, CoglFeatureID feature);
 
 /**
@@ -336,7 +337,7 @@ cogl_has_feature (CoglContext *context, CoglFeatureID feature);
  * Since: 1.10
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_has_features (CoglContext *context, ...);
 
 /**
@@ -365,7 +366,7 @@ typedef void (*CoglFeatureCallback) (CoglFeatureID feature, void *user_data);
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_foreach_feature (CoglContext *context,
                       CoglFeatureCallback callback,
                       void *user_data);
@@ -390,7 +391,7 @@ cogl_foreach_feature (CoglContext *context,
  * Since: 1.14
  * Stability: unstable
  */
-int64_t
+COGL_API int64_t
 cogl_get_clock_time (CoglContext *context);
 
 #endif /* COGL_ENABLE_EXPERIMENTAL_API */
diff --git a/cogl/cogl-defines.h.in b/cogl/cogl-defines.h.in
index eb3ad926..2092e651 100644
--- a/cogl/cogl-defines.h.in
+++ b/cogl/cogl-defines.h.in
@@ -35,6 +35,20 @@
 #ifndef __COGL_DEFINES_H__
 #define __COGL_DEFINES_H__
 
+#if defined (_MSC_VER) && !defined (COGL_STATIC)
+# ifdef COGL_COMPILATION
+#  define _COGL_EXPORTS __declspec (dllexport)
+# else
+#  define _COGL_EXPORTS __declspec (dllimport)
+# endif
+#else
+# define _COGL_EXPORTS
+#endif
+
+#ifndef COGL_API
+# define COGL_API _COGL_EXPORTS
+#endif
+
 @COGL_DEFINES@
 
 #define COGL_VERSION_MAJOR_INTERNAL 1
diff --git a/cogl/cogl-defines.h.win32.in b/cogl/cogl-defines.h.win32.in
index b484fd24..ee761d6f 100644
--- a/cogl/cogl-defines.h.win32.in
+++ b/cogl/cogl-defines.h.win32.in
@@ -39,6 +39,20 @@
 
 G_BEGIN_DECLS
 
+#if defined (_MSC_VER) && !defined (COGL_STATIC)
+# ifdef COGL_COMPILATION
+#  define _COGL_EXPORTS __declspec (dllexport)
+# else
+#  define _COGL_EXPORTS __declspec (dllimport)
+# endif
+#else
+# define _COGL_EXPORTS
+#endif
+
+#ifndef COGL_API
+# define COGL_API _COGL_EXPORTS
+#endif
+
 #define COGL_HAS_GLIB_SUPPORT 1
 #define COGL_HAS_GTYPE_SUPPORT 1
 #define COGL_HAS_WGL_SUPPORT 1
diff --git a/cogl/cogl-defines.h.win32_SDL.in b/cogl/cogl-defines.h.win32_SDL.in
index acd246b2..1c98e313 100644
--- a/cogl/cogl-defines.h.win32_SDL.in
+++ b/cogl/cogl-defines.h.win32_SDL.in
@@ -39,6 +39,20 @@
 
 G_BEGIN_DECLS
 
+#if defined (_MSC_VER) && !defined (COGL_STATIC)
+# ifdef COGL_COMPILATION
+#  define _COGL_EXPORTS __declspec (dllexport)
+# else
+#  define _COGL_EXPORTS __declspec (dllimport)
+# endif
+#else
+# define _COGL_EXPORTS
+#endif
+
+#ifndef COGL_API
+# define COGL_API _COGL_EXPORTS
+#endif
+
 #define COGL_HAS_GLIB_SUPPORT 1
 #define COGL_HAS_GTYPE_SUPPORT 1
 #define COGL_HAS_WGL_SUPPORT 1
diff --git a/cogl/cogl-depth-state.h b/cogl/cogl-depth-state.h
index 581b9611..2a6e63ef 100644
--- a/cogl/cogl-depth-state.h
+++ b/cogl/cogl-depth-state.h
@@ -37,6 +37,8 @@
 #ifndef __COGL_DEPTH_STATE_H__
 #define __COGL_DEPTH_STATE_H__
 
+#include <cogl/cogl-defines.h>
+
 COGL_BEGIN_DECLS
 
 /**
@@ -84,7 +86,7 @@ typedef struct {
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_depth_state_init (CoglDepthState *state);
 
 /**
@@ -112,7 +114,7 @@ cogl_depth_state_init (CoglDepthState *state);
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_depth_state_set_test_enabled (CoglDepthState *state,
                                    CoglBool enable);
 
@@ -127,7 +129,7 @@ cogl_depth_state_set_test_enabled (CoglDepthState *state,
  * Since: 2.0
  * Stability: Unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_depth_state_get_test_enabled (CoglDepthState *state);
 
 /**
@@ -150,7 +152,7 @@ cogl_depth_state_get_test_enabled (CoglDepthState *state);
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_depth_state_set_write_enabled (CoglDepthState *state,
                                     CoglBool enable);
 
@@ -165,7 +167,7 @@ cogl_depth_state_set_write_enabled (CoglDepthState *state,
  * Since: 2.0
  * Stability: Unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_depth_state_get_write_enabled (CoglDepthState *state);
 
 /**
@@ -186,7 +188,7 @@ cogl_depth_state_get_write_enabled (CoglDepthState *state);
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_depth_state_set_test_function (CoglDepthState *state,
                                     CoglDepthTestFunction function);
 
@@ -201,7 +203,7 @@ cogl_depth_state_set_test_function (CoglDepthState *state,
  * Since: 2.0
  * Stability: Unstable
  */
-CoglDepthTestFunction
+COGL_API CoglDepthTestFunction
 cogl_depth_state_get_test_function (CoglDepthState *state);
 
 /**
@@ -242,7 +244,7 @@ cogl_depth_state_get_test_function (CoglDepthState *state);
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_depth_state_set_range (CoglDepthState *state,
                             float near_val,
                             float far_val);
@@ -260,7 +262,7 @@ cogl_depth_state_set_range (CoglDepthState *state,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_depth_state_get_range (CoglDepthState *state,
                             float *near_val,
                             float *far_val);
diff --git a/cogl/cogl-display.h b/cogl/cogl-display.h
index ae3f3c96..bf8b2113 100644
--- a/cogl/cogl-display.h
+++ b/cogl/cogl-display.h
@@ -82,6 +82,7 @@ typedef struct _CoglDisplay         CoglDisplay;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_display_get_gtype (void);
 #endif
 
@@ -125,7 +126,7 @@ GType cogl_display_get_gtype (void);
  * Since: 1.10
  * Stability: unstable
  */
-CoglDisplay *
+COGL_API CoglDisplay *
 cogl_display_new (CoglRenderer *renderer,
                   CoglOnscreenTemplate *onscreen_template);
 
@@ -140,7 +141,7 @@ cogl_display_new (CoglRenderer *renderer,
  * Since: 1.10
  * Stability: unstable
  */
-CoglRenderer *
+COGL_API CoglRenderer *
 cogl_display_get_renderer (CoglDisplay *display);
 
 /**
@@ -159,7 +160,7 @@ cogl_display_get_renderer (CoglDisplay *display);
  * Since: 1.16
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_display_set_onscreen_template (CoglDisplay *display,
                                     CoglOnscreenTemplate *onscreen_template);
 
@@ -194,7 +195,7 @@ cogl_display_set_onscreen_template (CoglDisplay *display,
  * Since: 1.10
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_display_setup (CoglDisplay *display,
                     CoglError **error);
 
@@ -209,7 +210,7 @@ cogl_display_setup (CoglDisplay *display,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_gdl_display_set_plane (CoglDisplay *display,
                             gdl_plane_id_t plane);
 #endif
@@ -225,7 +226,7 @@ cogl_gdl_display_set_plane (CoglDisplay *display,
  * Since: 1.10
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_display (void *object);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-egl.h b/cogl/cogl-egl.h
index cea7b103..d9975120 100644
--- a/cogl/cogl-egl.h
+++ b/cogl/cogl-egl.h
@@ -76,7 +76,7 @@ COGL_BEGIN_DECLS
  * Since: 1.8
  * Stability: unstable
  */
-EGLDisplay
+COGL_API EGLDisplay
 cogl_egl_context_get_egl_display (CoglContext *context);
 
 /**
@@ -95,7 +95,7 @@ cogl_egl_context_get_egl_display (CoglContext *context);
  * Since: 1.18
  * Stability: unstable
  */
-EGLContext
+COGL_API EGLContext
 cogl_egl_context_get_egl_context (CoglContext *context);
 
 
diff --git a/cogl/cogl-enum-types.h.in b/cogl/cogl-enum-types.h.in
index 14bfccc7..4ca79406 100644
--- a/cogl/cogl-enum-types.h.in
+++ b/cogl/cogl-enum-types.h.in
@@ -4,6 +4,8 @@
 
 #include <glib-object.h>
 
+#include <cogl/cogl-defines.h>
+
 G_BEGIN_DECLS
 
 /*** END file-header ***/
@@ -19,6 +21,7 @@ G_END_DECLS
 /*** END file-tail ***/
 
 /*** BEGIN value-header ***/
+COGL_API
 GType @enum_name@_get_type (void) G_GNUC_CONST;
 #define COGL_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
 
diff --git a/cogl/cogl-error.h b/cogl/cogl-error.h
index 8682d0e0..24428701 100644
--- a/cogl/cogl-error.h
+++ b/cogl/cogl-error.h
@@ -133,7 +133,7 @@ typedef struct _CoglError {
  *
  * Frees a #CoglError and associated resources.
  */
-void
+COGL_API void
 cogl_error_free (CoglError *error);
 
 /**
@@ -146,7 +146,7 @@ cogl_error_free (CoglError *error);
  * Return value: A newly allocated #CoglError initialized to match the
  *               contents of @error.
  */
-CoglError *
+COGL_API CoglError *
 cogl_error_copy (CoglError *error);
 
 /**
@@ -161,7 +161,7 @@ cogl_error_copy (CoglError *error);
  * Return value: whether the @error corresponds to the given @domain
  *               and @code.
  */
-CoglBool
+COGL_API CoglBool
 cogl_error_matches (CoglError *error,
                     uint32_t domain,
                     int code);
diff --git a/cogl/cogl-euler.h b/cogl/cogl-euler.h
index 4ccbb2a6..72e81e04 100644
--- a/cogl/cogl-euler.h
+++ b/cogl/cogl-euler.h
@@ -172,6 +172,7 @@ COGL_STRUCT_SIZE_ASSERT (CoglEuler, 32);
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_euler_get_gtype (void);
 #endif
 
@@ -188,7 +189,7 @@ GType cogl_euler_get_gtype (void);
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_euler_init (CoglEuler *euler,
                  float heading,
                  float pitch,
@@ -203,7 +204,7 @@ cogl_euler_init (CoglEuler *euler,
  * Extracts a euler rotation from the given @matrix and
  * initializses @euler with the component x, y and z rotation angles.
  */
-void
+COGL_API void
 cogl_euler_init_from_matrix (CoglEuler *euler,
                              const CoglMatrix *matrix);
 
@@ -215,7 +216,7 @@ cogl_euler_init_from_matrix (CoglEuler *euler,
  * Initializes a @euler rotation with the equivalent rotation
  * represented by the given @quaternion.
  */
-void
+COGL_API void
 cogl_euler_init_from_quaternion (CoglEuler *euler,
                                  const CoglQuaternion *quaternion);
 
@@ -234,7 +235,7 @@ cogl_euler_init_from_quaternion (CoglEuler *euler,
  * Returns: %TRUE if @v1 and @v2 are equal else %FALSE.
  * Since: 2.0
  */
-CoglBool
+COGL_API CoglBool
 cogl_euler_equal (const void *v1, const void *v2);
 
 /**
@@ -248,7 +249,7 @@ cogl_euler_equal (const void *v1, const void *v2);
  * Returns: A newly allocated #CoglEuler
  * Since: 2.0
  */
-CoglEuler *
+COGL_API CoglEuler *
 cogl_euler_copy (const CoglEuler *src);
 
 /**
@@ -260,7 +261,7 @@ cogl_euler_copy (const CoglEuler *src);
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_euler_free (CoglEuler *euler);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-fence.h b/cogl/cogl-fence.h
index e268f8f5..811b1af3 100644
--- a/cogl/cogl-fence.h
+++ b/cogl/cogl-fence.h
@@ -97,7 +97,7 @@ typedef struct _CoglFenceClosure CoglFenceClosure;
  * Since: 2.0
  * Stability: Unstable
  */
-void *
+COGL_API void *
 cogl_fence_closure_get_user_data (CoglFenceClosure *closure);
 
 /**
@@ -118,7 +118,7 @@ cogl_fence_closure_get_user_data (CoglFenceClosure *closure);
  * Since: 2.0
  * Stability: Unstable
  */
-CoglFenceClosure *
+COGL_API CoglFenceClosure *
 cogl_framebuffer_add_fence_callback (CoglFramebuffer *framebuffer,
                                      CoglFenceCallback callback,
                                      void *user_data);
@@ -136,7 +136,7 @@ cogl_framebuffer_add_fence_callback (CoglFramebuffer *framebuffer,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_framebuffer_cancel_fence_callback (CoglFramebuffer *framebuffer,
                                         CoglFenceClosure *closure);
 
diff --git a/cogl/cogl-frame-info.h b/cogl/cogl-frame-info.h
index 7304c530..4aad59fd 100644
--- a/cogl/cogl-frame-info.h
+++ b/cogl/cogl-frame-info.h
@@ -56,6 +56,7 @@ typedef struct _CoglFrameInfo CoglFrameInfo;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_frame_info_get_gtype (void);
 #endif
 
@@ -70,7 +71,7 @@ GType cogl_frame_info_get_gtype (void);
  * Since: 2.0
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_frame_info (void *object);
 
 /**
@@ -84,6 +85,7 @@ cogl_is_frame_info (void *object);
  * Since: 1.14
  * Stability: unstable
  */
+COGL_API
 int64_t cogl_frame_info_get_frame_counter (CoglFrameInfo *info);
 
 /**
@@ -108,6 +110,7 @@ int64_t cogl_frame_info_get_frame_counter (CoglFrameInfo *info);
  * Since: 1.14
  * Stability: unstable
  */
+COGL_API
 int64_t cogl_frame_info_get_presentation_time (CoglFrameInfo *info);
 
 /**
@@ -127,6 +130,7 @@ int64_t cogl_frame_info_get_presentation_time (CoglFrameInfo *info);
  * Since: 1.14
  * Stability: unstable
  */
+COGL_API
 float cogl_frame_info_get_refresh_rate (CoglFrameInfo *info);
 
 /**
@@ -140,7 +144,7 @@ float cogl_frame_info_get_refresh_rate (CoglFrameInfo *info);
  * Since: 1.14
  * Stability: unstable
  */
-CoglOutput *
+COGL_API CoglOutput *
 cogl_frame_info_get_output (CoglFrameInfo *info);
 
 G_END_DECLS
diff --git a/cogl/cogl-framebuffer.h b/cogl/cogl-framebuffer.h
index 58d65a82..861f4b6b 100644
--- a/cogl/cogl-framebuffer.h
+++ b/cogl/cogl-framebuffer.h
@@ -111,6 +111,7 @@ COGL_BEGIN_DECLS
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_framebuffer_get_gtype (void);
 #endif
 
@@ -134,7 +135,7 @@ GType cogl_framebuffer_get_gtype (void);
  * Since: 1.8
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
                            CoglError **error);
 
@@ -148,7 +149,7 @@ cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
  * Since: 1.8
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_framebuffer_get_width (CoglFramebuffer *framebuffer);
 
 /**
@@ -161,7 +162,7 @@ cogl_framebuffer_get_width (CoglFramebuffer *framebuffer);
  * Since: 1.8
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_framebuffer_get_height (CoglFramebuffer *framebuffer);
 
 /**
@@ -193,7 +194,7 @@ cogl_framebuffer_get_height (CoglFramebuffer *framebuffer);
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_set_viewport (CoglFramebuffer *framebuffer,
                                float x,
                                float y,
@@ -211,7 +212,7 @@ cogl_framebuffer_set_viewport (CoglFramebuffer *framebuffer,
  * Since: 1.8
  * Stability: unstable
  */
-float
+COGL_API float
 cogl_framebuffer_get_viewport_x (CoglFramebuffer *framebuffer);
 
 /**
@@ -225,7 +226,7 @@ cogl_framebuffer_get_viewport_x (CoglFramebuffer *framebuffer);
  * Since: 1.8
  * Stability: unstable
  */
-float
+COGL_API float
 cogl_framebuffer_get_viewport_y (CoglFramebuffer *framebuffer);
 
 /**
@@ -239,7 +240,7 @@ cogl_framebuffer_get_viewport_y (CoglFramebuffer *framebuffer);
  * Since: 1.8
  * Stability: unstable
  */
-float
+COGL_API float
 cogl_framebuffer_get_viewport_width (CoglFramebuffer *framebuffer);
 
 /**
@@ -253,7 +254,7 @@ cogl_framebuffer_get_viewport_width (CoglFramebuffer *framebuffer);
  * Since: 1.8
  * Stability: unstable
  */
-float
+COGL_API float
 cogl_framebuffer_get_viewport_height (CoglFramebuffer *framebuffer);
 
 /**
@@ -271,7 +272,7 @@ cogl_framebuffer_get_viewport_height (CoglFramebuffer *framebuffer);
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_get_viewport4fv (CoglFramebuffer *framebuffer,
                                   float *viewport);
 
@@ -284,7 +285,7 @@ cogl_framebuffer_get_viewport4fv (CoglFramebuffer *framebuffer,
  *
  * Since: 1.10
  */
-void
+COGL_API void
 cogl_framebuffer_push_matrix (CoglFramebuffer *framebuffer);
 
 /**
@@ -295,7 +296,7 @@ cogl_framebuffer_push_matrix (CoglFramebuffer *framebuffer);
  *
  * Since: 1.10
  */
-void
+COGL_API void
 cogl_framebuffer_pop_matrix (CoglFramebuffer *framebuffer);
 
 /**
@@ -307,7 +308,7 @@ cogl_framebuffer_pop_matrix (CoglFramebuffer *framebuffer);
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_identity_matrix (CoglFramebuffer *framebuffer);
 
 /**
@@ -323,7 +324,7 @@ cogl_framebuffer_identity_matrix (CoglFramebuffer *framebuffer);
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_scale (CoglFramebuffer *framebuffer,
                         float x,
                         float y,
@@ -342,7 +343,7 @@ cogl_framebuffer_scale (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_translate (CoglFramebuffer *framebuffer,
                             float x,
                             float y,
@@ -365,7 +366,7 @@ cogl_framebuffer_translate (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_rotate (CoglFramebuffer *framebuffer,
                          float angle,
                          float x,
@@ -385,7 +386,7 @@ cogl_framebuffer_rotate (CoglFramebuffer *framebuffer,
  * Since: 2.0
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_rotate_quaternion (CoglFramebuffer *framebuffer,
                                     const CoglQuaternion *quaternion);
 
@@ -400,7 +401,7 @@ cogl_framebuffer_rotate_quaternion (CoglFramebuffer *framebuffer,
  * Since: 2.0
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_rotate_euler (CoglFramebuffer *framebuffer,
                                const CoglEuler *euler);
 
@@ -416,7 +417,7 @@ cogl_framebuffer_rotate_euler (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_transform (CoglFramebuffer *framebuffer,
                             const CoglMatrix *matrix);
 
@@ -430,7 +431,7 @@ cogl_framebuffer_transform (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_get_modelview_matrix (CoglFramebuffer *framebuffer,
                                        CoglMatrix *matrix);
 
@@ -444,7 +445,7 @@ cogl_framebuffer_get_modelview_matrix (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_set_modelview_matrix (CoglFramebuffer *framebuffer,
                                        const CoglMatrix *matrix);
 
@@ -468,7 +469,7 @@ cogl_framebuffer_set_modelview_matrix (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_perspective (CoglFramebuffer *framebuffer,
                               float fov_y,
                               float aspect,
@@ -496,7 +497,7 @@ cogl_framebuffer_perspective (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_frustum (CoglFramebuffer *framebuffer,
                           float left,
                           float right,
@@ -525,7 +526,7 @@ cogl_framebuffer_frustum (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_orthographic (CoglFramebuffer *framebuffer,
                                float x_1,
                                float y_1,
@@ -544,7 +545,7 @@ cogl_framebuffer_orthographic (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_get_projection_matrix (CoglFramebuffer *framebuffer,
                                         CoglMatrix *matrix);
 
@@ -558,7 +559,7 @@ cogl_framebuffer_get_projection_matrix (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_set_projection_matrix (CoglFramebuffer *framebuffer,
                                         const CoglMatrix *matrix);
 
@@ -582,7 +583,7 @@ cogl_framebuffer_set_projection_matrix (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_push_scissor_clip (CoglFramebuffer *framebuffer,
                                     int x,
                                     int y,
@@ -609,7 +610,7 @@ cogl_framebuffer_push_scissor_clip (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_push_rectangle_clip (CoglFramebuffer *framebuffer,
                                       float x_1,
                                       float y_1,
@@ -645,7 +646,7 @@ cogl_framebuffer_push_rectangle_clip (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_push_primitive_clip (CoglFramebuffer *framebuffer,
                                       CoglPrimitive *primitive,
                                       float bounds_x1,
@@ -664,7 +665,7 @@ cogl_framebuffer_push_primitive_clip (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_pop_clip (CoglFramebuffer *framebuffer);
 
 /**
@@ -678,7 +679,7 @@ cogl_framebuffer_pop_clip (CoglFramebuffer *framebuffer);
  * Since: 1.8
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_framebuffer_get_red_bits (CoglFramebuffer *framebuffer);
 
 /**
@@ -692,7 +693,7 @@ cogl_framebuffer_get_red_bits (CoglFramebuffer *framebuffer);
  * Since: 1.8
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_framebuffer_get_green_bits (CoglFramebuffer *framebuffer);
 
 /**
@@ -706,7 +707,7 @@ cogl_framebuffer_get_green_bits (CoglFramebuffer *framebuffer);
  * Since: 1.8
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_framebuffer_get_blue_bits (CoglFramebuffer *framebuffer);
 
 /**
@@ -720,7 +721,7 @@ cogl_framebuffer_get_blue_bits (CoglFramebuffer *framebuffer);
  * Since: 1.8
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_framebuffer_get_alpha_bits (CoglFramebuffer *framebuffer);
 
 /**
@@ -734,7 +735,7 @@ cogl_framebuffer_get_alpha_bits (CoglFramebuffer *framebuffer);
  * Since: 2.0
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_framebuffer_get_depth_bits (CoglFramebuffer *framebuffer);
 
 /*
@@ -751,7 +752,7 @@ cogl_framebuffer_get_depth_bits (CoglFramebuffer *framebuffer);
  * Since: 1.20
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_framebuffer_get_is_stereo (CoglFramebuffer *framebuffer);
 
 /**
@@ -769,7 +770,7 @@ cogl_framebuffer_get_is_stereo (CoglFramebuffer *framebuffer);
  * Since: 1.8
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_framebuffer_get_dither_enabled (CoglFramebuffer *framebuffer);
 
 /**
@@ -794,7 +795,7 @@ cogl_framebuffer_get_dither_enabled (CoglFramebuffer *framebuffer);
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_set_dither_enabled (CoglFramebuffer *framebuffer,
                                      CoglBool dither_enabled);
 
@@ -809,7 +810,7 @@ cogl_framebuffer_set_dither_enabled (CoglFramebuffer *framebuffer,
  * Since: 1.18
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_framebuffer_get_depth_write_enabled (CoglFramebuffer *framebuffer);
 
 /**
@@ -827,7 +828,7 @@ cogl_framebuffer_get_depth_write_enabled (CoglFramebuffer *framebuffer);
  * Since: 1.18
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_set_depth_write_enabled (CoglFramebuffer *framebuffer,
                                           CoglBool depth_write_enabled);
 
@@ -843,7 +844,7 @@ cogl_framebuffer_set_depth_write_enabled (CoglFramebuffer *framebuffer,
  * Since: 1.8
  * Stability: unstable
  */
-CoglColorMask
+COGL_API CoglColorMask
 cogl_framebuffer_get_color_mask (CoglFramebuffer *framebuffer);
 
 /**
@@ -859,7 +860,7 @@ cogl_framebuffer_get_color_mask (CoglFramebuffer *framebuffer);
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_set_color_mask (CoglFramebuffer *framebuffer,
                                  CoglColorMask color_mask);
 
@@ -874,7 +875,7 @@ cogl_framebuffer_set_color_mask (CoglFramebuffer *framebuffer,
  * Since: 1.20
  * Stability: unstable
  */
-CoglStereoMode
+COGL_API CoglStereoMode
 cogl_framebuffer_get_stereo_mode (CoglFramebuffer *framebuffer);
 
 /**
@@ -894,7 +895,7 @@ cogl_framebuffer_get_stereo_mode (CoglFramebuffer *framebuffer);
  * Since: 1.20
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_set_stereo_mode (CoglFramebuffer *framebuffer,
                                  CoglStereoMode stereo_mode);
 
@@ -917,7 +918,7 @@ cogl_framebuffer_set_stereo_mode (CoglFramebuffer *framebuffer,
  * Since: 1.14
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_set_depth_texture_enabled (CoglFramebuffer *framebuffer,
                                             CoglBool enabled);
 
@@ -934,7 +935,7 @@ cogl_framebuffer_set_depth_texture_enabled (CoglFramebuffer *framebuffer,
  * Since: 1.14
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_framebuffer_get_depth_texture_enabled (CoglFramebuffer *framebuffer);
 
 /**
@@ -954,7 +955,7 @@ cogl_framebuffer_get_depth_texture_enabled (CoglFramebuffer *framebuffer);
  * Since: 1.14
  * Stability: unstable
  */
-CoglTexture *
+COGL_API CoglTexture *
 cogl_framebuffer_get_depth_texture (CoglFramebuffer *framebuffer);
 
 /**
@@ -998,7 +999,7 @@ cogl_framebuffer_get_depth_texture (CoglFramebuffer *framebuffer);
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_set_samples_per_pixel (CoglFramebuffer *framebuffer,
                                         int samples_per_pixel);
 
@@ -1026,7 +1027,7 @@ cogl_framebuffer_set_samples_per_pixel (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_framebuffer_get_samples_per_pixel (CoglFramebuffer *framebuffer);
 
 
@@ -1058,7 +1059,7 @@ cogl_framebuffer_get_samples_per_pixel (CoglFramebuffer *framebuffer);
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_resolve_samples (CoglFramebuffer *framebuffer);
 
 /**
@@ -1094,7 +1095,7 @@ cogl_framebuffer_resolve_samples (CoglFramebuffer *framebuffer);
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_resolve_samples_region (CoglFramebuffer *framebuffer,
                                          int x,
                                          int y,
@@ -1114,7 +1115,7 @@ cogl_framebuffer_resolve_samples_region (CoglFramebuffer *framebuffer,
  * Since: 1.8
  * Stability: unstable
  */
-CoglContext *
+COGL_API CoglContext *
 cogl_framebuffer_get_context (CoglFramebuffer *framebuffer);
 
 /**
@@ -1131,7 +1132,7 @@ cogl_framebuffer_get_context (CoglFramebuffer *framebuffer);
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_clear (CoglFramebuffer *framebuffer,
                         unsigned long buffers,
                         const CoglColor *color);
@@ -1156,7 +1157,7 @@ cogl_framebuffer_clear (CoglFramebuffer *framebuffer,
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_clear4f (CoglFramebuffer *framebuffer,
                           unsigned long buffers,
                           float red,
@@ -1442,7 +1443,7 @@ cogl_framebuffer_draw_indexed_attributes (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_draw_rectangle (CoglFramebuffer *framebuffer,
                                  CoglPipeline *pipeline,
                                  float x_1,
@@ -1498,7 +1499,7 @@ cogl_framebuffer_draw_rectangle (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_draw_textured_rectangle (CoglFramebuffer *framebuffer,
                                           CoglPipeline *pipeline,
                                           float x_1,
@@ -1576,7 +1577,7 @@ cogl_framebuffer_draw_textured_rectangle (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_draw_multitextured_rectangle (CoglFramebuffer *framebuffer,
                                                CoglPipeline *pipeline,
                                                float x_1,
@@ -1620,7 +1621,7 @@ cogl_framebuffer_draw_multitextured_rectangle (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_draw_rectangles (CoglFramebuffer *framebuffer,
                                   CoglPipeline *pipeline,
                                   const float *coordinates,
@@ -1679,7 +1680,7 @@ cogl_framebuffer_draw_rectangles (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_draw_textured_rectangles (CoglFramebuffer *framebuffer,
                                            CoglPipeline *pipeline,
                                            const float *coordinates,
@@ -1714,7 +1715,7 @@ cogl_framebuffer_draw_textured_rectangles (CoglFramebuffer *framebuffer,
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_framebuffer_discard_buffers (CoglFramebuffer *framebuffer,
                                   unsigned long buffers);
 
@@ -1735,7 +1736,7 @@ cogl_framebuffer_discard_buffers (CoglFramebuffer *framebuffer,
  * Stability: unstable
  * Since: 1.10
  */
-void
+COGL_API void
 cogl_framebuffer_finish (CoglFramebuffer *framebuffer);
 
 /**
@@ -1764,7 +1765,7 @@ cogl_framebuffer_finish (CoglFramebuffer *framebuffer);
  * Since: 1.10
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
                                           int x,
                                           int y,
@@ -1810,7 +1811,7 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_framebuffer_read_pixels (CoglFramebuffer *framebuffer,
                               int x,
                               int y,
@@ -1829,7 +1830,7 @@ cogl_framebuffer_read_pixels (CoglFramebuffer *framebuffer,
  * Stability: unstable
  * Since: 1.8
  */
-CoglFramebuffer *
+COGL_API CoglFramebuffer *
 cogl_get_draw_framebuffer (void);
 
 #endif /* COGL_ENABLE_EXPERIMENTAL_API */
@@ -1837,7 +1838,7 @@ cogl_get_draw_framebuffer (void);
 /* XXX: Note these are defined outside the COGL_ENABLE_EXPERIMENTAL_API guard since
  * otherwise the glib-mkenums stuff will get upset. */
 
-uint32_t
+COGL_API uint32_t
 cogl_framebuffer_error_quark (void);
 
 /**
@@ -1862,7 +1863,7 @@ typedef enum { /*< prefix=COGL_FRAMEBUFFER_ERROR >*/
  * Since: 1.10
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_framebuffer (void *object);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-gles2.h b/cogl/cogl-gles2.h
index 84c9ba15..95034d48 100644
--- a/cogl/cogl-gles2.h
+++ b/cogl/cogl-gles2.h
@@ -157,10 +157,11 @@ struct _CoglGLES2Vtable
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_gles2_context_get_gtype (void);
 #endif
 
-uint32_t
+COGL_API uint32_t
 _cogl_gles2_context_error_quark (void);
 
 /**
@@ -218,7 +219,7 @@ typedef enum { /*< prefix=COGL_GLES2_CONTEXT_ERROR >*/
  *               was an error and @error will be updated in that case.
  * Stability: unstable
  */
-CoglGLES2Context *
+COGL_API CoglGLES2Context *
 cogl_gles2_context_new (CoglContext *ctx, CoglError **error);
 
 /**
@@ -237,7 +238,7 @@ cogl_gles2_context_new (CoglContext *ctx, CoglError **error);
  *               to functions for the full OpenGLES 2.0 api.
  * Stability: unstable
  */
-const CoglGLES2Vtable *
+COGL_API const CoglGLES2Vtable *
 cogl_gles2_context_get_vtable (CoglGLES2Context *gles2_ctx);
 
 /**
@@ -270,7 +271,7 @@ cogl_gles2_context_get_vtable (CoglGLES2Context *gles2_ctx);
  *               otherwise and @error will be updated.
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_push_gles2_context (CoglContext *ctx,
                          CoglGLES2Context *gles2_ctx,
                          CoglFramebuffer *read_buffer,
@@ -293,7 +294,7 @@ cogl_push_gles2_context (CoglContext *ctx,
  * Since: 2.0
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_pop_gles2_context (CoglContext *ctx);
 
 /**
@@ -308,7 +309,7 @@ cogl_pop_gles2_context (CoglContext *ctx);
  * Since: 2.0
  * Stability: unstable
  */
-CoglGLES2Vtable *
+COGL_API CoglGLES2Vtable *
 cogl_gles2_get_current_vtable (void);
 
 /**
@@ -338,7 +339,7 @@ cogl_gles2_get_current_vtable (void);
  * Since: 2.0
  * Stability: unstable
  */
-CoglTexture2D *
+COGL_API CoglTexture2D *
 cogl_gles2_texture_2d_new_from_handle (CoglContext *ctx,
                                        CoglGLES2Context *gles2_ctx,
                                        unsigned int handle,
@@ -382,7 +383,7 @@ cogl_gles2_texture_2d_new_from_handle (CoglContext *ctx,
  * Since: 2.0
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_gles2_texture_get_handle (CoglTexture *texture,
                                unsigned int *handle,
                                unsigned int *target);
@@ -398,7 +399,7 @@ cogl_gles2_texture_get_handle (CoglTexture *texture,
  * Since: 2.0
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_gles2_context (void *object);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-glib-source.h b/cogl/cogl-glib-source.h
index ddb7f995..556ce467 100644
--- a/cogl/cogl-glib-source.h
+++ b/cogl/cogl-glib-source.h
@@ -67,7 +67,7 @@ G_BEGIN_DECLS
  * Stability: unstable
  * Since: 1.10
  */
-GSource *
+COGL_API GSource *
 cogl_glib_source_new (CoglContext *context,
                       int priority);
 
@@ -88,7 +88,7 @@ cogl_glib_source_new (CoglContext *context,
  * Stability: unstable
  * Since: 1.16
  */
-GSource *
+COGL_API GSource *
 cogl_glib_renderer_source_new (CoglRenderer *renderer,
                                int priority);
 
diff --git a/cogl/cogl-glx.h b/cogl/cogl-glx.h
index 15918bba..5f3e3d5b 100644
--- a/cogl/cogl-glx.h
+++ b/cogl/cogl-glx.h
@@ -73,7 +73,7 @@ COGL_BEGIN_DECLS
  * Since: 1.18
  * Stability: unstable
  */
-GLXContext
+COGL_API GLXContext
 cogl_glx_context_get_glx_context (CoglContext *context);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-index-buffer.h b/cogl/cogl-index-buffer.h
index 204c8585..d28d3faa 100644
--- a/cogl/cogl-index-buffer.h
+++ b/cogl/cogl-index-buffer.h
@@ -64,6 +64,7 @@ typedef struct _CoglIndexBuffer             CoglIndexBuffer;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_index_buffer_get_gtype (void);
 #endif
 
@@ -82,7 +83,7 @@ GType cogl_index_buffer_get_gtype (void);
  * Since: 1.4
  * Stability: Unstable
  */
-CoglIndexBuffer *
+COGL_API CoglIndexBuffer *
 cogl_index_buffer_new (CoglContext *context,
                        size_t bytes);
 
@@ -98,7 +99,7 @@ cogl_index_buffer_new (CoglContext *context,
  * Since: 1.4
  * Stability: Unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_index_buffer (void *object);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-indices.h b/cogl/cogl-indices.h
index 3cc92391..61d223a5 100644
--- a/cogl/cogl-indices.h
+++ b/cogl/cogl-indices.h
@@ -115,34 +115,35 @@ COGL_BEGIN_DECLS
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_indices_get_gtype (void);
 #endif
 
-CoglIndices *
+COGL_API CoglIndices *
 cogl_indices_new (CoglContext *context,
                   CoglIndicesType type,
                   const void *indices_data,
                   int n_indices);
 
-CoglIndices *
+COGL_API CoglIndices *
 cogl_indices_new_for_buffer (CoglIndicesType type,
                              CoglIndexBuffer *buffer,
                              size_t offset);
 
-CoglIndexBuffer *
+COGL_API CoglIndexBuffer *
 cogl_indices_get_buffer (CoglIndices *indices);
 
-CoglIndicesType
+COGL_API CoglIndicesType
 cogl_indices_get_type (CoglIndices *indices);
 
-size_t
+COGL_API size_t
 cogl_indices_get_offset (CoglIndices *indices);
 
-void
+COGL_API void
 cogl_indices_set_offset (CoglIndices *indices,
                          size_t offset);
 
-CoglIndices *
+COGL_API CoglIndices *
 cogl_get_rectangle_indices (CoglContext *context, int n_rectangles);
 
 /**
@@ -156,7 +157,7 @@ cogl_get_rectangle_indices (CoglContext *context, int n_rectangles);
  * Since: 1.10
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_indices (void *object);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-kms-display.h b/cogl/cogl-kms-display.h
index ebf6471a..ff13d1c2 100644
--- a/cogl/cogl-kms-display.h
+++ b/cogl/cogl-kms-display.h
@@ -91,7 +91,7 @@ typedef struct {
  *
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_kms_display_set_layout (CoglDisplay *display,
                              int width,
                              int height,
@@ -111,7 +111,7 @@ cogl_kms_display_set_layout (CoglDisplay *display,
  *
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_kms_display_set_ignore_crtc (CoglDisplay *display,
                                   uint32_t id,
                                   CoglBool ignore);
diff --git a/cogl/cogl-kms-renderer.h b/cogl/cogl-kms-renderer.h
index 4e4948e5..e48d6fdc 100644
--- a/cogl/cogl-kms-renderer.h
+++ b/cogl/cogl-kms-renderer.h
@@ -50,7 +50,7 @@ COGL_BEGIN_DECLS
  * Since: 1.18
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_kms_renderer_set_kms_fd (CoglRenderer *renderer,
                               int fd);
 
@@ -65,10 +65,10 @@ cogl_kms_renderer_set_kms_fd (CoglRenderer *renderer,
  *               desriptor has been opened by Cogl.
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_kms_renderer_get_kms_fd (CoglRenderer *renderer);
 
-struct gbm_device *
+COGL_API struct gbm_device *
 cogl_kms_renderer_get_gbm (CoglRenderer *renderer);
 COGL_END_DECLS
 #endif /* __COGL_KMS_RENDERER_H__ */
diff --git a/cogl/cogl-macros.h b/cogl/cogl-macros.h
index 96c06591..0f58e7de 100644
--- a/cogl/cogl-macros.h
+++ b/cogl/cogl-macros.h
@@ -41,36 +41,37 @@
  * They are only intended for internal use and should not be used by
  * other projects.
  */
+
 #if defined(COGL_DISABLE_DEPRECATION_WARNINGS) || defined(COGL_COMPILATION)
 
-#define COGL_DEPRECATED
-#define COGL_DEPRECATED_FOR(f)
-#define COGL_UNAVAILABLE(maj,min)
+#define COGL_DEPRECATED COGL_API
+#define COGL_DEPRECATED_FOR(f) COGL_API
+#define COGL_UNAVAILABLE(maj,min) COGL_API
 
 #else /* COGL_DISABLE_DEPRECATION_WARNINGS */
 
 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
-#define COGL_DEPRECATED __attribute__((__deprecated__))
+#define COGL_DEPRECATED __attribute__((__deprecated__)) COGL_API
 #elif defined(_MSC_VER) && (_MSC_VER >= 1300)
-#define COGL_DEPRECATED __declspec(deprecated)
+#define COGL_DEPRECATED __declspec(deprecated) COGL_API
 #else
-#define COGL_DEPRECATED
+#define COGL_DEPRECATED COGL_API
 #endif
 
 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
-#define COGL_DEPRECATED_FOR(f) __attribute__((__deprecated__("Use '" #f "' instead")))
+#define COGL_DEPRECATED_FOR(f) __attribute__((__deprecated__("Use '" #f "' instead"))) COGL_API
 #elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320)
-#define COGL_DEPRECATED_FOR(f) __declspec(deprecated("is deprecated. Use '" #f "' instead"))
+#define COGL_DEPRECATED_FOR(f) __declspec(deprecated("is deprecated. Use '" #f "' instead")) COGL_API
 #else
-#define COGL_DEPRECATED_FOR(f) G_DEPRECATED
+#define COGL_DEPRECATED_FOR(f) G_DEPRECATED COGL_API
 #endif
 
 #if    __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
-#define COGL_UNAVAILABLE(maj,min) __attribute__((deprecated("Not available before " #maj "." #min)))
+#define COGL_UNAVAILABLE(maj,min) __attribute__((deprecated("Not available before " #maj "." #min))) COGL_API
 #elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320)
-#define COGL_UNAVAILABLE(maj,min) __declspec(deprecated("is not available before " #maj "." #min))
+#define COGL_UNAVAILABLE(maj,min) __declspec(deprecated("is not available before " #maj "." #min)) COGL_API
 #else
-#define COGL_UNAVAILABLE(maj,min)
+#define COGL_UNAVAILABLE(maj,min) COGL_API
 #endif
 
 #endif /* COGL_DISABLE_DEPRECATION_WARNINGS */
@@ -134,154 +135,154 @@
 # define COGL_DEPRECATED_IN_1_0              COGL_DEPRECATED
 # define COGL_DEPRECATED_IN_1_0_FOR(f)       COGL_DEPRECATED_FOR(f)
 #else
-# define COGL_DEPRECATED_IN_1_0
-# define COGL_DEPRECATED_IN_1_0_FOR(f)
+# define COGL_DEPRECATED_IN_1_0              COGL_API
+# define COGL_DEPRECATED_IN_1_0_FOR(f)       COGL_API
 #endif
 
 #if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_0
 # define COGL_AVAILABLE_IN_1_0               COGL_UNAVAILABLE(1, 0)
 #else
-# define COGL_AVAILABLE_IN_1_0
+# define COGL_AVAILABLE_IN_1_0               COGL_API
 #endif
 
 #if COGL_VERSION_MIN_REQUIRED >= COGL_VERSION_1_2
 # define COGL_DEPRECATED_IN_1_2              COGL_DEPRECATED
 # define COGL_DEPRECATED_IN_1_2_FOR(f)       COGL_DEPRECATED_FOR(f)
 #else
-# define COGL_DEPRECATED_IN_1_2
-# define COGL_DEPRECATED_IN_1_2_FOR(f)
+# define COGL_DEPRECATED_IN_1_2              COGL_API
+# define COGL_DEPRECATED_IN_1_2_FOR(f)       COGL_API
 #endif
 
 #if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_2
 # define COGL_AVAILABLE_IN_1_2               COGL_UNAVAILABLE(1, 2)
 #else
-# define COGL_AVAILABLE_IN_1_2
+# define COGL_AVAILABLE_IN_1_2               COGL_API
 #endif
 
 #if COGL_VERSION_MIN_REQUIRED >= COGL_VERSION_1_4
 # define COGL_DEPRECATED_IN_1_4              COGL_DEPRECATED
 # define COGL_DEPRECATED_IN_1_4_FOR(f)       COGL_DEPRECATED_FOR(f)
 #else
-# define COGL_DEPRECATED_IN_1_4
-# define COGL_DEPRECATED_IN_1_4_FOR(f)
+# define COGL_DEPRECATED_IN_1_4              COGL_API
+# define COGL_DEPRECATED_IN_1_4_FOR(f)       COGL_API
 #endif
 
 #if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_4
 # define COGL_AVAILABLE_IN_1_4               COGL_UNAVAILABLE(1, 4)
 #else
-# define COGL_AVAILABLE_IN_1_4
+# define COGL_AVAILABLE_IN_1_4               COGL_API
 #endif
 
 #if COGL_VERSION_MIN_REQUIRED >= COGL_VERSION_1_6
 # define COGL_DEPRECATED_IN_1_6              COGL_DEPRECATED
 # define COGL_DEPRECATED_IN_1_6_FOR(f)       COGL_DEPRECATED_FOR(f)
 #else
-# define COGL_DEPRECATED_IN_1_6
-# define COGL_DEPRECATED_IN_1_6_FOR(f)
+# define COGL_DEPRECATED_IN_1_6              COGL_API
+# define COGL_DEPRECATED_IN_1_6_FOR(f)       COGL_API
 #endif
 
 #if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_6
 # define COGL_AVAILABLE_IN_1_6               COGL_UNAVAILABLE(1, 6)
 #else
-# define COGL_AVAILABLE_IN_1_6
+# define COGL_AVAILABLE_IN_1_6               COGL_API
 #endif
 
 #if COGL_VERSION_MIN_REQUIRED >= COGL_VERSION_1_8
 # define COGL_DEPRECATED_IN_1_8              COGL_DEPRECATED
 # define COGL_DEPRECATED_IN_1_8_FOR(f)       COGL_DEPRECATED_FOR(f)
 #else
-# define COGL_DEPRECATED_IN_1_8
-# define COGL_DEPRECATED_IN_1_8_FOR(f)
+# define COGL_DEPRECATED_IN_1_8              COGL_API
+# define COGL_DEPRECATED_IN_1_8_FOR(f)       COGL_API
 #endif
 
 #if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_8
 # define COGL_AVAILABLE_IN_1_8               COGL_UNAVAILABLE(1, 8)
 #else
-# define COGL_AVAILABLE_IN_1_8
+# define COGL_AVAILABLE_IN_1_8               COGL_API
 #endif
 
 #if COGL_VERSION_MIN_REQUIRED >= COGL_VERSION_1_10
 # define COGL_DEPRECATED_IN_1_10             COGL_DEPRECATED
 # define COGL_DEPRECATED_IN_1_10_FOR(f)      COGL_DEPRECATED_FOR(f)
 #else
-# define COGL_DEPRECATED_IN_1_10
-# define COGL_DEPRECATED_IN_1_10_FOR(f)
+# define COGL_DEPRECATED_IN_1_10             COGL_API
+# define COGL_DEPRECATED_IN_1_10_FOR(f)      COGL_API
 #endif
 
 #if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_10
 # define COGL_AVAILABLE_IN_1_10              COGL_UNAVAILABLE(1, 10)
 #else
-# define COGL_AVAILABLE_IN_1_10
+# define COGL_AVAILABLE_IN_1_10              COGL_API
 #endif
 
 #if COGL_VERSION_MIN_REQUIRED >= COGL_VERSION_1_12
 # define COGL_DEPRECATED_IN_1_12             COGL_DEPRECATED
 # define COGL_DEPRECATED_IN_1_12_FOR(f)      COGL_DEPRECATED_FOR(f)
 #else
-# define COGL_DEPRECATED_IN_1_12
-# define COGL_DEPRECATED_IN_1_12_FOR(f)
+# define COGL_DEPRECATED_IN_1_12             COGL_API
+# define COGL_DEPRECATED_IN_1_12_FOR(f)      COGL_API
 #endif
 
 #if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_12
 # define COGL_AVAILABLE_IN_1_12              COGL_UNAVAILABLE(1, 12)
 #else
-# define COGL_AVAILABLE_IN_1_12
+# define COGL_AVAILABLE_IN_1_12              COGL_API
 #endif
 
 #if COGL_VERSION_MIN_REQUIRED >= COGL_VERSION_1_14
 # define COGL_DEPRECATED_IN_1_14             COGL_DEPRECATED
 # define COGL_DEPRECATED_IN_1_14_FOR(f)      COGL_DEPRECATED_FOR(f)
 #else
-# define COGL_DEPRECATED_IN_1_14
-# define COGL_DEPRECATED_IN_1_14_FOR(f)
+# define COGL_DEPRECATED_IN_1_14             COGL_API
+# define COGL_DEPRECATED_IN_1_14_FOR(f)      COGL_API
 #endif
 
 #if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_14
 # define COGL_AVAILABLE_IN_1_14              COGL_UNAVAILABLE(1, 14)
 #else
-# define COGL_AVAILABLE_IN_1_14
+# define COGL_AVAILABLE_IN_1_14              COGL_API
 #endif
 
 #if COGL_VERSION_MIN_REQUIRED >= COGL_VERSION_1_16
 # define COGL_DEPRECATED_IN_1_16             COGL_DEPRECATED
 # define COGL_DEPRECATED_IN_1_16_FOR(f)      COGL_DEPRECATED_FOR(f)
 #else
-# define COGL_DEPRECATED_IN_1_16
-# define COGL_DEPRECATED_IN_1_16_FOR(f)
+# define COGL_DEPRECATED_IN_1_16             COGL_API
+# define COGL_DEPRECATED_IN_1_16_FOR(f)      COGL_API
 #endif
 
 #if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_16
 # define COGL_AVAILABLE_IN_1_16              COGL_UNAVAILABLE(1, 16)
 #else
-# define COGL_AVAILABLE_IN_1_16
+# define COGL_AVAILABLE_IN_1_16              COGL_API
 #endif
 
 #if COGL_VERSION_MIN_REQUIRED >= COGL_VERSION_1_18
 # define COGL_DEPRECATED_IN_1_18             COGL_DEPRECATED
 # define COGL_DEPRECATED_IN_1_18_FOR(f)      COGL_DEPRECATED_FOR(f)
 #else
-# define COGL_DEPRECATED_IN_1_18
-# define COGL_DEPRECATED_IN_1_18_FOR(f)
+# define COGL_DEPRECATED_IN_1_18             COGL_API
+# define COGL_DEPRECATED_IN_1_18_FOR(f)      COGL_API
 #endif
 
 #if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_18
 # define COGL_AVAILABLE_IN_1_18              COGL_UNAVAILABLE(1, 18)
 #else
-# define COGL_AVAILABLE_IN_1_18
+# define COGL_AVAILABLE_IN_1_18              COGL_API
 #endif
 
 #if COGL_VERSION_MIN_REQUIRED >= COGL_VERSION_1_20
 # define COGL_DEPRECATED_IN_1_20             COGL_DEPRECATED
 # define COGL_DEPRECATED_IN_1_20_FOR(f)      COGL_DEPRECATED_FOR(f)
 #else
-# define COGL_DEPRECATED_IN_1_20
-# define COGL_DEPRECATED_IN_1_20_FOR(f)
+# define COGL_DEPRECATED_IN_1_20             COGL_API
+# define COGL_DEPRECATED_IN_1_20_FOR(f)      COGL_API
 #endif
 
 #if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_20
 # define COGL_AVAILABLE_IN_1_20              COGL_UNAVAILABLE(1, 18)
 #else
-# define COGL_AVAILABLE_IN_1_20
+# define COGL_AVAILABLE_IN_1_20              COGL_API
 #endif
 
 #endif /* __COGL_MACROS_H__ */
diff --git a/cogl/cogl-matrix-stack.h b/cogl/cogl-matrix-stack.h
index 6ea323a3..34fa4b5a 100644
--- a/cogl/cogl-matrix-stack.h
+++ b/cogl/cogl-matrix-stack.h
@@ -140,6 +140,7 @@ typedef struct _CoglMatrixStack CoglMatrixStack;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_matrix_stack_get_gtype (void);
 #endif
 
@@ -185,6 +186,7 @@ typedef struct _CoglMatrixEntry CoglMatrixEntry;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_matrix_entry_get_gtype (void);
 #endif
 
@@ -217,7 +219,7 @@ GType cogl_matrix_entry_get_gtype (void);
  *
  * Return value: (transfer full): A newly allocated #CoglMatrixStack
  */
-CoglMatrixStack *
+COGL_API CoglMatrixStack *
 cogl_matrix_stack_new (CoglContext *ctx);
 
 /**
@@ -232,7 +234,7 @@ cogl_matrix_stack_new (CoglContext *ctx);
  * called when going back up one layer to restore the previous
  * transform of an ancestor.
  */
-void
+COGL_API void
 cogl_matrix_stack_push (CoglMatrixStack *stack);
 
 /**
@@ -245,7 +247,7 @@ cogl_matrix_stack_push (CoglMatrixStack *stack);
  * This is usually called while traversing a scenegraph whenever you
  * return up one level in the graph towards the root node.
  */
-void
+COGL_API void
 cogl_matrix_stack_pop (CoglMatrixStack *stack);
 
 /**
@@ -254,7 +256,7 @@ cogl_matrix_stack_pop (CoglMatrixStack *stack);
  *
  * Resets the current matrix to the identity matrix.
  */
-void
+COGL_API void
 cogl_matrix_stack_load_identity (CoglMatrixStack *stack);
 
 /**
@@ -267,7 +269,7 @@ cogl_matrix_stack_load_identity (CoglMatrixStack *stack);
  * Multiplies the current matrix by one that scales the x, y and z
  * axes by the given values.
  */
-void
+COGL_API void
 cogl_matrix_stack_scale (CoglMatrixStack *stack,
                          float x,
                          float y,
@@ -283,7 +285,7 @@ cogl_matrix_stack_scale (CoglMatrixStack *stack,
  * Multiplies the current matrix by one that translates along all
  * three axes according to the given values.
  */
-void
+COGL_API void
 cogl_matrix_stack_translate (CoglMatrixStack *stack,
                              float x,
                              float y,
@@ -303,7 +305,7 @@ cogl_matrix_stack_translate (CoglMatrixStack *stack,
  * the axis-vector (0, 0, 1) causes a small counter-clockwise
  * rotation.
  */
-void
+COGL_API void
 cogl_matrix_stack_rotate (CoglMatrixStack *stack,
                           float angle,
                           float x,
@@ -318,7 +320,7 @@ cogl_matrix_stack_rotate (CoglMatrixStack *stack,
  * Multiplies the current matrix by one that rotates according to the
  * rotation described by @quaternion.
  */
-void
+COGL_API void
 cogl_matrix_stack_rotate_quaternion (CoglMatrixStack *stack,
                                      const CoglQuaternion *quaternion);
 
@@ -330,7 +332,7 @@ cogl_matrix_stack_rotate_quaternion (CoglMatrixStack *stack,
  * Multiplies the current matrix by one that rotates according to the
  * rotation described by @euler.
  */
-void
+COGL_API void
 cogl_matrix_stack_rotate_euler (CoglMatrixStack *stack,
                                 const CoglEuler *euler);
 
@@ -341,7 +343,7 @@ cogl_matrix_stack_rotate_euler (CoglMatrixStack *stack,
  *
  * Multiplies the current matrix by the given matrix.
  */
-void
+COGL_API void
 cogl_matrix_stack_multiply (CoglMatrixStack *stack,
                             const CoglMatrix *matrix);
 
@@ -363,7 +365,7 @@ cogl_matrix_stack_multiply (CoglMatrixStack *stack,
  * viewing frustum defined by 4 side clip planes that all cross
  * through the origin and 2 near and far clip planes.
  */
-void
+COGL_API void
 cogl_matrix_stack_frustum (CoglMatrixStack *stack,
                            float left,
                            float right,
@@ -389,7 +391,7 @@ cogl_matrix_stack_frustum (CoglMatrixStack *stack,
  * since there wont be enough precision to identify the depth of
  * objects near to each other.</note>
  */
-void
+COGL_API void
 cogl_matrix_stack_perspective (CoglMatrixStack *stack,
                                float fov_y,
                                float aspect,
@@ -412,7 +414,7 @@ cogl_matrix_stack_perspective (CoglMatrixStack *stack,
  *
  * Replaces the current matrix with an orthographic projection matrix.
  */
-void
+COGL_API void
 cogl_matrix_stack_orthographic (CoglMatrixStack *stack,
                                 float x_1,
                                 float y_1,
@@ -433,7 +435,7 @@ cogl_matrix_stack_orthographic (CoglMatrixStack *stack,
  *   for degenerate transformations that can't be inverted (in this case the
  *   @inverse matrix will simply be initialized with the identity matrix)
  */
-CoglBool
+COGL_API CoglBool
 cogl_matrix_stack_get_inverse (CoglMatrixStack *stack,
                                CoglMatrix *inverse);
 
@@ -455,7 +457,7 @@ cogl_matrix_stack_get_inverse (CoglMatrixStack *stack,
  * Return value: (transfer none): A pointer to the #CoglMatrixEntry
  *               representing the current matrix stack transform.
  */
-CoglMatrixEntry *
+COGL_API CoglMatrixEntry *
 cogl_matrix_stack_get_entry (CoglMatrixStack *stack);
 
 /**
@@ -484,7 +486,7 @@ cogl_matrix_stack_get_entry (CoglMatrixStack *stack);
  *               and in that case @matrix will be initialized with
  *               the value of the current transform.
  */
-CoglMatrix *
+COGL_API CoglMatrix *
 cogl_matrix_stack_get (CoglMatrixStack *stack,
                        CoglMatrix *matrix);
 
@@ -515,7 +517,7 @@ cogl_matrix_stack_get (CoglMatrixStack *stack,
  *               and in that case @matrix will be initialized with
  *               the effective transform represented by @entry.
  */
-CoglMatrix *
+COGL_API CoglMatrix *
 cogl_matrix_entry_get (CoglMatrixEntry *entry,
                        CoglMatrix *matrix);
 
@@ -529,7 +531,7 @@ cogl_matrix_entry_get (CoglMatrixEntry *entry,
  * since the last time cogl_matrix_stack_push() was called or since
  * the stack was initialized.
  */
-void
+COGL_API void
 cogl_matrix_stack_set (CoglMatrixStack *stack,
                        const CoglMatrix *matrix);
 
@@ -542,7 +544,7 @@ cogl_matrix_stack_set (CoglMatrixStack *stack,
  * Return value: %TRUE if @object is a #CoglMatrixStack, otherwise
  *               %FALSE.
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_matrix_stack (void *object);
 
 /**
@@ -564,7 +566,7 @@ cogl_is_matrix_stack (void *object);
  *                @entry0 and the transform of @entry1 is a translation,
  *                otherwise %FALSE.
  */
-CoglBool
+COGL_API CoglBool
 cogl_matrix_entry_calculate_translation (CoglMatrixEntry *entry0,
                                          CoglMatrixEntry *entry1,
                                          float *x,
@@ -585,7 +587,7 @@ cogl_matrix_entry_calculate_translation (CoglMatrixEntry *entry0,
  * Return value: %TRUE if @entry is definitely an identity transform,
  *               otherwise %FALSE.
  */
-CoglBool
+COGL_API CoglBool
 cogl_matrix_entry_is_identity (CoglMatrixEntry *entry);
 
 /**
@@ -603,7 +605,7 @@ cogl_matrix_entry_is_identity (CoglMatrixEntry *entry);
  * Return value: %TRUE if @entry0 represents the same transform as
  *               @entry1, otherwise %FALSE.
  */
-CoglBool
+COGL_API CoglBool
 cogl_matrix_entry_equal (CoglMatrixEntry *entry0,
                          CoglMatrixEntry *entry1);
 
@@ -614,7 +616,7 @@ cogl_matrix_entry_equal (CoglMatrixEntry *entry0,
  * Allows visualizing the operations that build up the given @entry
  * for debugging purposes by printing to stdout.
  */
-void
+COGL_API void
 cogl_debug_matrix_entry_print (CoglMatrixEntry *entry);
 
 /**
@@ -628,7 +630,7 @@ cogl_debug_matrix_entry_print (CoglMatrixEntry *entry);
  * It is an error to pass an @entry pointer to cogl_object_ref() and
  * cogl_object_unref()
  */
-CoglMatrixEntry *
+COGL_API CoglMatrixEntry *
 cogl_matrix_entry_ref (CoglMatrixEntry *entry);
 
 /**
@@ -639,7 +641,7 @@ cogl_matrix_entry_ref (CoglMatrixEntry *entry);
  * cogl_matrix_entry_unref() or to release the reference given when
  * calling cogl_matrix_stack_get_entry().
  */
-void
+COGL_API void
 cogl_matrix_entry_unref (CoglMatrixEntry *entry);
 
 #endif /* _COGL_MATRIX_STACK_H_ */
diff --git a/cogl/cogl-matrix.h b/cogl/cogl-matrix.h
index 58ec5c76..c48cef8f 100644
--- a/cogl/cogl-matrix.h
+++ b/cogl/cogl-matrix.h
@@ -140,7 +140,7 @@ COGL_STRUCT_SIZE_ASSERT (CoglMatrix, 128 + sizeof (unsigned long) * 3);
  *   .wx=0; .wy=0; .wz=0; .ww=1;
  * ]|
  */
-void
+COGL_API void
 cogl_matrix_init_identity (CoglMatrix *matrix);
 
 /**
@@ -161,7 +161,7 @@ cogl_matrix_init_identity (CoglMatrix *matrix);
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_matrix_init_translation (CoglMatrix *matrix,
                               float       tx,
                               float       ty,
@@ -179,7 +179,7 @@ cogl_matrix_init_translation (CoglMatrix *matrix,
  * <note>It is possible to multiply the @a matrix in-place, so
  * @result can be equal to @a but can't be equal to @b.</note>
  */
-void
+COGL_API void
 cogl_matrix_multiply (CoglMatrix *result,
                      const CoglMatrix *a,
                      const CoglMatrix *b);
@@ -195,7 +195,7 @@ cogl_matrix_multiply (CoglMatrix *result,
  * Multiplies @matrix with a rotation matrix that applies a rotation
  * of @angle degrees around the specified 3D vector.
  */
-void
+COGL_API void
 cogl_matrix_rotate (CoglMatrix *matrix,
                    float angle,
                    float x,
@@ -213,7 +213,7 @@ cogl_matrix_rotate (CoglMatrix *matrix,
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_matrix_rotate_quaternion (CoglMatrix *matrix,
                                const CoglQuaternion *quaternion);
 
@@ -227,7 +227,7 @@ cogl_matrix_rotate_quaternion (CoglMatrix *matrix,
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_matrix_rotate_euler (CoglMatrix *matrix,
                           const CoglEuler *euler);
 #endif
@@ -242,7 +242,7 @@ cogl_matrix_rotate_euler (CoglMatrix *matrix,
  * Multiplies @matrix with a transform matrix that translates along
  * the X, Y and Z axis.
  */
-void
+COGL_API void
 cogl_matrix_translate (CoglMatrix *matrix,
                       float x,
                       float y,
@@ -258,7 +258,7 @@ cogl_matrix_translate (CoglMatrix *matrix,
  * Multiplies @matrix with a transform matrix that scales along the X,
  * Y and Z axis.
  */
-void
+COGL_API void
 cogl_matrix_scale (CoglMatrix *matrix,
                   float sx,
                   float sy,
@@ -307,7 +307,7 @@ cogl_matrix_scale (CoglMatrix *matrix,
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_matrix_look_at (CoglMatrix *matrix,
                      float eye_position_x,
                      float eye_position_y,
@@ -335,7 +335,7 @@ cogl_matrix_look_at (CoglMatrix *matrix,
  *
  * Multiplies @matrix by the given frustum perspective matrix.
  */
-void
+COGL_API void
 cogl_matrix_frustum (CoglMatrix *matrix,
                      float       left,
                      float       right,
@@ -360,7 +360,7 @@ cogl_matrix_frustum (CoglMatrix *matrix,
  * since there wont be enough precision to identify the depth of
  * objects near to each other.</note>
  */
-void
+COGL_API void
 cogl_matrix_perspective (CoglMatrix *matrix,
                          float       fov_y,
                          float       aspect,
@@ -387,7 +387,7 @@ cogl_matrix_perspective (CoglMatrix *matrix,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_matrix_orthographic (CoglMatrix *matrix,
                           float x_1,
                           float y_1,
@@ -456,7 +456,7 @@ cogl_matrix_ortho (CoglMatrix *matrix,
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_matrix_view_2d_in_frustum (CoglMatrix *matrix,
                                 float left,
                                 float right,
@@ -495,7 +495,7 @@ cogl_matrix_view_2d_in_frustum (CoglMatrix *matrix,
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_matrix_view_2d_in_perspective (CoglMatrix *matrix,
                                     float fov_y,
                                     float aspect,
@@ -513,7 +513,7 @@ cogl_matrix_view_2d_in_perspective (CoglMatrix *matrix,
  *
  * Initializes @matrix with the contents of @array
  */
-void
+COGL_API void
 cogl_matrix_init_from_array (CoglMatrix *matrix,
                              const float *array);
 
@@ -525,7 +525,7 @@ cogl_matrix_init_from_array (CoglMatrix *matrix,
  *
  * Return value: a pointer to the float array
  */
-const float *
+COGL_API const float *
 cogl_matrix_get_array (const CoglMatrix *matrix);
 
 #ifdef COGL_ENABLE_EXPERIMENTAL_API
@@ -536,7 +536,7 @@ cogl_matrix_get_array (const CoglMatrix *matrix);
  *
  * Initializes @matrix from a #CoglQuaternion rotation.
  */
-void
+COGL_API void
 cogl_matrix_init_from_quaternion (CoglMatrix *matrix,
                                   const CoglQuaternion *quaternion);
 
@@ -547,7 +547,7 @@ cogl_matrix_init_from_quaternion (CoglMatrix *matrix,
  *
  * Initializes @matrix from a #CoglEuler rotation.
  */
-void
+COGL_API void
 cogl_matrix_init_from_euler (CoglMatrix *matrix,
                              const CoglEuler *euler);
 #endif
@@ -564,7 +564,7 @@ cogl_matrix_init_from_euler (CoglMatrix *matrix,
  *
  * Since: 1.4
  */
-CoglBool
+COGL_API CoglBool
 cogl_matrix_equal (const void *v1, const void *v2);
 
 /**
@@ -579,7 +579,7 @@ cogl_matrix_equal (const void *v1, const void *v2);
  *
  * Since: 1.6
  */
-CoglMatrix *
+COGL_API CoglMatrix *
 cogl_matrix_copy (const CoglMatrix *matrix);
 
 /**
@@ -591,7 +591,7 @@ cogl_matrix_copy (const CoglMatrix *matrix);
  *
  * Since: 1.6
  */
-void
+COGL_API void
 cogl_matrix_free (CoglMatrix *matrix);
 
 /**
@@ -614,7 +614,7 @@ cogl_matrix_free (CoglMatrix *matrix);
  *
  * Since: 1.2
  */
-CoglBool
+COGL_API CoglBool
 cogl_matrix_get_inverse (const CoglMatrix *matrix,
                          CoglMatrix *inverse);
 
@@ -633,7 +633,7 @@ cogl_matrix_get_inverse (const CoglMatrix *matrix,
  * Transforms a point whos position is given and returned as four float
  * components.
  */
-void
+COGL_API void
 cogl_matrix_transform_point (const CoglMatrix *matrix,
                              float *x,
                              float *y,
@@ -690,7 +690,7 @@ cogl_matrix_transform_point (const CoglMatrix *matrix,
  *
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_matrix_transform_points (const CoglMatrix *matrix,
                               int n_components,
                               size_t stride_in,
@@ -745,7 +745,7 @@ cogl_matrix_transform_points (const CoglMatrix *matrix,
  *
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_matrix_project_points (const CoglMatrix *matrix,
                             int n_components,
                             size_t stride_in,
@@ -765,7 +765,7 @@ cogl_matrix_project_points (const CoglMatrix *matrix,
  * Returns: %TRUE if @matrix is an identity matrix else %FALSE
  * Since: 1.8
  */
-CoglBool
+COGL_API CoglBool
 cogl_matrix_is_identity (const CoglMatrix *matrix);
 
 /**
@@ -777,7 +777,7 @@ cogl_matrix_is_identity (const CoglMatrix *matrix);
  *
  * Since: 1.10
  */
-void
+COGL_API void
 cogl_matrix_transpose (CoglMatrix *matrix);
 
 /**
@@ -788,7 +788,7 @@ cogl_matrix_transpose (CoglMatrix *matrix);
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_debug_matrix_print (const CoglMatrix *matrix);
 
 #ifdef COGL_HAS_GTYPE_SUPPORT
@@ -800,6 +800,7 @@ cogl_debug_matrix_print (const CoglMatrix *matrix);
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API 
 GType cogl_matrix_get_gtype (void);
 
 /**
@@ -811,7 +812,7 @@ GType cogl_matrix_get_gtype (void);
  *
  * Deprecated: 1.18: Use cogl_matrix_get_gtype() instead.
  */
-GType
+COGL_API GType
 cogl_gtype_matrix_get_type (void);
 
 #endif /* COGL_HAS_GTYPE_SUPPORT*/
diff --git a/cogl/cogl-meta-texture.h b/cogl/cogl-meta-texture.h
index 69c8cb04..bf4044e3 100644
--- a/cogl/cogl-meta-texture.h
+++ b/cogl/cogl-meta-texture.h
@@ -178,7 +178,7 @@ typedef void (*CoglMetaTextureCallback) (CoglTexture *sub_texture,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_meta_texture_foreach_in_region (CoglMetaTexture *meta_texture,
                                      float tx_1,
                                      float ty_1,
diff --git a/cogl/cogl-mir-renderer.h b/cogl/cogl-mir-renderer.h
index d3f10feb..0261d986 100644
--- a/cogl/cogl-mir-renderer.h
+++ b/cogl/cogl-mir-renderer.h
@@ -54,7 +54,7 @@ COGL_BEGIN_DECLS
  * Since: 1.8
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_mir_renderer_set_foreign_connection (CoglRenderer *renderer,
                                           MirConnection *connection);
 
@@ -77,7 +77,7 @@ cogl_mir_renderer_set_foreign_connection (CoglRenderer *renderer,
  * Since: 1.8
  * Stability: unstable
  */
-MirConnection *
+COGL_API MirConnection *
 cogl_mir_renderer_get_connection (CoglRenderer *renderer);
 
 /*
@@ -118,7 +118,7 @@ typedef void (* CoglMirEventCallback) (CoglMirEvent *event,
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_mir_renderer_add_event_listener (CoglRenderer *renderer,
                                       CoglMirEventCallback func,
                                       void *data);
@@ -135,7 +135,7 @@ cogl_mir_renderer_add_event_listener (CoglRenderer *renderer,
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_mir_renderer_remove_event_listener (CoglRenderer *renderer,
                                          CoglMirEventCallback func,
                                          void *data);
diff --git a/cogl/cogl-object.h b/cogl/cogl-object.h
index a0bed88d..adf7495b 100644
--- a/cogl/cogl-object.h
+++ b/cogl/cogl-object.h
@@ -58,6 +58,7 @@ typedef struct _CoglObject      CoglObject;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_object_get_gtype (void);
 #endif
 
@@ -69,7 +70,7 @@ GType cogl_object_get_gtype (void);
  *
  * Returns: the @object, with its reference count increased
  */
-void *
+COGL_API void *
 cogl_object_ref (void *object);
 
 /**
@@ -79,7 +80,7 @@ cogl_object_ref (void *object);
  * Drecreases the reference count of @object by 1; if the reference
  * count reaches 0, the resources allocated by @object will be freed
  */
-void
+COGL_API void
 cogl_object_unref (void *object);
 
 /**
@@ -184,7 +185,7 @@ typedef void
  *
  * Since: 1.4
  */
-void
+COGL_API void
 cogl_object_set_user_data (CoglObject *object,
                            CoglUserDataKey *key,
                            void *user_data,
@@ -206,7 +207,7 @@ cogl_object_set_user_data (CoglObject *object,
  *
  * Since: 1.4
  */
-void *
+COGL_API void *
 cogl_object_get_user_data (CoglObject *object,
                            CoglUserDataKey *key);
 
@@ -225,7 +226,7 @@ cogl_object_get_user_data (CoglObject *object,
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_debug_object_foreach_type (CoglDebugObjectForeachTypeCallback func,
                                 void *user_data);
 
@@ -240,7 +241,7 @@ cogl_debug_object_foreach_type (CoglDebugObjectForeachTypeCallback func,
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_debug_object_print_instances (void);
 
 #endif /* COGL_ENABLE_EXPERIMENTAL_API */
diff --git a/cogl/cogl-offscreen.h b/cogl/cogl-offscreen.h
index 9c844426..e665f40c 100644
--- a/cogl/cogl-offscreen.h
+++ b/cogl/cogl-offscreen.h
@@ -62,6 +62,7 @@ typedef struct _CoglOffscreen CoglOffscreen;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_offscreen_get_gtype (void);
 #endif
 
@@ -99,7 +100,7 @@ GType cogl_offscreen_get_gtype (void);
  * Return value: (transfer full): a newly instantiated #CoglOffscreen
  *   framebuffer.
  */
-CoglOffscreen *
+COGL_API CoglOffscreen *
 cogl_offscreen_new_with_texture (CoglTexture *texture);
 
 /**
@@ -136,7 +137,7 @@ cogl_offscreen_new_to_texture (CoglTexture *texture);
  * Returns: %TRUE if @object is a #CoglOffscreen framebuffer,
  *          %FALSE otherwise
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_offscreen (void *object);
 
 /**
diff --git a/cogl/cogl-onscreen-template.h b/cogl/cogl-onscreen-template.h
index d8714fab..2819de24 100644
--- a/cogl/cogl-onscreen-template.h
+++ b/cogl/cogl-onscreen-template.h
@@ -55,10 +55,11 @@ typedef struct _CoglOnscreenTemplate              CoglOnscreenTemplate;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_onscreen_template_get_gtype (void);
 #endif
 
-CoglOnscreenTemplate *
+COGL_API CoglOnscreenTemplate *
 cogl_onscreen_template_new (CoglSwapChain *swap_chain);
 
 /**
@@ -84,7 +85,7 @@ cogl_onscreen_template_new (CoglSwapChain *swap_chain);
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_onscreen_template_set_samples_per_pixel (
                                           CoglOnscreenTemplate *onscreen_template,
                                           int n);
@@ -101,7 +102,7 @@ cogl_onscreen_template_set_samples_per_pixel (
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_onscreen_template_set_swap_throttled (
                                           CoglOnscreenTemplate *onscreen_template,
                                           CoglBool throttled);
@@ -120,7 +121,7 @@ cogl_onscreen_template_set_swap_throttled (
  * Since: 1.20
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_onscreen_template_set_stereo_enabled (
                                           CoglOnscreenTemplate *onscreen_template,
                                           CoglBool enabled);
@@ -135,7 +136,7 @@ cogl_onscreen_template_set_stereo_enabled (
  * Since: 1.10
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_onscreen_template (void *object);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-onscreen.h b/cogl/cogl-onscreen.h
index 481664e0..0ff320d2 100644
--- a/cogl/cogl-onscreen.h
+++ b/cogl/cogl-onscreen.h
@@ -58,6 +58,7 @@ typedef struct _CoglOnscreen CoglOnscreen;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_onscreen_get_gtype (void);
 #endif
 
@@ -75,7 +76,7 @@ GType cogl_onscreen_get_gtype (void);
  * Since: 1.8
  * Stability: unstable
  */
-CoglOnscreen *
+COGL_API CoglOnscreen *
 cogl_onscreen_new (CoglContext *context, int width, int height);
 
 #ifdef COGL_HAS_X11
@@ -134,7 +135,7 @@ typedef void (*CoglOnscreenX11MaskCallback) (CoglOnscreen *onscreen,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_x11_onscreen_set_foreign_window_xid (CoglOnscreen *onscreen,
                                           uint32_t xid,
                                           CoglOnscreenX11MaskCallback update,
@@ -157,12 +158,12 @@ cogl_x11_onscreen_set_foreign_window_xid (CoglOnscreen *onscreen,
  * Since: 1.10
  * Stability: unstable
  */
-uint32_t
+COGL_API uint32_t
 cogl_x11_onscreen_get_window_xid (CoglOnscreen *onscreen);
 
 /* XXX: we should maybe remove this, since nothing currently uses
  * it and the current implementation looks dubious. */
-uint32_t
+COGL_API uint32_t
 cogl_x11_onscreen_get_visual_xid (CoglOnscreen *onscreen);
 #endif /* COGL_HAS_X11 */
 
@@ -181,7 +182,7 @@ cogl_x11_onscreen_get_visual_xid (CoglOnscreen *onscreen);
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_win32_onscreen_set_foreign_window (CoglOnscreen *onscreen,
                                         HWND hwnd);
 
@@ -196,14 +197,14 @@ cogl_win32_onscreen_set_foreign_window (CoglOnscreen *onscreen,
  * Since: 1.10
  * Stability: unstable
  */
-HWND
+COGL_API HWND
 cogl_win32_onscreen_get_window (CoglOnscreen *onscreen);
 #endif /* COGL_HAS_WIN32_SUPPORT */
 
 #if defined (COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT)
-struct wl_surface *
+COGL_API struct wl_surface *
 cogl_wayland_onscreen_get_surface (CoglOnscreen *onscreen);
-struct wl_shell_surface *
+COGL_API struct wl_shell_surface *
 cogl_wayland_onscreen_get_shell_surface (CoglOnscreen *onscreen);
 
 /**
@@ -221,7 +222,7 @@ cogl_wayland_onscreen_get_shell_surface (CoglOnscreen *onscreen);
  * Since: 1.16
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_wayland_onscreen_set_foreign_surface (CoglOnscreen *onscreen,
                                            struct wl_surface *surface);
 
@@ -259,7 +260,7 @@ cogl_wayland_onscreen_set_foreign_surface (CoglOnscreen *onscreen,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_wayland_onscreen_resize (CoglOnscreen *onscreen,
                               int           width,
                               int           height,
@@ -281,7 +282,7 @@ cogl_wayland_onscreen_resize (CoglOnscreen *onscreen,
  * Since: 1.18
  * Stability: unstable
  */
-struct MirSurface *
+COGL_API struct MirSurface *
 cogl_mir_onscreen_get_surface (CoglOnscreen *onscreen);
 
 /**
@@ -300,7 +301,7 @@ cogl_mir_onscreen_get_surface (CoglOnscreen *onscreen);
  * Since: 1.18
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_mir_onscreen_set_foreign_surface (CoglOnscreen *onscreen,
                                        struct MirSurface *surface);
 
@@ -320,7 +321,7 @@ cogl_mir_onscreen_set_foreign_surface (CoglOnscreen *onscreen,
  * Since: 1.18
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_mir_onscreen_resize (CoglOnscreen *onscreen,
                           int           width,
                           int           height);
@@ -339,7 +340,7 @@ cogl_mir_onscreen_resize (CoglOnscreen *onscreen,
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_onscreen_set_swap_throttled (CoglOnscreen *onscreen,
                                   CoglBool throttled);
 
@@ -371,7 +372,7 @@ cogl_onscreen_set_swap_throttled (CoglOnscreen *onscreen,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_onscreen_show (CoglOnscreen *onscreen);
 
 /**
@@ -396,7 +397,7 @@ cogl_onscreen_show (CoglOnscreen *onscreen);
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_onscreen_hide (CoglOnscreen *onscreen);
 
 /**
@@ -420,7 +421,7 @@ cogl_onscreen_hide (CoglOnscreen *onscreen);
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_onscreen_swap_buffers (CoglOnscreen *onscreen);
 
 
@@ -473,7 +474,7 @@ cogl_onscreen_swap_buffers (CoglOnscreen *onscreen);
  * Since: 1.14
  * Stability: stable
  */
-int
+COGL_API int
 cogl_onscreen_get_buffer_age (CoglOnscreen *onscreen);
 
 /**
@@ -524,7 +525,7 @@ cogl_onscreen_get_buffer_age (CoglOnscreen *onscreen);
  * Since: 1.16
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_onscreen_swap_buffers_with_damage (CoglOnscreen *onscreen,
                                         const int *rectangles,
                                         int n_rectangles);
@@ -549,7 +550,7 @@ cogl_onscreen_swap_buffers_with_damage (CoglOnscreen *onscreen,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_onscreen_swap_region (CoglOnscreen *onscreen,
                            const int *rectangles,
                            int n_rectangles);
@@ -635,6 +636,7 @@ typedef struct _CoglClosure CoglFrameClosure;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_frame_closure_get_gtype (void);
 #endif
 
@@ -675,7 +677,7 @@ GType cogl_frame_closure_get_gtype (void);
  * Since: 1.14
  * Stability: unstable
  */
-CoglFrameClosure *
+COGL_API CoglFrameClosure *
 cogl_onscreen_add_frame_callback (CoglOnscreen *onscreen,
                                   CoglFrameCallback callback,
                                   void *user_data,
@@ -697,7 +699,7 @@ cogl_onscreen_add_frame_callback (CoglOnscreen *onscreen,
  * Since: 1.14
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_onscreen_remove_frame_callback (CoglOnscreen *onscreen,
                                      CoglFrameClosure *closure);
 
@@ -783,7 +785,7 @@ cogl_onscreen_remove_swap_buffers_callback (CoglOnscreen *onscreen,
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_onscreen_set_resizable (CoglOnscreen *onscreen,
                              CoglBool resizable);
 
@@ -810,7 +812,7 @@ cogl_onscreen_set_resizable (CoglOnscreen *onscreen,
  *               resizable or not.
  * Since: 2.0
  */
-CoglBool
+COGL_API CoglBool
 cogl_onscreen_get_resizable (CoglOnscreen *onscreen);
 
 /**
@@ -862,6 +864,7 @@ typedef struct _CoglClosure CoglOnscreenResizeClosure;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_onscreen_resize_closure_get_gtype (void);
 #endif
 
@@ -897,7 +900,7 @@ GType cogl_onscreen_resize_closure_get_gtype (void);
  *               remove the callback and associated @user_data later.
  * Since: 2.0
  */
-CoglOnscreenResizeClosure *
+COGL_API CoglOnscreenResizeClosure *
 cogl_onscreen_add_resize_callback (CoglOnscreen *onscreen,
                                    CoglOnscreenResizeCallback callback,
                                    void *user_data,
@@ -913,7 +916,7 @@ cogl_onscreen_add_resize_callback (CoglOnscreen *onscreen,
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_onscreen_remove_resize_callback (CoglOnscreen *onscreen,
                                       CoglOnscreenResizeClosure *closure);
 
@@ -978,6 +981,7 @@ typedef struct _CoglClosure CoglOnscreenDirtyClosure;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API 
 GType cogl_onscreen_dirty_closure_get_gtype (void);
 #endif
 
@@ -1011,7 +1015,7 @@ GType cogl_onscreen_dirty_closure_get_gtype (void);
  * Since: 1.16
  * Stability: unstable
  */
-CoglOnscreenDirtyClosure *
+COGL_API CoglOnscreenDirtyClosure *
 cogl_onscreen_add_dirty_callback (CoglOnscreen *onscreen,
                                   CoglOnscreenDirtyCallback callback,
                                   void *user_data,
@@ -1033,7 +1037,7 @@ cogl_onscreen_add_dirty_callback (CoglOnscreen *onscreen,
  * Since: 1.16
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_onscreen_remove_dirty_callback (CoglOnscreen *onscreen,
                                      CoglOnscreenDirtyClosure *closure);
 
@@ -1048,7 +1052,7 @@ cogl_onscreen_remove_dirty_callback (CoglOnscreen *onscreen,
  * Since: 1.10
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_onscreen (void *object);
 
 /**
@@ -1063,7 +1067,7 @@ cogl_is_onscreen (void *object);
  * Since: 1.14
  * Stability: unstable
  */
-int64_t
+COGL_API int64_t
 cogl_onscreen_get_frame_counter (CoglOnscreen *onscreen);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-output.h b/cogl/cogl-output.h
index 6eec10ee..2267fc32 100644
--- a/cogl/cogl-output.h
+++ b/cogl/cogl-output.h
@@ -76,6 +76,7 @@ typedef struct _CoglOutput CoglOutput;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_output_get_gtype (void);
 #endif
 
@@ -145,7 +146,7 @@ cogl_is_output (void *object);
  * Since: 1.14
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_output_get_x (CoglOutput *output);
 
 /**
@@ -160,7 +161,7 @@ cogl_output_get_x (CoglOutput *output);
  * Since: 1.14
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_output_get_y (CoglOutput *output);
 
 /**
@@ -173,7 +174,7 @@ cogl_output_get_y (CoglOutput *output);
  * Since: 1.14
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_output_get_width (CoglOutput *output);
 
 /**
@@ -186,7 +187,7 @@ cogl_output_get_width (CoglOutput *output);
  * Since: 1.14
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_output_get_height (CoglOutput *output);
 
 /**
@@ -203,7 +204,7 @@ cogl_output_get_height (CoglOutput *output);
  * Since: 1.14
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_output_get_mm_width (CoglOutput *output);
 
 /**
@@ -220,7 +221,7 @@ cogl_output_get_mm_width (CoglOutput *output);
  * Since: 1.14
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_output_get_mm_height (CoglOutput *output);
 
 /**
@@ -235,7 +236,7 @@ cogl_output_get_mm_height (CoglOutput *output);
  * Since: 1.14
  * Stability: unstable
  */
-CoglSubpixelOrder
+COGL_API CoglSubpixelOrder
 cogl_output_get_subpixel_order (CoglOutput *output);
 
 /**
@@ -250,7 +251,7 @@ cogl_output_get_subpixel_order (CoglOutput *output);
  * Since: 1.14
  * Stability: unstable
  */
-float
+COGL_API float
 cogl_output_get_refresh_rate (CoglOutput *output);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-pipeline-layer-state.h b/cogl/cogl-pipeline-layer-state.h
index 4be7d398..b5d6c338 100644
--- a/cogl/cogl-pipeline-layer-state.h
+++ b/cogl/cogl-pipeline-layer-state.h
@@ -150,7 +150,7 @@ typedef enum {
  * Since: 2.0
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_layer_texture (CoglPipeline *pipeline,
                                  int           layer_index,
                                  CoglTexture  *texture);
@@ -176,7 +176,7 @@ cogl_pipeline_set_layer_texture (CoglPipeline *pipeline,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_layer_null_texture (CoglPipeline *pipeline,
                                       int layer_index,
                                       CoglTextureType texture_type);
@@ -191,7 +191,7 @@ cogl_pipeline_set_layer_null_texture (CoglPipeline *pipeline,
  * Stability: unstable
  * Since: 1.10
  */
-CoglTexture *
+COGL_API CoglTexture *
 cogl_pipeline_get_layer_texture (CoglPipeline *pipeline,
                                  int layer_index);
 
@@ -204,7 +204,7 @@ cogl_pipeline_get_layer_texture (CoglPipeline *pipeline,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_pipeline_remove_layer (CoglPipeline *pipeline,
                            int           layer_index);
 
@@ -302,7 +302,7 @@ cogl_pipeline_remove_layer (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_pipeline_set_layer_combine (CoglPipeline *pipeline,
                                 int           layer_index,
                                 const char   *blend_string,
@@ -321,7 +321,7 @@ cogl_pipeline_set_layer_combine (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_layer_combine_constant (CoglPipeline    *pipeline,
                                           int              layer_index,
                                           const CoglColor *constant);
@@ -338,7 +338,7 @@ cogl_pipeline_set_layer_combine_constant (CoglPipeline    *pipeline,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_layer_matrix (CoglPipeline     *pipeline,
                                int               layer_index,
                                const CoglMatrix *matrix);
@@ -354,7 +354,7 @@ cogl_pipeline_set_layer_matrix (CoglPipeline     *pipeline,
  * Since: 2.0
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_pipeline_get_n_layers (CoglPipeline *pipeline);
 
 /**
@@ -375,7 +375,7 @@ cogl_pipeline_get_n_layers (CoglPipeline *pipeline);
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_layer_filters (CoglPipeline      *pipeline,
                                  int                layer_index,
                                  CoglPipelineFilter min_filter,
@@ -398,7 +398,7 @@ cogl_pipeline_set_layer_filters (CoglPipeline      *pipeline,
  * Since: 1.10
  * Stability: unstable
  */
-CoglPipelineFilter
+COGL_API CoglPipelineFilter
 cogl_pipeline_get_layer_min_filter (CoglPipeline *pipeline,
                                     int layer_index);
 
@@ -419,7 +419,7 @@ cogl_pipeline_get_layer_min_filter (CoglPipeline *pipeline,
  * Since: 1.10
  * Stability: unstable
  */
-CoglPipelineFilter
+COGL_API CoglPipelineFilter
 cogl_pipeline_get_layer_mag_filter (CoglPipeline *pipeline,
                                     int layer_index);
 
@@ -445,7 +445,7 @@ cogl_pipeline_get_layer_mag_filter (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_pipeline_set_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
                                                      int           layer_index,
                                                      CoglBool      enable,
@@ -465,7 +465,7 @@ cogl_pipeline_set_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_pipeline_get_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
                                                      int           layer_index);
 
@@ -483,7 +483,7 @@ cogl_pipeline_get_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
  * Since: 1.6
  * Stability: unstable
  */
-CoglPipelineWrapMode
+COGL_API CoglPipelineWrapMode
 cogl_pipeline_get_layer_wrap_mode_s (CoglPipeline *pipeline,
                                      int           layer_index);
 
@@ -498,7 +498,7 @@ cogl_pipeline_get_layer_wrap_mode_s (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_layer_wrap_mode_s (CoglPipeline        *pipeline,
                                      int                  layer_index,
                                      CoglPipelineWrapMode mode);
@@ -517,7 +517,7 @@ cogl_pipeline_set_layer_wrap_mode_s (CoglPipeline        *pipeline,
  * Since: 1.6
  * Stability: unstable
  */
-CoglPipelineWrapMode
+COGL_API CoglPipelineWrapMode
 cogl_pipeline_get_layer_wrap_mode_t (CoglPipeline *pipeline,
                                      int           layer_index);
 
@@ -533,7 +533,7 @@ cogl_pipeline_get_layer_wrap_mode_t (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_layer_wrap_mode_t (CoglPipeline        *pipeline,
                                      int                  layer_index,
                                      CoglPipelineWrapMode mode);
@@ -552,7 +552,7 @@ cogl_pipeline_set_layer_wrap_mode_t (CoglPipeline        *pipeline,
  * Since: 1.6
  * Stability: unstable
  */
-CoglPipelineWrapMode
+COGL_API CoglPipelineWrapMode
 cogl_pipeline_get_layer_wrap_mode_p (CoglPipeline *pipeline,
                                      int           layer_index);
 
@@ -568,7 +568,7 @@ cogl_pipeline_get_layer_wrap_mode_p (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_layer_wrap_mode_p (CoglPipeline        *pipeline,
                                      int                  layer_index,
                                      CoglPipelineWrapMode mode);
@@ -588,7 +588,7 @@ cogl_pipeline_set_layer_wrap_mode_p (CoglPipeline        *pipeline,
  * Since: 2.0
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_layer_wrap_mode (CoglPipeline        *pipeline,
                                    int                  layer_index,
                                    CoglPipelineWrapMode mode);
@@ -608,7 +608,7 @@ cogl_pipeline_set_layer_wrap_mode (CoglPipeline        *pipeline,
  * Since: 1.10
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_add_layer_snippet (CoglPipeline *pipeline,
                                  int layer,
                                  CoglSnippet *snippet);
diff --git a/cogl/cogl-pipeline-state.h b/cogl/cogl-pipeline-state.h
index 6acbb6db..34eff6ae 100644
--- a/cogl/cogl-pipeline-state.h
+++ b/cogl/cogl-pipeline-state.h
@@ -60,7 +60,7 @@ COGL_BEGIN_DECLS
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_color (CoglPipeline    *pipeline,
                          const CoglColor *color);
 
@@ -79,7 +79,7 @@ cogl_pipeline_set_color (CoglPipeline    *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_color4ub (CoglPipeline *pipeline,
                            uint8_t red,
                             uint8_t green,
@@ -101,7 +101,7 @@ cogl_pipeline_set_color4ub (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_color4f (CoglPipeline *pipeline,
                            float         red,
                            float         green,
@@ -118,7 +118,7 @@ cogl_pipeline_set_color4f (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_get_color (CoglPipeline *pipeline,
                          CoglColor    *color);
 
@@ -139,7 +139,7 @@ cogl_pipeline_get_color (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_ambient (CoglPipeline    *pipeline,
                           const CoglColor *ambient);
 
@@ -153,7 +153,7 @@ cogl_pipeline_set_ambient (CoglPipeline    *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_get_ambient (CoglPipeline *pipeline,
                            CoglColor    *ambient);
 
@@ -171,7 +171,7 @@ cogl_pipeline_get_ambient (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_diffuse (CoglPipeline    *pipeline,
                           const CoglColor *diffuse);
 
@@ -185,7 +185,7 @@ cogl_pipeline_set_diffuse (CoglPipeline    *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_get_diffuse (CoglPipeline *pipeline,
                            CoglColor    *diffuse);
 
@@ -204,7 +204,7 @@ cogl_pipeline_get_diffuse (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_ambient_and_diffuse (CoglPipeline    *pipeline,
                                       const CoglColor *color);
 
@@ -222,7 +222,7 @@ cogl_pipeline_set_ambient_and_diffuse (CoglPipeline    *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_specular (CoglPipeline    *pipeline,
                            const CoglColor *specular);
 
@@ -236,7 +236,7 @@ cogl_pipeline_set_specular (CoglPipeline    *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_get_specular (CoglPipeline *pipeline,
                             CoglColor    *specular);
 
@@ -255,7 +255,7 @@ cogl_pipeline_get_specular (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_shininess (CoglPipeline *pipeline,
                             float         shininess);
 
@@ -270,7 +270,7 @@ cogl_pipeline_set_shininess (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-float
+COGL_API float
 cogl_pipeline_get_shininess (CoglPipeline *pipeline);
 
 /**
@@ -287,7 +287,7 @@ cogl_pipeline_get_shininess (CoglPipeline *pipeline);
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_emission (CoglPipeline    *pipeline,
                            const CoglColor *emission);
 
@@ -301,7 +301,7 @@ cogl_pipeline_set_emission (CoglPipeline    *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_get_emission (CoglPipeline *pipeline,
                             CoglColor    *emission);
 
@@ -357,7 +357,7 @@ typedef enum {
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_alpha_test_function (CoglPipeline         *pipeline,
                                       CoglPipelineAlphaFunc alpha_func,
                                       float                 alpha_reference);
@@ -371,7 +371,7 @@ cogl_pipeline_set_alpha_test_function (CoglPipeline         *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-CoglPipelineAlphaFunc
+COGL_API CoglPipelineAlphaFunc
 cogl_pipeline_get_alpha_test_function (CoglPipeline *pipeline);
 
 /**
@@ -383,7 +383,7 @@ cogl_pipeline_get_alpha_test_function (CoglPipeline *pipeline);
  * Since: 2.0
  * Stability: Unstable
  */
-float
+COGL_API float
 cogl_pipeline_get_alpha_test_reference (CoglPipeline *pipeline);
 
 /**
@@ -468,7 +468,7 @@ cogl_pipeline_get_alpha_test_reference (CoglPipeline *pipeline);
  * Since: 2.0
  * Stability: Unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_pipeline_set_blend (CoglPipeline *pipeline,
                          const char   *blend_string,
                          CoglError      **error);
@@ -484,7 +484,7 @@ cogl_pipeline_set_blend (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_blend_constant (CoglPipeline *pipeline,
                                   const CoglColor *constant_color);
 
@@ -509,7 +509,7 @@ cogl_pipeline_set_blend_constant (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_point_size (CoglPipeline *pipeline,
                               float point_size);
 
@@ -525,7 +525,7 @@ cogl_pipeline_set_point_size (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-float
+COGL_API float
 cogl_pipeline_get_point_size (CoglPipeline *pipeline);
 
 /**
@@ -554,7 +554,7 @@ cogl_pipeline_get_point_size (CoglPipeline *pipeline);
  * Stability: Unstable
  * Return value: %TRUE if the change suceeded or %FALSE otherwise
  */
-CoglBool
+COGL_API CoglBool
 cogl_pipeline_set_per_vertex_point_size (CoglPipeline *pipeline,
                                          CoglBool enable,
                                          CoglError **error);
@@ -569,7 +569,7 @@ cogl_pipeline_set_per_vertex_point_size (CoglPipeline *pipeline,
  *   enabled or %FALSE otherwise. The per-vertex point size can be
  *   enabled with cogl_pipeline_set_per_vertex_point_size().
  */
-CoglBool
+COGL_API CoglBool
 cogl_pipeline_get_per_vertex_point_size (CoglPipeline *pipeline);
 
 /**
@@ -584,7 +584,7 @@ cogl_pipeline_get_per_vertex_point_size (CoglPipeline *pipeline);
  * Since: 1.8
  * Stability: unstable
  */
-CoglColorMask
+COGL_API CoglColorMask
 cogl_pipeline_get_color_mask (CoglPipeline *pipeline);
 
 /**
@@ -600,7 +600,7 @@ cogl_pipeline_get_color_mask (CoglPipeline *pipeline);
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_color_mask (CoglPipeline *pipeline,
                               CoglColorMask color_mask);
 
@@ -616,7 +616,7 @@ cogl_pipeline_set_color_mask (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-CoglHandle
+COGL_API CoglHandle
 cogl_pipeline_get_user_program (CoglPipeline *pipeline);
 
 /**
@@ -666,7 +666,7 @@ cogl_pipeline_get_user_program (CoglPipeline *pipeline);
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_user_program (CoglPipeline *pipeline,
                                 CoglHandle program);
 
@@ -690,7 +690,7 @@ cogl_pipeline_set_user_program (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_pipeline_set_depth_state (CoglPipeline *pipeline,
                                const CoglDepthState *state,
                                CoglError **error);
@@ -706,7 +706,7 @@ cogl_pipeline_set_depth_state (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_get_depth_state (CoglPipeline *pipeline,
                                CoglDepthState *state_out);
 
@@ -750,7 +750,7 @@ typedef enum
  * Status: Unstable
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_pipeline_set_cull_face_mode (CoglPipeline *pipeline,
                                   CoglPipelineCullFaceMode cull_face_mode);
 
@@ -763,7 +763,7 @@ cogl_pipeline_set_cull_face_mode (CoglPipeline *pipeline,
  * Status: Unstable
  * Since: 2.0
  */
-CoglPipelineCullFaceMode
+COGL_API CoglPipelineCullFaceMode
 cogl_pipeline_get_cull_face_mode (CoglPipeline *pipeline);
 
 /**
@@ -782,7 +782,7 @@ cogl_pipeline_get_cull_face_mode (CoglPipeline *pipeline);
  * Status: Unstable
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_pipeline_set_front_face_winding (CoglPipeline *pipeline,
                                       CoglWinding front_winding);
 
@@ -803,7 +803,7 @@ cogl_pipeline_set_front_face_winding (CoglPipeline *pipeline,
  * Status: Unstable
  * Since: 2.0
  */
-CoglWinding
+COGL_API CoglWinding
 cogl_pipeline_get_front_face_winding (CoglPipeline *pipeline);
 
 /**
@@ -826,7 +826,7 @@ cogl_pipeline_get_front_face_winding (CoglPipeline *pipeline);
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_uniform_1f (CoglPipeline *pipeline,
                               int uniform_location,
                               float value);
@@ -851,7 +851,7 @@ cogl_pipeline_set_uniform_1f (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_uniform_1i (CoglPipeline *pipeline,
                               int uniform_location,
                               int value);
@@ -880,7 +880,7 @@ cogl_pipeline_set_uniform_1i (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_uniform_float (CoglPipeline *pipeline,
                                  int uniform_location,
                                  int n_components,
@@ -911,7 +911,7 @@ cogl_pipeline_set_uniform_float (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_uniform_int (CoglPipeline *pipeline,
                                int uniform_location,
                                int n_components,
@@ -948,7 +948,7 @@ cogl_pipeline_set_uniform_int (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_set_uniform_matrix (CoglPipeline *pipeline,
                                   int uniform_location,
                                   int dimensions,
@@ -969,7 +969,7 @@ cogl_pipeline_set_uniform_matrix (CoglPipeline *pipeline,
  * Since: 1.10
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_add_snippet (CoglPipeline *pipeline,
                            CoglSnippet *snippet);
 
diff --git a/cogl/cogl-pipeline.h b/cogl/cogl-pipeline.h
index 08ae3f69..3fab7727 100644
--- a/cogl/cogl-pipeline.h
+++ b/cogl/cogl-pipeline.h
@@ -74,6 +74,7 @@ COGL_BEGIN_DECLS
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_pipeline_get_gtype (void);
 #endif
 
@@ -89,7 +90,7 @@ GType cogl_pipeline_get_gtype (void);
  * Since: 2.0
  * Stability: Unstable
  */
-CoglPipeline *
+COGL_API CoglPipeline *
 cogl_pipeline_new (CoglContext *context);
 
 /**
@@ -110,7 +111,7 @@ cogl_pipeline_new (CoglContext *context);
  * Since: 2.0
  * Stability: Unstable
  */
-CoglPipeline *
+COGL_API CoglPipeline *
 cogl_pipeline_copy (CoglPipeline *source);
 
 /**
@@ -125,7 +126,7 @@ cogl_pipeline_copy (CoglPipeline *source);
  * Since: 2.0
  * Stability: Unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_pipeline (void *object);
 
 /**
@@ -157,7 +158,7 @@ typedef CoglBool (*CoglPipelineLayerCallback) (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_pipeline_foreach_layer (CoglPipeline *pipeline,
                              CoglPipelineLayerCallback callback,
                              void *user_data);
@@ -182,7 +183,7 @@ cogl_pipeline_foreach_layer (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-int
+COGL_API int
 cogl_pipeline_get_uniform_location (CoglPipeline *pipeline,
                                     const char *uniform_name);
 
diff --git a/cogl/cogl-pixel-buffer.h b/cogl/cogl-pixel-buffer.h
index 8ae61648..39ce41d3 100644
--- a/cogl/cogl-pixel-buffer.h
+++ b/cogl/cogl-pixel-buffer.h
@@ -60,6 +60,7 @@ COGL_BEGIN_DECLS
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_pixel_buffer_get_gtype (void);
 #endif
 
@@ -82,7 +83,7 @@ GType cogl_pixel_buffer_get_gtype (void);
  * Since: 1.10
  * Stability: unstable
  */
-CoglPixelBuffer *
+COGL_API CoglPixelBuffer *
 cogl_pixel_buffer_new (CoglContext *context,
                        size_t size,
                        const void *data);
@@ -99,7 +100,7 @@ cogl_pixel_buffer_new (CoglContext *context,
  * Since: 1.2
  * Stability: Unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_pixel_buffer (void *object);
 
 #if 0
@@ -123,7 +124,7 @@ cogl_is_pixel_buffer (void *object);
  * Since: 1.2
  * Stability: Unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_pixel_buffer_set_region (CoglPixelBuffer *buffer,
                               uint8_t *data,
                               unsigned int src_width,
diff --git a/cogl/cogl-poll.h b/cogl/cogl-poll.h
index fa93d92a..f6daead3 100644
--- a/cogl/cogl-poll.h
+++ b/cogl/cogl-poll.h
@@ -162,7 +162,7 @@ typedef struct {
  * Stability: unstable
  * Since: 1.16
  */
-int
+COGL_API int
 cogl_poll_renderer_get_info (CoglRenderer *renderer,
                              CoglPollFD **poll_fds,
                              int *n_poll_fds,
@@ -190,7 +190,7 @@ cogl_poll_renderer_get_info (CoglRenderer *renderer,
  * Stability: unstable
  * Since: 1.16
  */
-void
+COGL_API void
 cogl_poll_renderer_dispatch (CoglRenderer *renderer,
                              const CoglPollFD *poll_fds,
                              int n_poll_fds);
diff --git a/cogl/cogl-primitive-texture.h b/cogl/cogl-primitive-texture.h
index effaac35..f306eacb 100644
--- a/cogl/cogl-primitive-texture.h
+++ b/cogl/cogl-primitive-texture.h
@@ -84,7 +84,7 @@ typedef struct _CoglPrimitiveTexture CoglPrimitiveTexture;
  * Since: 2.0
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_primitive_texture (void *object);
 
 /**
@@ -102,7 +102,7 @@ cogl_is_primitive_texture (void *object);
  * Since: 2.0
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_primitive_texture_set_auto_mipmap (CoglPrimitiveTexture *primitive_texture,
                                         CoglBool value);
 
diff --git a/cogl/cogl-primitive.h b/cogl/cogl-primitive.h
index 0f20bb58..b07649a8 100644
--- a/cogl/cogl-primitive.h
+++ b/cogl/cogl-primitive.h
@@ -67,6 +67,7 @@ COGL_BEGIN_DECLS
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_primitive_get_gtype (void);
 #endif
 
@@ -247,7 +248,7 @@ typedef struct {
  * Since: 1.6
  * Stability: Unstable
  */
-CoglPrimitive *
+COGL_API CoglPrimitive *
 cogl_primitive_new (CoglVerticesMode mode,
                     int n_vertices,
                     ...);
@@ -273,7 +274,7 @@ cogl_primitive_new (CoglVerticesMode mode,
  * Since: 1.6
  * Stability: Unstable
  */
-CoglPrimitive *
+COGL_API CoglPrimitive *
 cogl_primitive_new_with_attributes (CoglVerticesMode mode,
                                     int n_vertices,
                                     CoglAttribute **attributes,
@@ -327,7 +328,7 @@ cogl_primitive_new_with_attributes (CoglVerticesMode mode,
  * Since: 1.6
  * Stability: Unstable
  */
-CoglPrimitive *
+COGL_API CoglPrimitive *
 cogl_primitive_new_p2 (CoglContext *context,
                        CoglVerticesMode mode,
                        int n_vertices,
@@ -381,7 +382,7 @@ cogl_primitive_new_p2 (CoglContext *context,
  * Since: 1.6
  * Stability: Unstable
  */
-CoglPrimitive *
+COGL_API CoglPrimitive *
 cogl_primitive_new_p3 (CoglContext *context,
                        CoglVerticesMode mode,
                        int n_vertices,
@@ -437,7 +438,7 @@ cogl_primitive_new_p3 (CoglContext *context,
  * Since: 1.6
  * Stability: Unstable
  */
-CoglPrimitive *
+COGL_API CoglPrimitive *
 cogl_primitive_new_p2c4 (CoglContext *context,
                          CoglVerticesMode mode,
                          int n_vertices,
@@ -493,7 +494,7 @@ cogl_primitive_new_p2c4 (CoglContext *context,
  * Since: 1.6
  * Stability: Unstable
  */
-CoglPrimitive *
+COGL_API CoglPrimitive *
 cogl_primitive_new_p3c4 (CoglContext *context,
                          CoglVerticesMode mode,
                          int n_vertices,
@@ -549,7 +550,7 @@ cogl_primitive_new_p3c4 (CoglContext *context,
  * Since: 1.6
  * Stability: Unstable
  */
-CoglPrimitive *
+COGL_API CoglPrimitive *
 cogl_primitive_new_p2t2 (CoglContext *context,
                          CoglVerticesMode mode,
                          int n_vertices,
@@ -605,7 +606,7 @@ cogl_primitive_new_p2t2 (CoglContext *context,
  * Since: 1.6
  * Stability: Unstable
  */
-CoglPrimitive *
+COGL_API CoglPrimitive *
 cogl_primitive_new_p3t2 (CoglContext *context,
                          CoglVerticesMode mode,
                          int n_vertices,
@@ -661,7 +662,7 @@ cogl_primitive_new_p3t2 (CoglContext *context,
  * Since: 1.6
  * Stability: Unstable
  */
-CoglPrimitive *
+COGL_API CoglPrimitive *
 cogl_primitive_new_p2t2c4 (CoglContext *context,
                            CoglVerticesMode mode,
                            int n_vertices,
@@ -717,15 +718,15 @@ cogl_primitive_new_p2t2c4 (CoglContext *context,
  * Since: 1.6
  * Stability: Unstable
  */
-CoglPrimitive *
+COGL_API CoglPrimitive *
 cogl_primitive_new_p3t2c4 (CoglContext *context,
                            CoglVerticesMode mode,
                            int n_vertices,
                            const CoglVertexP3T2C4 *data);
-int
+COGL_API int
 cogl_primitive_get_first_vertex (CoglPrimitive *primitive);
 
-void
+COGL_API void
 cogl_primitive_set_first_vertex (CoglPrimitive *primitive,
                                  int first_vertex);
 
@@ -751,7 +752,7 @@ cogl_primitive_set_first_vertex (CoglPrimitive *primitive,
  * Since: 1.8
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_primitive_get_n_vertices (CoglPrimitive *primitive);
 
 /**
@@ -772,14 +773,14 @@ cogl_primitive_get_n_vertices (CoglPrimitive *primitive);
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_primitive_set_n_vertices (CoglPrimitive *primitive,
                                int n_vertices);
 
-CoglVerticesMode
+COGL_API CoglVerticesMode
 cogl_primitive_get_mode (CoglPrimitive *primitive);
 
-void
+COGL_API void
 cogl_primitive_set_mode (CoglPrimitive *primitive,
                          CoglVerticesMode mode);
 
@@ -794,7 +795,7 @@ cogl_primitive_set_mode (CoglPrimitive *primitive,
  * Since: 1.6
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_primitive_set_attributes (CoglPrimitive *primitive,
                                CoglAttribute **attributes,
                                int n_attributes);
@@ -827,7 +828,7 @@ cogl_primitive_set_attributes (CoglPrimitive *primitive,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_primitive_set_indices (CoglPrimitive *primitive,
                             CoglIndices *indices,
                             int n_indices);
@@ -842,7 +843,7 @@ cogl_primitive_set_indices (CoglPrimitive *primitive,
  * Since: 1.10
  * Stability: unstable
  */
-CoglIndices *
+COGL_API CoglIndices *
 cogl_primitive_get_indices (CoglPrimitive *primitive);
 
 /**
@@ -857,7 +858,7 @@ cogl_primitive_get_indices (CoglPrimitive *primitive);
  * Since: 1.10
  * Stability: unstable
  */
-CoglPrimitive *
+COGL_API CoglPrimitive *
 cogl_primitive_copy (CoglPrimitive *primitive);
 
 /**
@@ -872,7 +873,7 @@ cogl_primitive_copy (CoglPrimitive *primitive);
  * Since: 1.6
  * Stability: Unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_primitive (void *object);
 
 /**
@@ -907,7 +908,7 @@ typedef CoglBool (* CoglPrimitiveAttributeCallback) (CoglPrimitive *primitive,
  * Since: 1.10
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_primitive_foreach_attribute (CoglPrimitive *primitive,
                                   CoglPrimitiveAttributeCallback callback,
                                   void *user_data);
@@ -930,7 +931,7 @@ cogl_primitive_foreach_attribute (CoglPrimitive *primitive,
  * Stability: unstable
  * Since: 1.16
  */
-void
+COGL_API void
 cogl_primitive_draw (CoglPrimitive *primitive,
                      CoglFramebuffer *framebuffer,
                      CoglPipeline *pipeline);
diff --git a/cogl/cogl-primitives.h b/cogl/cogl-primitives.h
index 0c9211ee..77943581 100644
--- a/cogl/cogl-primitives.h
+++ b/cogl/cogl-primitives.h
@@ -33,6 +33,8 @@
 
 #include <glib.h>
 
+#include <cogl/cogl-defines.h>
+
 COGL_BEGIN_DECLS
 
 /**
@@ -53,7 +55,7 @@ COGL_BEGIN_DECLS
  *
  * Fills a rectangle at the given coordinates with the current source material
  **/
-void
+COGL_API void
 cogl_rectangle (float x_1,
                 float y_1,
                 float x_2,
@@ -76,7 +78,7 @@ cogl_rectangle (float x_1,
  *
  * Since: 1.0
  */
-void
+COGL_API void
 cogl_rectangle_with_texture_coords (float  x1,
                                     float  y1,
                                     float  x2,
@@ -113,7 +115,7 @@ cogl_rectangle_with_texture_coords (float  x1,
  *
  * Since: 1.0
  */
-void
+COGL_API void
 cogl_rectangle_with_multitexture_coords (float        x1,
                                          float        y1,
                                          float        x2,
@@ -138,7 +140,7 @@ cogl_rectangle_with_multitexture_coords (float        x1,
  *
  * Since: 0.8.6
  */
-void
+COGL_API void
 cogl_rectangles_with_texture_coords (const float *verts,
                                      unsigned int n_rects);
 
@@ -159,7 +161,7 @@ cogl_rectangles_with_texture_coords (const float *verts,
  *
  * Since: 1.0
  */
-void
+COGL_API void
 cogl_rectangles (const float *verts,
                  unsigned int n_rects);
 
@@ -187,7 +189,7 @@ cogl_rectangles (const float *verts,
  *
  * Since: 1.0
  */
-void
+COGL_API void
 cogl_polygon (const CoglTextureVertex  *vertices,
               unsigned int              n_vertices,
               CoglBool                  use_color);
diff --git a/cogl/cogl-quaternion.h b/cogl/cogl-quaternion.h
index c70eccab..0e54060f 100644
--- a/cogl/cogl-quaternion.h
+++ b/cogl/cogl-quaternion.h
@@ -153,6 +153,7 @@ COGL_STRUCT_SIZE_ASSERT (CoglQuaternion, 32);
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_quaternion_get_gtype (void);
 #endif
 
@@ -176,7 +177,7 @@ GType cogl_quaternion_get_gtype (void);
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_quaternion_init (CoglQuaternion *quaternion,
                       float angle,
                       float x,
@@ -198,7 +199,7 @@ cogl_quaternion_init (CoglQuaternion *quaternion,
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_quaternion_init_from_angle_vector (CoglQuaternion *quaternion,
                                         float angle,
                                         const float *axis3f);
@@ -216,7 +217,7 @@ cogl_quaternion_init_from_angle_vector (CoglQuaternion *quaternion,
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_quaternion_init_identity (CoglQuaternion *quaternion);
 
 /**
@@ -229,7 +230,7 @@ cogl_quaternion_init_identity (CoglQuaternion *quaternion);
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_quaternion_init_from_array (CoglQuaternion *quaternion,
                                  const float *array);
 
@@ -242,7 +243,7 @@ cogl_quaternion_init_from_array (CoglQuaternion *quaternion,
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_quaternion_init_from_x_rotation (CoglQuaternion *quaternion,
                                       float angle);
 
@@ -254,7 +255,7 @@ cogl_quaternion_init_from_x_rotation (CoglQuaternion *quaternion,
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_quaternion_init_from_y_rotation (CoglQuaternion *quaternion,
                                       float angle);
 
@@ -266,7 +267,7 @@ cogl_quaternion_init_from_y_rotation (CoglQuaternion *quaternion,
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_quaternion_init_from_z_rotation (CoglQuaternion *quaternion,
                                       float angle);
 
@@ -277,7 +278,7 @@ cogl_quaternion_init_from_z_rotation (CoglQuaternion *quaternion,
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_quaternion_init_from_euler (CoglQuaternion *quaternion,
                                  const CoglEuler *euler);
 
@@ -288,7 +289,7 @@ cogl_quaternion_init_from_euler (CoglQuaternion *quaternion,
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_quaternion_init_from_quaternion (CoglQuaternion *quaternion,
                                       CoglQuaternion *src);
 
@@ -302,7 +303,7 @@ cogl_quaternion_init_from_quaternion (CoglQuaternion *quaternion,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_quaternion_init_from_matrix (CoglQuaternion *quaternion,
                                   const CoglMatrix *matrix);
 
@@ -322,7 +323,7 @@ cogl_quaternion_init_from_matrix (CoglQuaternion *quaternion,
  *
  * Since: 2.0
  */
-CoglBool
+COGL_API CoglBool
 cogl_quaternion_equal (const void *v1, const void *v2);
 
 /**
@@ -337,7 +338,7 @@ cogl_quaternion_equal (const void *v1, const void *v2);
  *
  * Since: 2.0
  */
-CoglQuaternion *
+COGL_API CoglQuaternion *
 cogl_quaternion_copy (const CoglQuaternion *src);
 
 /**
@@ -349,7 +350,7 @@ cogl_quaternion_copy (const CoglQuaternion *src);
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_quaternion_free (CoglQuaternion *quaternion);
 
 /**
@@ -359,7 +360,7 @@ cogl_quaternion_free (CoglQuaternion *quaternion);
  *
  * Since: 2.0
  */
-float
+COGL_API float
 cogl_quaternion_get_rotation_angle (const CoglQuaternion *quaternion);
 
 /**
@@ -369,7 +370,7 @@ cogl_quaternion_get_rotation_angle (const CoglQuaternion *quaternion);
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_quaternion_get_rotation_axis (const CoglQuaternion *quaternion,
                                    float *vector3);
 
@@ -380,7 +381,7 @@ cogl_quaternion_get_rotation_axis (const CoglQuaternion *quaternion,
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_quaternion_normalize (CoglQuaternion *quaternion);
 
 /**
@@ -390,7 +391,7 @@ cogl_quaternion_normalize (CoglQuaternion *quaternion);
  *
  * Since: 2.0
  */
-float
+COGL_API float
 cogl_quaternion_dot_product (const CoglQuaternion *a,
                              const CoglQuaternion *b);
 
@@ -401,7 +402,7 @@ cogl_quaternion_dot_product (const CoglQuaternion *a,
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_quaternion_invert (CoglQuaternion *quaternion);
 
 /**
@@ -421,7 +422,7 @@ cogl_quaternion_invert (CoglQuaternion *quaternion);
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_quaternion_multiply (CoglQuaternion *result,
                           const CoglQuaternion *left,
                           const CoglQuaternion *right);
@@ -434,7 +435,7 @@ cogl_quaternion_multiply (CoglQuaternion *result,
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_quaternion_pow (CoglQuaternion *quaternion, float exponent);
 
 /**
@@ -463,7 +464,7 @@ cogl_quaternion_pow (CoglQuaternion *quaternion, float exponent);
  * </listitem>
  * </itemizedlist>
  */
-void
+COGL_API void
 cogl_quaternion_slerp (CoglQuaternion *result,
                        const CoglQuaternion *a,
                        const CoglQuaternion *b,
@@ -504,7 +505,7 @@ cogl_quaternion_slerp (CoglQuaternion *result,
  * </listitem>
  * </itemizedlist>
  */
-void
+COGL_API void
 cogl_quaternion_nlerp (CoglQuaternion *result,
                        const CoglQuaternion *a,
                        const CoglQuaternion *b,
@@ -522,7 +523,7 @@ cogl_quaternion_nlerp (CoglQuaternion *result,
  *
  * Since: 2.0
  */
-void
+COGL_API void
 cogl_quaternion_squad (CoglQuaternion *result,
                        const CoglQuaternion *prev,
                        const CoglQuaternion *a,
@@ -543,7 +544,7 @@ cogl_quaternion_squad (CoglQuaternion *result,
  *
  * Since: 2.0
  */
-const CoglQuaternion *
+COGL_API const CoglQuaternion *
 cogl_get_static_identity_quaternion (void);
 
 /**
@@ -555,7 +556,7 @@ cogl_get_static_identity_quaternion (void);
  *
  * Since: 2.0
  */
-const CoglQuaternion *
+COGL_API const CoglQuaternion *
 cogl_get_static_zero_quaternion (void);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-renderer.h b/cogl/cogl-renderer.h
index 5db2173f..b0278e0d 100644
--- a/cogl/cogl-renderer.h
+++ b/cogl/cogl-renderer.h
@@ -84,7 +84,7 @@ COGL_BEGIN_DECLS
  */
 #define COGL_RENDERER_ERROR cogl_renderer_error_quark ()
 
-uint32_t
+COGL_API uint32_t
 cogl_renderer_error_quark (void);
 
 typedef struct _CoglRenderer CoglRenderer;
@@ -95,6 +95,7 @@ typedef struct _CoglRenderer CoglRenderer;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_renderer_get_gtype (void);
 #endif
 
@@ -108,7 +109,7 @@ GType cogl_renderer_get_gtype (void);
  * Since: 1.10
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_renderer (void *object);
 
 /**
@@ -152,7 +153,7 @@ cogl_is_renderer (void *object);
  * Since: 1.10
  * Stability: unstable
  */
-CoglRenderer *
+COGL_API CoglRenderer *
 cogl_renderer_new (void);
 
 /* optional configuration APIs */
@@ -206,7 +207,7 @@ typedef enum
  *
  * This may only be called on an un-connected #CoglRenderer.
  */
-void
+COGL_API void
 cogl_renderer_set_winsys_id (CoglRenderer *renderer,
                              CoglWinsysID winsys_id);
 
@@ -221,7 +222,7 @@ cogl_renderer_set_winsys_id (CoglRenderer *renderer,
  * Returns: The #CoglWinsysID corresponding to the chosen window
  *          system backend.
  */
-CoglWinsysID
+COGL_API CoglWinsysID
 cogl_renderer_get_winsys_id (CoglRenderer *renderer);
 
 /**
@@ -235,7 +236,7 @@ cogl_renderer_get_winsys_id (CoglRenderer *renderer);
  * Since: 1.8
  * Stability: Unstable
  */
-int
+COGL_API int
 cogl_renderer_get_n_fragment_texture_units (CoglRenderer *renderer);
 
 /**
@@ -252,7 +253,7 @@ cogl_renderer_get_n_fragment_texture_units (CoglRenderer *renderer);
  * Since: 1.10
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_renderer_check_onscreen_template (CoglRenderer *renderer,
                                        CoglOnscreenTemplate *onscreen_template,
                                        CoglError **error);
@@ -274,7 +275,7 @@ cogl_renderer_check_onscreen_template (CoglRenderer *renderer,
  * Since: 1.10
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_renderer_connect (CoglRenderer *renderer, CoglError **error);
 
 /**
@@ -325,7 +326,7 @@ typedef enum
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_renderer_add_constraint (CoglRenderer *renderer,
                               CoglRendererConstraint constraint);
 
@@ -342,7 +343,7 @@ cogl_renderer_add_constraint (CoglRenderer *renderer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_renderer_remove_constraint (CoglRenderer *renderer,
                                  CoglRendererConstraint constraint);
 
@@ -390,7 +391,7 @@ typedef enum
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_renderer_set_driver (CoglRenderer *renderer,
                           CoglDriver driver);
 
@@ -405,7 +406,7 @@ cogl_renderer_set_driver (CoglRenderer *renderer,
  * Since: 1.10
  * Stability: unstable
  */
-CoglDriver
+COGL_API CoglDriver
 cogl_renderer_get_driver (CoglRenderer *renderer);
 
 /**
@@ -437,7 +438,7 @@ typedef void (*CoglOutputCallback) (CoglOutput *output, void *user_data);
  * Since: 1.14
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_renderer_foreach_output (CoglRenderer *renderer,
                               CoglOutputCallback callback,
                               void *user_data);
diff --git a/cogl/cogl-sdl.h b/cogl/cogl-sdl.h
index 44d308db..13df734a 100644
--- a/cogl/cogl-sdl.h
+++ b/cogl/cogl-sdl.h
@@ -143,7 +143,7 @@ COGL_BEGIN_DECLS
  * Since: 2.0
  * Stability: unstable
  */
-CoglContext *
+COGL_API CoglContext *
 cogl_sdl_context_new (int type, CoglError **error);
 
 /**
@@ -167,7 +167,7 @@ cogl_sdl_context_new (int type, CoglError **error);
  * Since: 2.0
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_sdl_renderer_set_event_type (CoglRenderer *renderer, int type);
 
 /**
@@ -182,7 +182,7 @@ cogl_sdl_renderer_set_event_type (CoglRenderer *renderer, int type);
  * Since: 2.0
  * Stability: unstable
  */
-int
+COGL_API int
 cogl_sdl_renderer_get_event_type (CoglRenderer *renderer);
 
 /**
@@ -197,7 +197,7 @@ cogl_sdl_renderer_get_event_type (CoglRenderer *renderer);
  * Since: 2.0
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_sdl_handle_event (CoglContext *context, SDL_Event *event);
 
 /**
@@ -211,7 +211,7 @@ cogl_sdl_handle_event (CoglContext *context, SDL_Event *event);
  * Since: 2.0
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_sdl_idle (CoglContext *context);
 
 #if SDL_MAJOR_VERSION >= 2
@@ -225,7 +225,7 @@ cogl_sdl_idle (CoglContext *context);
  * Since: 2.0
  * Stability: unstable
  */
-SDL_Window *
+COGL_API SDL_Window *
 cogl_sdl_onscreen_get_window (CoglOnscreen *onscreen);
 
 #endif /* SDL_MAJOR_VERSION */
diff --git a/cogl/cogl-snippet.h b/cogl/cogl-snippet.h
index b8d9efde..50af9950 100644
--- a/cogl/cogl-snippet.h
+++ b/cogl/cogl-snippet.h
@@ -38,6 +38,8 @@
 #ifndef __COGL_SNIPPET_H__
 #define __COGL_SNIPPET_H__
 
+#include <cogl/cogl-defines.h>
+
 COGL_BEGIN_DECLS
 
 /**
@@ -347,6 +349,7 @@ typedef struct _CoglSnippet CoglSnippet;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_snippet_get_gtype (void);
 #endif
 
@@ -692,7 +695,7 @@ typedef enum {
  * Since: 1.10
  * Stability: Unstable
  */
-CoglSnippet *
+COGL_API CoglSnippet *
 cogl_snippet_new (CoglSnippetHook hook,
                   const char *declarations,
                   const char *post);
@@ -706,7 +709,7 @@ cogl_snippet_new (CoglSnippetHook hook,
  * Since: 1.10
  * Stability: Unstable
  */
-CoglSnippetHook
+COGL_API CoglSnippetHook
 cogl_snippet_get_hook (CoglSnippet *snippet);
 
 /**
@@ -721,7 +724,7 @@ cogl_snippet_get_hook (CoglSnippet *snippet);
  * Since: 1.10
  * Stability: Unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_snippet (void *object);
 
 /**
@@ -742,7 +745,7 @@ cogl_is_snippet (void *object);
  * Since: 1.10
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_snippet_set_declarations (CoglSnippet *snippet,
                                const char *declarations);
 
@@ -756,7 +759,7 @@ cogl_snippet_set_declarations (CoglSnippet *snippet,
  * Since: 1.10
  * Stability: Unstable
  */
-const char *
+COGL_API const char *
 cogl_snippet_get_declarations (CoglSnippet *snippet);
 
 /**
@@ -776,7 +779,7 @@ cogl_snippet_get_declarations (CoglSnippet *snippet);
  * Since: 1.10
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_snippet_set_pre (CoglSnippet *snippet,
                       const char *pre);
 
@@ -790,7 +793,7 @@ cogl_snippet_set_pre (CoglSnippet *snippet,
  * Since: 1.10
  * Stability: Unstable
  */
-const char *
+COGL_API const char *
 cogl_snippet_get_pre (CoglSnippet *snippet);
 
 /**
@@ -810,7 +813,7 @@ cogl_snippet_get_pre (CoglSnippet *snippet);
  * Since: 1.10
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_snippet_set_replace (CoglSnippet *snippet,
                           const char *replace);
 
@@ -824,7 +827,7 @@ cogl_snippet_set_replace (CoglSnippet *snippet,
  * Since: 1.10
  * Stability: Unstable
  */
-const char *
+COGL_API const char *
 cogl_snippet_get_replace (CoglSnippet *snippet);
 
 /**
@@ -844,7 +847,7 @@ cogl_snippet_get_replace (CoglSnippet *snippet);
  * Since: 1.10
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_snippet_set_post (CoglSnippet *snippet,
                        const char *post);
 
@@ -858,7 +861,7 @@ cogl_snippet_set_post (CoglSnippet *snippet,
  * Since: 1.10
  * Stability: Unstable
  */
-const char *
+COGL_API const char *
 cogl_snippet_get_post (CoglSnippet *snippet);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-sub-texture.h b/cogl/cogl-sub-texture.h
index ced26778..1d58c37f 100644
--- a/cogl/cogl-sub-texture.h
+++ b/cogl/cogl-sub-texture.h
@@ -36,6 +36,8 @@
 #ifndef __COGL_SUB_TEXTURE_H
 #define __COGL_SUB_TEXTURE_H
 
+#include <cogl/cogl-defines.h>
+
 COGL_BEGIN_DECLS
 
 /**
@@ -58,6 +60,7 @@ typedef struct _CoglSubTexture CoglSubTexture;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_sub_texture_get_gtype (void);
 #endif
 
@@ -92,7 +95,7 @@ GType cogl_sub_texture_get_gtype (void);
  * Since: 1.10
  * Stability: unstable
  */
-CoglSubTexture *
+COGL_API CoglSubTexture *
 cogl_sub_texture_new (CoglContext *ctx,
                       CoglTexture *parent_texture,
                       int sub_x,
@@ -113,7 +116,7 @@ cogl_sub_texture_new (CoglContext *ctx,
  * Since: 1.10
  * Stability: unstable
  */
-CoglTexture *
+COGL_API CoglTexture *
 cogl_sub_texture_get_parent (CoglSubTexture *sub_texture);
 
 /**
@@ -128,7 +131,7 @@ cogl_sub_texture_get_parent (CoglSubTexture *sub_texture);
  * Since: 1.10
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_sub_texture (void *object);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-swap-chain.h b/cogl/cogl-swap-chain.h
index d0488674..4fdb526b 100644
--- a/cogl/cogl-swap-chain.h
+++ b/cogl/cogl-swap-chain.h
@@ -49,21 +49,22 @@ typedef struct _CoglSwapChain CoglSwapChain;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_swap_chain_get_gtype (void);
 #endif
 
-CoglSwapChain *
+COGL_API CoglSwapChain *
 cogl_swap_chain_new (void);
 
-void
+COGL_API void
 cogl_swap_chain_set_has_alpha (CoglSwapChain *swap_chain,
                                CoglBool has_alpha);
 
-void
+COGL_API void
 cogl_swap_chain_set_length (CoglSwapChain *swap_chain,
                             int length);
 
-CoglBool
+COGL_API CoglBool
 cogl_is_swap_chain (void *object);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-texture-2d-gl.h b/cogl/cogl-texture-2d-gl.h
index e7b22df9..8005a4f3 100644
--- a/cogl/cogl-texture-2d-gl.h
+++ b/cogl/cogl-texture-2d-gl.h
@@ -66,7 +66,7 @@ COGL_BEGIN_DECLS
  *
  * Since: 2.0
  */
-CoglTexture2D *
+COGL_API CoglTexture2D *
 cogl_texture_2d_gl_new_from_foreign (CoglContext *ctx,
                                      unsigned int gl_handle,
                                      int width,
diff --git a/cogl/cogl-texture-2d-sliced.h b/cogl/cogl-texture-2d-sliced.h
index ec959a91..d9a44d54 100644
--- a/cogl/cogl-texture-2d-sliced.h
+++ b/cogl/cogl-texture-2d-sliced.h
@@ -76,6 +76,7 @@ typedef struct _CoglTexture2DSliced CoglTexture2DSliced;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_texture_2d_sliced_get_gtype (void);
 #endif
 
@@ -120,7 +121,7 @@ GType cogl_texture_2d_sliced_get_gtype (void);
  * Since: 1.10
  * Stability: unstable
  */
-CoglTexture2DSliced *
+COGL_API CoglTexture2DSliced *
 cogl_texture_2d_sliced_new_with_size (CoglContext *ctx,
                                       int width,
                                       int height,
@@ -168,7 +169,7 @@ cogl_texture_2d_sliced_new_with_size (CoglContext *ctx,
  *
  * Since: 1.16
  */
-CoglTexture2DSliced *
+COGL_API CoglTexture2DSliced *
 cogl_texture_2d_sliced_new_from_file (CoglContext *ctx,
                                       const char *filename,
                                       int max_waste,
@@ -229,7 +230,7 @@ cogl_texture_2d_sliced_new_from_file (CoglContext *ctx,
  *
  * Since: 1.16
  */
-CoglTexture2DSliced *
+COGL_API CoglTexture2DSliced *
 cogl_texture_2d_sliced_new_from_data (CoglContext *ctx,
                                       int width,
                                       int height,
@@ -280,7 +281,7 @@ cogl_texture_2d_sliced_new_from_data (CoglContext *ctx,
  *
  * Since: 1.16
  */
-CoglTexture2DSliced *
+COGL_API CoglTexture2DSliced *
 cogl_texture_2d_sliced_new_from_bitmap (CoglBitmap *bmp,
                                         int max_waste);
 
@@ -295,7 +296,7 @@ cogl_texture_2d_sliced_new_from_bitmap (CoglBitmap *bmp,
  * Since: 1.10
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_texture_2d_sliced (void *object);
 
 #endif /* __COGL_TEXURE_2D_SLICED_H */
diff --git a/cogl/cogl-texture-2d.h b/cogl/cogl-texture-2d.h
index c806ced5..b06c17b4 100644
--- a/cogl/cogl-texture-2d.h
+++ b/cogl/cogl-texture-2d.h
@@ -67,6 +67,7 @@ typedef struct _CoglTexture2D CoglTexture2D;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_texture_2d_get_gtype (void);
 #endif
 
@@ -80,7 +81,7 @@ GType cogl_texture_2d_get_gtype (void);
  * Return value: %TRUE if the object references a #CoglTexture2D,
  *   %FALSE otherwise
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_texture_2d (void *object);
 
 /**
@@ -112,7 +113,7 @@ cogl_is_texture_2d (void *object);
  *
  * Since: 2.0
  */
-CoglTexture2D *
+COGL_API CoglTexture2D *
 cogl_texture_2d_new_with_size (CoglContext *ctx,
                                int width,
                                int height);
@@ -146,7 +147,7 @@ cogl_texture_2d_new_with_size (CoglContext *ctx,
  *
  * Since: 1.16
  */
-CoglTexture2D *
+COGL_API CoglTexture2D *
 cogl_texture_2d_new_from_file (CoglContext *ctx,
                                const char *filename,
                                CoglError **error);
@@ -189,7 +190,7 @@ cogl_texture_2d_new_from_file (CoglContext *ctx,
  *
  * Since: 2.0
  */
-CoglTexture2D *
+COGL_API CoglTexture2D *
 cogl_texture_2d_new_from_data (CoglContext *ctx,
                                int width,
                                int height,
@@ -226,7 +227,7 @@ cogl_texture_2d_new_from_data (CoglContext *ctx,
  * Since: 2.0
  * Stability: unstable
  */
-CoglTexture2D *
+COGL_API CoglTexture2D *
 cogl_texture_2d_new_from_bitmap (CoglBitmap *bitmap);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-texture-3d.h b/cogl/cogl-texture-3d.h
index b3b038ae..2901f281 100644
--- a/cogl/cogl-texture-3d.h
+++ b/cogl/cogl-texture-3d.h
@@ -36,6 +36,8 @@
 #ifndef __COGL_TEXTURE_3D_H
 #define __COGL_TEXTURE_3D_H
 
+#include <cogl/cogl-defines.h>
+
 COGL_BEGIN_DECLS
 
 /**
@@ -58,6 +60,7 @@ typedef struct _CoglTexture3D CoglTexture3D;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_texture_3d_get_gtype (void);
 #endif
 
@@ -92,7 +95,7 @@ GType cogl_texture_3d_get_gtype (void);
  * Since: 1.10
  * Stability: Unstable
  */
-CoglTexture3D *
+COGL_API CoglTexture3D *
 cogl_texture_3d_new_with_size (CoglContext *context,
                                int width,
                                int height,
@@ -134,7 +137,7 @@ cogl_texture_3d_new_with_size (CoglContext *context,
  * Since: 1.10
  * Stability: Unstable
  */
-CoglTexture3D *
+COGL_API CoglTexture3D *
 cogl_texture_3d_new_from_data (CoglContext *context,
                                int width,
                                int height,
@@ -179,7 +182,7 @@ cogl_texture_3d_new_from_data (CoglContext *context,
  * Since: 2.0
  * Stability: unstable
  */
-CoglTexture3D *
+COGL_API CoglTexture3D *
 cogl_texture_3d_new_from_bitmap (CoglBitmap *bitmap,
                                  int height,
                                  int depth);
@@ -196,7 +199,7 @@ cogl_texture_3d_new_from_bitmap (CoglBitmap *bitmap,
  * Since: 1.4
  * Stability: Unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_texture_3d (void *object);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-texture-rectangle.h b/cogl/cogl-texture-rectangle.h
index 76196860..398580d1 100644
--- a/cogl/cogl-texture-rectangle.h
+++ b/cogl/cogl-texture-rectangle.h
@@ -75,6 +75,7 @@ typedef struct _CoglTextureRectangle CoglTextureRectangle;
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_texture_rectangle_get_gtype (void);
 #endif
 
@@ -88,7 +89,7 @@ GType cogl_texture_rectangle_get_gtype (void);
  * Return value: %TRUE if the object references a
  *               #CoglTextureRectangle, %FALSE otherwise.
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_texture_rectangle (void *object);
 
 /**
@@ -128,7 +129,7 @@ cogl_is_texture_rectangle (void *object);
  * Since: 1.10
  * Stability: unstable
  */
-CoglTextureRectangle *
+COGL_API CoglTextureRectangle *
 cogl_texture_rectangle_new_with_size (CoglContext *ctx,
                                       int width,
                                       int height);
@@ -168,7 +169,7 @@ cogl_texture_rectangle_new_with_size (CoglContext *ctx,
  * Since: 2.0
  * Stability: unstable
  */
-CoglTextureRectangle *
+COGL_API CoglTextureRectangle *
 cogl_texture_rectangle_new_from_bitmap (CoglBitmap *bitmap);
 
 /**
@@ -206,7 +207,7 @@ cogl_texture_rectangle_new_from_bitmap (CoglBitmap *bitmap);
  *
  * Return value: (transfer full): A new #CoglTextureRectangle texture
  */
-CoglTextureRectangle *
+COGL_API CoglTextureRectangle *
 cogl_texture_rectangle_new_from_foreign (CoglContext *ctx,
                                          unsigned int gl_handle,
                                          int width,
diff --git a/cogl/cogl-texture.h b/cogl/cogl-texture.h
index 27188309..46cd2472 100644
--- a/cogl/cogl-texture.h
+++ b/cogl/cogl-texture.h
@@ -79,6 +79,7 @@ COGL_BEGIN_DECLS
  *
  * Returns: a #GType that can be used with the GLib type system.
  */
+COGL_API
 GType cogl_texture_get_gtype (void);
 #endif
 
@@ -129,6 +130,7 @@ typedef enum {
   COGL_TEXTURE_TYPE_RECTANGLE
 } CoglTextureType;
 
+COGL_API 
 uint32_t cogl_texture_error_quark (void);
 
 /**
@@ -140,7 +142,7 @@ uint32_t cogl_texture_error_quark (void);
  * Return value: %TRUE if the @object references a texture, and
  *   %FALSE otherwise
  */
-CoglBool
+COGL_API CoglBool
 cogl_is_texture (void *object);
 
 /**
@@ -192,7 +194,7 @@ typedef enum _CoglTextureComponents
  *
  * Since: 1.18
  */
-void
+COGL_API void
 cogl_texture_set_components (CoglTexture *texture,
                              CoglTextureComponents components);
 
@@ -210,7 +212,7 @@ cogl_texture_set_components (CoglTexture *texture,
  *
  * Since: 1.18
  */
-CoglTextureComponents
+COGL_API CoglTextureComponents
 cogl_texture_get_components (CoglTexture *texture);
 
 /**
@@ -244,7 +246,7 @@ cogl_texture_get_components (CoglTexture *texture);
  *
  * Since: 1.18
  */
-void
+COGL_API void
 cogl_texture_set_premultiplied (CoglTexture *texture,
                                 CoglBool premultiplied);
 
@@ -263,7 +265,7 @@ cogl_texture_set_premultiplied (CoglTexture *texture,
  *               value or %FALSE if not.
  * Since: 1.18
  */
-CoglBool
+COGL_API CoglBool
 cogl_texture_get_premultiplied (CoglTexture *texture);
 
 /**
@@ -274,7 +276,7 @@ cogl_texture_get_premultiplied (CoglTexture *texture);
  *
  * Return value: the width of the GPU side texture in pixels
  */
-unsigned int
+COGL_API unsigned int
 cogl_texture_get_width (CoglTexture *texture);
 
 /**
@@ -285,7 +287,7 @@ cogl_texture_get_width (CoglTexture *texture);
  *
  * Return value: the height of the GPU side texture in pixels
  */
-unsigned int
+COGL_API unsigned int
 cogl_texture_get_height (CoglTexture *texture);
 
 /**
@@ -297,7 +299,7 @@ cogl_texture_get_height (CoglTexture *texture);
  *
  * Return value: the maximum waste
  */
-int
+COGL_API int
 cogl_texture_get_max_waste (CoglTexture *texture);
 
 /**
@@ -310,7 +312,7 @@ cogl_texture_get_max_waste (CoglTexture *texture);
  * Return value: %TRUE if the texture is sliced, %FALSE if the texture
  *   is stored as a single GPU texture
  */
-CoglBool
+COGL_API CoglBool
 cogl_texture_is_sliced (CoglTexture *texture);
 
 /**
@@ -329,7 +331,7 @@ cogl_texture_is_sliced (CoglTexture *texture);
  * Return value: %TRUE if the handle was successfully retrieved, %FALSE
  *   if the handle was invalid
  */
-CoglBool
+COGL_API CoglBool
 cogl_texture_get_gl_texture (CoglTexture *texture,
                              unsigned int *out_gl_handle,
                              unsigned int *out_gl_target);
@@ -353,7 +355,7 @@ cogl_texture_get_gl_texture (CoglTexture *texture,
  *
  * Return value: the size of the texture data in bytes
  */
-int
+COGL_API int
 cogl_texture_get_data (CoglTexture *texture,
                        CoglPixelFormat format,
                        unsigned int rowstride,
@@ -385,7 +387,7 @@ cogl_texture_get_data (CoglTexture *texture,
  * Return value: %TRUE if the subregion upload was successful, and
  *   %FALSE otherwise
  */
-CoglBool
+COGL_API CoglBool
 cogl_texture_set_region (CoglTexture *texture,
                          int src_x,
                          int src_y,
@@ -453,7 +455,7 @@ cogl_texture_set_region (CoglTexture *texture,
  * Return value: %TRUE if the data upload was successful, and
  *               %FALSE otherwise
  */
-CoglBool
+COGL_API CoglBool
 cogl_texture_set_data (CoglTexture *texture,
                        CoglPixelFormat format,
                        int rowstride,
@@ -486,7 +488,7 @@ cogl_texture_set_data (CoglTexture *texture,
  * Since: 1.8
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_texture_set_region_from_bitmap (CoglTexture *texture,
                                      int src_x,
                                      int src_y,
@@ -515,7 +517,7 @@ cogl_texture_set_region_from_bitmap (CoglTexture *texture,
  *               otherwise %FALSE and @error will be updated if it
  *               wasn't %NULL.
  */
-CoglBool
+COGL_API CoglBool
 cogl_texture_allocate (CoglTexture *texture,
                        CoglError **error);
 
diff --git a/cogl/cogl-types.h b/cogl/cogl-types.h
index 6accf8d8..958d41c2 100644
--- a/cogl/cogl-types.h
+++ b/cogl/cogl-types.h
@@ -153,7 +153,7 @@ typedef void * CoglHandle;
 #ifdef COGL_HAS_GTYPE_SUPPORT
 
 #define COGL_TYPE_HANDLE        (cogl_handle_get_type ())
-GType
+COGL_API GType
 cogl_handle_get_type (void) G_GNUC_CONST;
 
 #endif /* COGL_HAS_GTYPE_SUPPORT */
@@ -166,7 +166,7 @@ cogl_handle_get_type (void) G_GNUC_CONST;
  *
  * Return value: (transfer none): the handle, with its reference count increased
  */
-CoglHandle
+COGL_API CoglHandle
 cogl_handle_ref (CoglHandle handle);
 
 /**
@@ -176,7 +176,7 @@ cogl_handle_ref (CoglHandle handle);
  * Drecreases the reference count of @handle by 1; if the reference
  * count reaches 0, the resources allocated by @handle will be freed
  */
-void
+COGL_API void
 cogl_handle_unref (CoglHandle handle);
 
 /**
@@ -208,7 +208,7 @@ typedef struct _CoglEuler CoglEuler;
 typedef int32_t CoglFixed;
 
 #define COGL_TYPE_FIXED         (cogl_fixed_get_type ())
-GType
+COGL_API GType
 cogl_fixed_get_type (void) G_GNUC_CONST;
 
 /**
@@ -624,7 +624,7 @@ typedef enum { /*< prefix=COGL_BLEND_STRING_ERROR >*/
   COGL_BLEND_STRING_ERROR_GPU_UNSUPPORTED_ERROR
 } CoglBlendStringError;
 
-uint32_t
+COGL_API uint32_t
 cogl_blend_string_error_quark (void);
 
 #define COGL_SYSTEM_ERROR (_cogl_system_error_quark ())
@@ -664,7 +664,7 @@ typedef enum { /*< prefix=COGL_ERROR >*/
   COGL_SYSTEM_ERROR_NO_MEMORY
 } CoglSystemError;
 
-uint32_t
+COGL_API uint32_t
 _cogl_system_error_quark (void);
 
 /**
diff --git a/cogl/cogl-vector.h b/cogl/cogl-vector.h
index 08cf017f..0b123125 100644
--- a/cogl/cogl-vector.h
+++ b/cogl/cogl-vector.h
@@ -36,6 +36,8 @@
 #ifndef __COGL_VECTOR_H
 #define __COGL_VECTOR_H
 
+#include <cogl/cogl-defines.h>
+
 COGL_BEGIN_DECLS
 
 /**
@@ -61,7 +63,7 @@ COGL_BEGIN_DECLS
  * Since: 1.4
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_vector3_init (float *vector, float x, float y, float z);
 
 /**
@@ -74,7 +76,7 @@ cogl_vector3_init (float *vector, float x, float y, float z);
  * Since: 1.4
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_vector3_init_zero (float *vector);
 
 /**
@@ -96,7 +98,7 @@ cogl_vector3_init_zero (float *vector);
  * Since: 1.4
  * Stability: Unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_vector3_equal (const void *v1, const void *v2);
 
 /**
@@ -120,7 +122,7 @@ cogl_vector3_equal (const void *v1, const void *v2);
  * Since: 1.4
  * Stability: Unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_vector3_equal_with_epsilon (const float *vector0,
                                  const float *vector1,
                                  float epsilon);
@@ -139,7 +141,7 @@ cogl_vector3_equal_with_epsilon (const float *vector0,
  * Since: 1.4
  * Stability: Unstable
  */
-float *
+COGL_API float *
 cogl_vector3_copy (const float *vector);
 
 /**
@@ -152,7 +154,7 @@ cogl_vector3_copy (const float *vector);
  * Since: 1.4
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_vector3_free (float *vector);
 
 /**
@@ -164,7 +166,7 @@ cogl_vector3_free (float *vector);
  * Since: 1.4
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_vector3_invert (float *vector);
 
 /**
@@ -179,7 +181,7 @@ cogl_vector3_invert (float *vector);
  * Since: 1.4
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_vector3_add (float *result,
                   const float *a,
                   const float *b);
@@ -196,7 +198,7 @@ cogl_vector3_add (float *result,
  * Since: 1.4
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_vector3_subtract (float *result,
                        const float *a,
                        const float *b);
@@ -211,7 +213,7 @@ cogl_vector3_subtract (float *result,
  * Since: 1.4
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_vector3_multiply_scalar (float *vector,
                               float scalar);
 
@@ -225,7 +227,7 @@ cogl_vector3_multiply_scalar (float *vector,
  * Since: 1.4
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_vector3_divide_scalar (float *vector,
                             float scalar);
 
@@ -243,7 +245,7 @@ cogl_vector3_divide_scalar (float *vector,
  * Since: 1.4
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_vector3_normalize (float *vector);
 
 /**
@@ -257,7 +259,7 @@ cogl_vector3_normalize (float *vector);
  * Since: 1.4
  * Stability: Unstable
  */
-float
+COGL_API float
 cogl_vector3_magnitude (const float *vector);
 
 /**
@@ -287,7 +289,7 @@ cogl_vector3_magnitude (const float *vector);
  * Since: 1.4
  * Stability: Unstable
  */
-void
+COGL_API void
 cogl_vector3_cross_product (float *result,
                             const float *u,
                             const float *v);
@@ -330,7 +332,7 @@ cogl_vector3_cross_product (float *result,
  * Since: 1.4
  * Stability: Unstable
  */
-float
+COGL_API float
 cogl_vector3_dot_product (const float *a, const float *b);
 
 /**
@@ -347,7 +349,7 @@ cogl_vector3_dot_product (const float *a, const float *b);
  * Since: 1.4
  * Stability: Unstable
  */
-float
+COGL_API float
 cogl_vector3_distance (const float *a, const float *b);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-wayland-renderer.h b/cogl/cogl-wayland-renderer.h
index ea0a20b4..4ef6d34f 100644
--- a/cogl/cogl-wayland-renderer.h
+++ b/cogl/cogl-wayland-renderer.h
@@ -52,7 +52,7 @@ COGL_BEGIN_DECLS
  * Since: 1.8
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_wayland_renderer_set_foreign_display (CoglRenderer *renderer,
                                            struct wl_display *display);
 
@@ -74,7 +74,7 @@ cogl_wayland_renderer_set_foreign_display (CoglRenderer *renderer,
  * Since: 1.16
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_wayland_renderer_set_event_dispatch_enabled (CoglRenderer *renderer,
                                                   CoglBool enable);
 
@@ -97,7 +97,7 @@ cogl_wayland_renderer_set_event_dispatch_enabled (CoglRenderer *renderer,
  * Since: 1.8
  * Stability: unstable
  */
-struct wl_display *
+COGL_API struct wl_display *
 cogl_wayland_renderer_get_display (CoglRenderer *renderer);
 
 COGL_END_DECLS
diff --git a/cogl/cogl-wayland-server.h b/cogl/cogl-wayland-server.h
index 9c1f35fa..c2754b60 100644
--- a/cogl/cogl-wayland-server.h
+++ b/cogl/cogl-wayland-server.h
@@ -66,7 +66,7 @@ COGL_BEGIN_DECLS
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_wayland_display_set_compositor_display (CoglDisplay *display,
                                           struct wl_display *wayland_display);
 
@@ -96,7 +96,7 @@ cogl_wayland_display_set_compositor_display (CoglDisplay *display,
  * Since: 1.10
  * Stability: unstable
  */
-CoglTexture2D *
+COGL_API CoglTexture2D *
 cogl_wayland_texture_2d_new_from_buffer (CoglContext *ctx,
                                          struct wl_resource *buffer,
                                          CoglError **error);
@@ -132,7 +132,7 @@ cogl_wayland_texture_2d_new_from_buffer (CoglContext *ctx,
  * Since: 1.18
  * Stability: unstable
  */
-CoglBool
+COGL_API CoglBool
 cogl_wayland_texture_set_region_from_shm_buffer (CoglTexture *texture,
                                                  int src_x,
                                                  int src_y,
diff --git a/cogl/cogl-win32-renderer.h b/cogl/cogl-win32-renderer.h
index 2947ffa1..254b98df 100644
--- a/cogl/cogl-win32-renderer.h
+++ b/cogl/cogl-win32-renderer.h
@@ -53,7 +53,7 @@ COGL_BEGIN_DECLS
  * either not interested in the event, or has used the event to update
  * internal state without taking any exclusive action.
  */
-CoglFilterReturn
+COGL_API CoglFilterReturn
 cogl_win32_renderer_handle_event (CoglRenderer *renderer,
                                   MSG *message);
 
@@ -80,7 +80,7 @@ typedef CoglFilterReturn (* CoglWin32FilterFunc) (MSG *message,
  * function can stop further processing of the event by return
  * %COGL_FILTER_REMOVE.
  */
-void
+COGL_API void
 cogl_win32_renderer_add_filter (CoglRenderer *renderer,
                                 CoglWin32FilterFunc func,
                                 void *data);
@@ -94,7 +94,7 @@ cogl_win32_renderer_add_filter (CoglRenderer *renderer,
  * Removes a callback that was previously added with
  * cogl_win32_renderer_add_filter().
  */
-void
+COGL_API void
 cogl_win32_renderer_remove_filter (CoglRenderer *renderer,
                                    CoglWin32FilterFunc func,
                                    void *data);
@@ -114,7 +114,7 @@ cogl_win32_renderer_remove_filter (CoglRenderer *renderer,
  * Since: 1.16
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_win32_renderer_set_event_retrieval_enabled (CoglRenderer *renderer,
                                                  CoglBool enable);
 
diff --git a/cogl/cogl-xlib-renderer.h b/cogl/cogl-xlib-renderer.h
index fdce06b0..a233425f 100644
--- a/cogl/cogl-xlib-renderer.h
+++ b/cogl/cogl-xlib-renderer.h
@@ -72,7 +72,7 @@ COGL_BEGIN_DECLS
  * either not interested in the event, or has used the event to update
  * internal state without taking any exclusive action.
  */
-CoglFilterReturn
+COGL_API CoglFilterReturn
 cogl_xlib_renderer_handle_event (CoglRenderer *renderer,
                                  XEvent *event);
 
@@ -99,7 +99,7 @@ typedef CoglFilterReturn (* CoglXlibFilterFunc) (XEvent *event,
  * function can stop further processing of the event by return
  * %COGL_FILTER_REMOVE.
  */
-void
+COGL_API void
 cogl_xlib_renderer_add_filter (CoglRenderer *renderer,
                                CoglXlibFilterFunc func,
                                void *data);
@@ -113,7 +113,7 @@ cogl_xlib_renderer_add_filter (CoglRenderer *renderer,
  * Removes a callback that was previously added with
  * cogl_xlib_renderer_add_filter().
  */
-void
+COGL_API void
 cogl_xlib_renderer_remove_filter (CoglRenderer *renderer,
                                   CoglXlibFilterFunc func,
                                   void *data);
@@ -126,7 +126,7 @@ cogl_xlib_renderer_remove_filter (CoglRenderer *renderer,
  * winsys backend. The display needs to be set with
  * cogl_xlib_renderer_set_foreign_display() before this function is called.
  */
-Display *
+COGL_API Display *
 cogl_xlib_renderer_get_foreign_display (CoglRenderer *renderer);
 
 /*
@@ -142,7 +142,7 @@ cogl_xlib_renderer_get_foreign_display (CoglRenderer *renderer);
  * application should also use cogl_xlib_renderer_handle_event() if it
  * uses this function.
  */
-void
+COGL_API void
 cogl_xlib_renderer_set_foreign_display (CoglRenderer *renderer,
                                         Display *display);
 
@@ -163,14 +163,14 @@ cogl_xlib_renderer_set_foreign_display (CoglRenderer *renderer,
  * Since: 1.10
  * Stability: unstable
  */
-void
+COGL_API void
 cogl_xlib_renderer_set_event_retrieval_enabled (CoglRenderer *renderer,
                                                 CoglBool enable);
 
-Display *
+COGL_API Display *
 cogl_xlib_renderer_get_display (CoglRenderer *renderer);
 
-XVisualInfo *
+COGL_API XVisualInfo *
 cogl_xlib_renderer_get_visual_info (CoglRenderer *renderer);
 
 COGL_END_DECLS
diff --git a/cogl/cogl1-context.h b/cogl/cogl1-context.h
index 92ac7d08..b348226c 100644
--- a/cogl/cogl1-context.h
+++ b/cogl/cogl1-context.h
@@ -106,7 +106,7 @@ cogl_features_available (CoglFeatureFlags features);
  * Return value: a pointer to the requested function or %NULL if the
  *   function is not available.
  */
-CoglFuncPtr
+COGL_API CoglFuncPtr
 cogl_get_proc_address (const char *name);
 
 /**
@@ -763,7 +763,7 @@ cogl_set_source_texture (CoglTexture *texture);
  *
  * Since: 1.0
  */
-void
+COGL_API void
 cogl_flush (void);
 
 /**


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