cogl/cogl-gtype-private.h: Fix Build on non-GCC

Commit 1b2dd815 (Registers gtypes for all public objects and structs)
introduced GCCism's in its use of varargs, which broke the build of Cogl
on other non-GCC compilers, such as Visual Studio.

Define the COGL_GTYPE_DEFINE_BASE_CLASS and COGL_GTYPE_DEFINE_CLASS macros
using ISO-style varargs so that the build of Cogl can be fixed on non-GCC
compilers.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
Chun-wei Fan 2014-04-18 10:33:15 +08:00 committed by Neil Roberts
parent 2e0989bbaf
commit 93c90f1e05

View File

@ -133,9 +133,9 @@ cogl_##name##_get_gtype (void) \
return type_id__volatile; \ return type_id__volatile; \
} }
#define COGL_GTYPE_DEFINE_BASE_CLASS(Name,name,interfaces...) \ #define COGL_GTYPE_DEFINE_BASE_CLASS(Name,name,...) \
_COGL_GTYPE_DEFINE_BASE_CLASS_BEGIN(Name,name) \ _COGL_GTYPE_DEFINE_BASE_CLASS_BEGIN(Name,name) \
{interfaces;} \ {__VA_ARGS__;} \
_COGL_GTYPE_DEFINE_BASE_CLASS_END() _COGL_GTYPE_DEFINE_BASE_CLASS_END()
#define _COGL_GTYPE_DEFINE_INTERFACE_EXTENDED_BEGIN(Name,name) \ #define _COGL_GTYPE_DEFINE_INTERFACE_EXTENDED_BEGIN(Name,name) \
@ -230,7 +230,7 @@ cogl_##name##_get_gtype (void) \
} /* closes name##_get_type() */ } /* closes name##_get_type() */
#define COGL_GTYPE_DEFINE_CLASS(Name,name,interfaces...) \ #define COGL_GTYPE_DEFINE_CLASS(Name,name,...) \
typedef struct _Cogl##Name##Class Cogl##Name##Class; \ typedef struct _Cogl##Name##Class Cogl##Name##Class; \
struct _Cogl##Name##Class { \ struct _Cogl##Name##Class { \
CoglObjectClass parent_class; \ CoglObjectClass parent_class; \
@ -239,7 +239,7 @@ cogl_##name##_get_gtype (void) \
cogl_##name, \ cogl_##name, \
cogl_object_get_gtype(), \ cogl_object_get_gtype(), \
0) \ 0) \
{interfaces;} \ {__VA_ARGS__;} \
_COGL_GTYPE_DEFINE_TYPE_EXTENDED_END() \ _COGL_GTYPE_DEFINE_TYPE_EXTENDED_END() \
static void \ static void \
cogl_##name##_init (Cogl##Name *instance) \ cogl_##name##_init (Cogl##Name *instance) \