diff --git a/configure.ac b/configure.ac index cf2b91edad..9e9c91b209 100644 --- a/configure.ac +++ b/configure.ac @@ -3,13 +3,7 @@ AC_CANONICAL_TARGET([]) dnl when going to/from release please set the nano (fourth number) right ! dnl releases only do Wall, cvs and prerelease does Werror too -dnl only use Wall or Werror if compiler is gcc. -if test "x$GCC" = "xyes"; then - AS_VERSION(gstreamer, GST_VERSION, 0, 4, 2, 1, GST_ERROR="-Wall", GST_ERROR="-Wall -Werror") -else - AS_VERSION(gstreamer, GST_VERSION, 0, 4, 2, 1, GST_ERROR="", GST_ERROR="") -fi - +AS_VERSION(gstreamer, GST_VERSION, 0, 4, 2, 1, GST_ERROR="-Wall", GST_ERROR="-Wall -Werror") dnl AM_MAINTAINER_MODE only provides the option to configure to enable it AM_MAINTAINER_MODE AM_INIT_AUTOMAKE($PACKAGE,$VERSION) @@ -179,39 +173,6 @@ main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0 ]) fi -dnl -dnl Check for functions -dnl -AC_MSG_CHECKING(whether $GCC implements __func__) -AC_CACHE_VAL(have_func, -[AC_TRY_LINK([#include ],[printf("%s", __func__);], -have_func=yes, -have_func=no)]) -AC_MSG_RESULT($have_func) -if test "$have_func" = yes; then - AC_DEFINE(HAVE_FUNC,1,[defined if gcc have HAVE_FUNC)]) -else - AC_MSG_CHECKING(whether $GCC implements __PRETTY_FUNCTION__) - AC_CACHE_VAL(have_pretty_function, - [AC_TRY_LINK([#include ],[printf("%s", __PRETTY_FUNCTION__);], - have_pretty_function=yes, - have_pretty_function=no)]) - AC_MSG_RESULT($have_pretty_function) - if test "$have_pretty_function" = yes; then - AC_DEFINE(HAVE_PRETTY_FUNCTION,1,[defined if gcc have HAVE_PRETTY_FUNCTION)]) - else - AC_MSG_CHECKING(whether $GCC implements __FUNCTION__) - AC_CACHE_VAL(have_function, - [AC_TRY_LINK([#include ],[printf("%s", __FUNCTION__);], - have_function=yes, - have_function=no)]) - AC_MSG_RESULT($have_function) - if test "$have_function" = yes; then - AC_DEFINE(HAVE_FUNCTION,1,[defined if gcc have HAVE_FUNCTION)]) - fi - fi -fi - dnl ###################################################################### dnl # Check command line parameters, and set shell variables accordingly # dnl ###################################################################### diff --git a/gst/gstcaps.h b/gst/gstcaps.h index 6dae7c24c6..1d259cb7dc 100644 --- a/gst/gstcaps.h +++ b/gst/gstcaps.h @@ -58,6 +58,26 @@ struct _GstCaps { /* factory macros which make it easier for plugins to instantiate */ +#ifdef G_HAVE_ISO_VARARGS +#define GST_CAPS_NEW(name, type, ...) \ +gst_caps_new ( \ + name, \ + type, \ + gst_props_new ( \ + __VA_ARGS__, \ + NULL)) + +#define GST_CAPS_FACTORY(factoryname, ...) \ +static GstCaps* \ +factoryname (void) \ +{ \ + static GstCaps *caps = NULL; \ + if (!caps) { \ + caps = gst_caps_chain (__VA_ARGS_, NULL); \ + } \ + return caps; \ +} +#elif defined(G_HAVE_GNUC_VARARGS) #define GST_CAPS_NEW(name, type, a...) \ gst_caps_new ( \ name, \ @@ -76,6 +96,7 @@ factoryname (void) \ } \ return caps; \ } +#endif #define GST_CAPS_GET(fact) (fact)() @@ -108,8 +129,13 @@ void gst_caps_set_type_id (GstCaps *caps, guint16 type_id); GstCaps* gst_caps_set_props (GstCaps *caps, GstProps *props); GstProps* gst_caps_get_props (GstCaps *caps); +#ifdef G_HAVE_ISO_VARARGS +#define gst_caps_set(caps, ...) gst_props_set ((caps)->properties, __VA_ARGS__) +#define gst_caps_get(caps, ...) gst_props_get ((caps)->properties, __VA_ARGS__) +#elif defined(G_HAVE_GNUC_VARARGS) #define gst_caps_set(caps, name, args...) gst_props_set ((caps)->properties, name, ##args) #define gst_caps_get(caps, name, args...) gst_props_get ((caps)->properties, name, ##args) +#endif #define gst_caps_get_int(caps,name,res) gst_props_entry_get_int(gst_props_get_entry((caps)->properties,name),res) #define gst_caps_get_float(caps,name,res) gst_props_entry_get_float(gst_props_get_entry((caps)->properties,name),res) diff --git a/gst/gstevent.h b/gst/gstevent.h index 543a76ea4c..71d6886363 100644 --- a/gst/gstevent.h +++ b/gst/gstevent.h @@ -78,6 +78,18 @@ typedef struct GstEventFlag flags; } GstEventMask; +#ifdef G_HAVE_ISO_VARARGS +#define GST_EVENT_MASK_FUNCTION(functionname, ...) \ +static const GstEventMask* \ +functionname (GstPad *pad) \ +{ \ + static const GstEventMask masks[] = { \ + __VA_ARGS__, \ + { 0, } \ + }; \ + return masks; \ +} +#elif defined(G_HAVE_GNUC_VARARGS) #define GST_EVENT_MASK_FUNCTION(functionname, a...) \ static const GstEventMask* \ functionname (GstPad *pad) \ @@ -88,6 +100,7 @@ functionname (GstPad *pad) \ }; \ return masks; \ } +#endif /* seek events, extends GstEventFlag */ typedef enum { diff --git a/gst/gstformat.h b/gst/gstformat.h index b7c0944c62..ec24900927 100644 --- a/gst/gstformat.h +++ b/gst/gstformat.h @@ -48,6 +48,18 @@ struct _GstFormatDefinition gchar *description; }; +#ifdef G_HAVE_ISO_VARARGS +#define GST_FORMATS_FUNCTION(functionname, ...) \ +static const GstFormat* \ +functionname (GstPad *pad) \ +{ \ + static const GstFormat formats[] = { \ + __VA_ARGS__, \ + 0 \ + }; \ + return formats; \ +} +#elif defined(G_HAVE_GNUC_VARARGS) #define GST_FORMATS_FUNCTION(functionname, a...) \ static const GstFormat* \ functionname (GstPad *pad) \ @@ -58,6 +70,7 @@ functionname (GstPad *pad) \ }; \ return formats; \ } +#endif void _gst_format_initialize (void); diff --git a/gst/gstinfo.c b/gst/gstinfo.c index ed577e8f01..2b24513ea0 100644 --- a/gst/gstinfo.c +++ b/gst/gstinfo.c @@ -81,8 +81,9 @@ static gchar *_gst_info_category_strings[] = { "REFCOUNTING", "EVENT", "PARAMS", - - [30] = "CALL_TRACE", + "", + "", + "CALL_TRACE", }; /** diff --git a/gst/gstinfo.h b/gst/gstinfo.h index 89d467de22..2e0d407aa3 100644 --- a/gst/gstinfo.h +++ b/gst/gstinfo.h @@ -31,6 +31,15 @@ #include #endif +#ifdef HAVE_FUNC +#define FUNCTION __func__ +#elif HAVE_PRETTY_FUNCTION +#define FUNCTION __PRETTY_FUNCTION__ +#elif HAVE_FUNCTION +#define FUNCTION __FUNCTION__ +#else +#define FUNCTION "" +#endif /***** are we in the core or not? *****/ #ifdef __GST_PRIVATE_H__ @@ -136,17 +145,38 @@ G_GNUC_UNUSED static gchar *_debug_string = NULL; +#ifdef G_HAVE_ISO_VARARGS + +#ifdef GST_DEBUG_ENABLED +#define GST_DEBUG(cat, ...) G_STMT_START{ \ + if ((1< +#ifdef G_HAVE_ISO_VARARGS + +#ifdef DEBUG +# define PRINT(...) printf(__VAR_ARGS__) +#else +#define PRINT(...) +#endif + +#elif defined(G_HAVE_GNUC_VARARGS) + #ifdef DEBUG # define PRINT(a...) printf(##a) #else #define PRINT(a...) #endif +#endif + #define CHAR(x) PRINT ("char: %c\n", *yytext); return *yytext; #define YY_DECL int _gst_parse_yylex (YYSTYPE *lvalp)