summaryrefslogtreecommitdiff
path: root/gtk/gtkargcollector.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtkargcollector.c')
-rw-r--r--gtk/gtkargcollector.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/gtk/gtkargcollector.c b/gtk/gtkargcollector.c
index 32a0ec7847..677bdc816a 100644
--- a/gtk/gtkargcollector.c
+++ b/gtk/gtkargcollector.c
@@ -20,16 +20,23 @@
/* collect a single argument value from a va_list.
* this is implemented as a huge macro <shrug>, because we can't
* pass va_list variables by reference on some systems.
- * the former prototype was:
+ * the corresponding prototype would be:
* static inline gchar*
- * gtk_arg_collect_value (GtkType fundamental_type,
- * GtkArg *arg,
+ * gtk_arg_collect_value (GtkArg *arg,
* va_list var_args);
*/
-#define GTK_ARG_COLLECT_VALUE(_ft, arg, var_args, _error) \
+#define GTK_ARG_COLLECT_VALUE(arg, var_args, _error) \
G_STMT_START { \
- GtkType fundamental_type = _ft; \
gchar *error_msg; \
+ GtkType fundamental_type; \
+ \
+ fundamental_type = GTK_FUNDAMENTAL_TYPE (arg->type); \
+ if (fundamental_type > GTK_TYPE_FUNDAMENTAL_LAST) \
+ { \
+ fundamental_type = gtk_type_get_varargs_type (fundamental_type); \
+ if (!fundamental_type) \
+ fundamental_type = GTK_FUNDAMENTAL_TYPE (arg->type); \
+ } \
\
error_msg = NULL; \
switch (fundamental_type) \