diff --git a/gst/gst.h b/gst/gst.h index a2d98c6a7c..98e27aac25 100644 --- a/gst/gst.h +++ b/gst/gst.h @@ -49,12 +49,20 @@ #include +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + /* initialize GST */ void gst_init(int *argc,char **argv[]); void gst_main (void); void gst_main_quit (void); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + #include #endif /* __GST_H__ */ diff --git a/gst/gstcaps.h b/gst/gstcaps.h index 0150b0ffd9..99634d462b 100644 --- a/gst/gstcaps.h +++ b/gst/gstcaps.h @@ -37,7 +37,11 @@ typedef struct _GstCaps GstCaps; typedef gpointer GstCapsFactoryEntry; +#ifdef __cplusplus +typedef GstCapsFactoryEntry * GstCapsFactory; +#else // C++ was unable to compile with this typedef GstCapsFactoryEntry GstCapsFactory[]; +#endif struct _GstCaps { gchar *name; /* the name of this caps */ @@ -62,7 +66,7 @@ const gchar* gst_caps_get_mime (GstCaps *caps); void gst_caps_set_mime (GstCaps *caps, const gchar *mime); guint16 gst_caps_get_type_id (GstCaps *caps); -void gst_caps_set_type_id (GstCaps *caps, guint16 typeid); +void gst_caps_set_type_id (GstCaps *caps, guint16 /*typeid*/); GstCaps* gst_caps_set_props (GstCaps *caps, GstProps *props); GstProps* gst_caps_get_props (GstCaps *caps); diff --git a/gst/gstinfo.h b/gst/gstinfo.h index cb11ca1ead..507b36b218 100644 --- a/gst/gstinfo.h +++ b/gst/gstinfo.h @@ -139,7 +139,7 @@ _gst_debug_register_funcptr (void *ptr, gchar *ptrname) static inline gchar * _gst_debug_nameof_funcptr (void *ptr) { - gchar *ptrname = __gst_function_pointers ? g_hash_table_lookup(__gst_function_pointers,ptr) : NULL; + gchar *ptrname = (gchar*)( __gst_function_pointers ? g_hash_table_lookup(__gst_function_pointers,ptr) : NULL ); // FIXME this must go away, it's a major leak if (!ptrname) return g_strdup_printf("%p",ptr); else return ptrname; diff --git a/gst/gstutils.h b/gst/gstutils.h index a6465fee08..3f15ed2c9d 100644 --- a/gst/gstutils.h +++ b/gst/gstutils.h @@ -26,6 +26,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + gint gst_util_get_int_arg (GtkObject *object, guchar *argname); gboolean gst_util_get_bool_arg (GtkObject *object, guchar *argname); glong gst_util_get_long_arg (GtkObject *object, guchar *argname); @@ -37,4 +41,8 @@ GtkWidget* gst_util_get_widget_arg (GtkObject *object, guchar *argname); void gst_util_dump_mem (guchar *mem, guint size); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + #endif /* __GST_UTILS_H__ */