mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 07:26:15 +01:00
Merge branch 'wip/smcv/standard-va-copy' into 'main'
Soft-deprecate G_VA_COPY in favour of va_copy See merge request GNOME/glib!2999
This commit is contained in:
commit
77180daca5
@ -125,7 +125,7 @@ _g_cclosure_marshal_BOOLEAN__OBJECTv (GClosure *closure,
|
||||
gpointer arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if (arg0 != NULL)
|
||||
arg0 = g_object_ref (arg0);
|
||||
@ -216,7 +216,7 @@ _g_cclosure_marshal_BOOLEAN__OBJECT_FLAGSv (GClosure *closure,
|
||||
guint arg1;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if (arg0 != NULL)
|
||||
arg0 = g_object_ref (arg0);
|
||||
@ -309,7 +309,7 @@ _g_cclosure_marshal_BOOLEAN__OBJECT_OBJECTv (GClosure *closure,
|
||||
gpointer arg1;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if (arg0 != NULL)
|
||||
arg0 = g_object_ref (arg0);
|
||||
@ -406,7 +406,7 @@ _g_cclosure_marshal_BOOLEAN__POINTER_INTv (GClosure *closure,
|
||||
gint arg1;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
arg1 = (gint) va_arg (args_copy, gint);
|
||||
va_end (args_copy);
|
||||
@ -494,7 +494,7 @@ _g_cclosure_marshal_BOOLEAN__STRINGv (GClosure *closure,
|
||||
|
||||
g_return_if_fail (return_value != NULL);
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
||||
arg0 = g_strdup (arg0);
|
||||
@ -579,7 +579,7 @@ _g_cclosure_marshal_BOOLEAN__UINTv (GClosure *closure,
|
||||
guint arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (guint) va_arg (args_copy, guint);
|
||||
va_end (args_copy);
|
||||
|
||||
@ -737,7 +737,7 @@ _g_cclosure_marshal_INT__BOXEDv (GClosure *closure,
|
||||
gpointer arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
||||
arg0 = g_boxed_copy (param_types[0] & ~G_SIGNAL_TYPE_STATIC_SCOPE, arg0);
|
||||
@ -824,7 +824,7 @@ _g_cclosure_marshal_INT__OBJECTv (GClosure *closure,
|
||||
gpointer arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if (arg0 != NULL)
|
||||
arg0 = g_object_ref (arg0);
|
||||
@ -910,7 +910,7 @@ _g_cclosure_marshal_VOID__BOOLEAN_BOXEDv (GClosure *closure,
|
||||
gpointer arg1;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gboolean) va_arg (args_copy, gboolean);
|
||||
arg1 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if ((param_types[1] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg1 != NULL)
|
||||
@ -995,7 +995,7 @@ _g_cclosure_marshal_VOID__ENUM_OBJECTv (GClosure *closure,
|
||||
gpointer arg1;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gint) va_arg (args_copy, gint);
|
||||
arg1 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if (arg1 != NULL)
|
||||
@ -1084,7 +1084,7 @@ _g_cclosure_marshal_VOID__ENUM_OBJECT_OBJECTv (GClosure *closure,
|
||||
gpointer arg2;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gint) va_arg (args_copy, gint);
|
||||
arg1 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if (arg1 != NULL)
|
||||
@ -1179,7 +1179,7 @@ _g_cclosure_marshal_VOID__INT_INT_INTv (GClosure *closure,
|
||||
gint arg2;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gint) va_arg (args_copy, gint);
|
||||
arg1 = (gint) va_arg (args_copy, gint);
|
||||
arg2 = (gint) va_arg (args_copy, gint);
|
||||
@ -1263,7 +1263,7 @@ _g_cclosure_marshal_VOID__OBJECT_OBJECTv (GClosure *closure,
|
||||
gpointer arg1;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if (arg0 != NULL)
|
||||
arg0 = g_object_ref (arg0);
|
||||
@ -1356,7 +1356,7 @@ _g_cclosure_marshal_VOID__OBJECT_OBJECT_ENUMv (GClosure *closure,
|
||||
gint arg2;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if (arg0 != NULL)
|
||||
arg0 = g_object_ref (arg0);
|
||||
@ -1459,7 +1459,7 @@ _g_cclosure_marshal_VOID__OBJECT_OBJECT_STRING_STRING_VARIANTv (GClosure *closur
|
||||
gpointer arg4;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if (arg0 != NULL)
|
||||
arg0 = g_object_ref (arg0);
|
||||
@ -1574,7 +1574,7 @@ _g_cclosure_marshal_VOID__OBJECT_OBJECT_VARIANT_BOXEDv (GClosure *closure,
|
||||
gpointer arg3;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if (arg0 != NULL)
|
||||
arg0 = g_object_ref (arg0);
|
||||
@ -1675,7 +1675,7 @@ _g_cclosure_marshal_VOID__OBJECT_VARIANTv (GClosure *closure,
|
||||
gpointer arg1;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if (arg0 != NULL)
|
||||
arg0 = g_object_ref (arg0);
|
||||
@ -1768,7 +1768,7 @@ _g_cclosure_marshal_VOID__POINTER_INT_STRINGv (GClosure *closure,
|
||||
gpointer arg2;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
arg1 = (gint) va_arg (args_copy, gint);
|
||||
arg2 = (gpointer) va_arg (args_copy, gpointer);
|
||||
@ -1855,7 +1855,7 @@ _g_cclosure_marshal_VOID__STRING_BOOLEANv (GClosure *closure,
|
||||
gboolean arg1;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
||||
arg0 = g_strdup (arg0);
|
||||
@ -1940,7 +1940,7 @@ _g_cclosure_marshal_VOID__STRING_BOXEDv (GClosure *closure,
|
||||
gpointer arg1;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
||||
arg0 = g_strdup (arg0);
|
||||
@ -2033,7 +2033,7 @@ _g_cclosure_marshal_VOID__STRING_BOXED_BOXEDv (GClosure *closure,
|
||||
gpointer arg2;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
||||
arg0 = g_strdup (arg0);
|
||||
@ -2132,7 +2132,7 @@ _g_cclosure_marshal_VOID__STRING_INT64_INT64v (GClosure *closure,
|
||||
gint64 arg2;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
||||
arg0 = g_strdup (arg0);
|
||||
@ -2227,7 +2227,7 @@ _g_cclosure_marshal_VOID__STRING_STRING_STRING_FLAGSv (GClosure *closure,
|
||||
guint arg3;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
||||
arg0 = g_strdup (arg0);
|
||||
@ -2328,7 +2328,7 @@ _g_cclosure_marshal_VOID__STRING_STRING_VARIANTv (GClosure *closure,
|
||||
gpointer arg2;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
||||
arg0 = g_strdup (arg0);
|
||||
@ -2423,7 +2423,7 @@ _g_cclosure_marshal_VOID__STRING_VARIANTv (GClosure *closure,
|
||||
gpointer arg1;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
||||
arg0 = g_strdup (arg0);
|
||||
@ -2516,7 +2516,7 @@ _g_cclosure_marshal_VOID__UINT_UINT_UINTv (GClosure *closure,
|
||||
guint arg2;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (guint) va_arg (args_copy, guint);
|
||||
arg1 = (guint) va_arg (args_copy, guint);
|
||||
arg2 = (guint) va_arg (args_copy, guint);
|
||||
@ -2600,7 +2600,7 @@ _g_cclosure_marshal_VOID__VARIANT_BOXEDv (GClosure *closure,
|
||||
gpointer arg1;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
||||
arg0 = g_variant_ref_sink (arg0);
|
||||
|
@ -858,7 +858,7 @@ build_registry_pathv (gunichar2 *output, gsize output_size, va_list components)
|
||||
if (output == NULL)
|
||||
return FALSE;
|
||||
|
||||
G_VA_COPY (lentest, components);
|
||||
va_copy (lentest, components);
|
||||
|
||||
for (length = 0, component = va_arg (lentest, gunichar2 *);
|
||||
component != NULL;
|
||||
|
@ -1910,6 +1910,9 @@
|
||||
*
|
||||
* Each invocation of `G_VA_COPY (ap1, ap2)` must be matched with a
|
||||
* corresponding `va_end (ap1)` call in the same function.
|
||||
*
|
||||
* This is equivalent to standard C `va_copy()`, available since C99
|
||||
* and C++11, which should be preferred in new code.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -118,6 +118,7 @@ typedef unsigned @glib_intptr_type_define@ guintptr;
|
||||
|
||||
@glib_os@
|
||||
|
||||
#define G_VA_COPY va_copy
|
||||
@glib_vacopy@
|
||||
|
||||
#define G_HAVE_ISO_VARARGS 1
|
||||
|
@ -2530,7 +2530,7 @@ g_markup_vprintf_escaped (const gchar *format,
|
||||
|
||||
/* Use them to format the arguments
|
||||
*/
|
||||
G_VA_COPY (args2, args);
|
||||
va_copy (args2, args);
|
||||
|
||||
output1 = g_strdup_vprintf (format1->str, args);
|
||||
|
||||
|
@ -360,7 +360,7 @@ g_vasprintf (gchar **string,
|
||||
{
|
||||
va_list args2;
|
||||
|
||||
G_VA_COPY (args2, args);
|
||||
va_copy (args2, args);
|
||||
|
||||
*string = g_new (gchar, g_printf_string_upper_bound (format, args));
|
||||
|
||||
|
@ -36,19 +36,6 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* Define G_VA_COPY() to do the right thing for copying va_list variables.
|
||||
* glibconfig.h may have already defined G_VA_COPY as va_copy or __va_copy.
|
||||
*/
|
||||
#if !defined (G_VA_COPY)
|
||||
# if defined (__GNUC__) && defined (__PPC__) && (defined (_CALL_SYSV) || defined (_WIN32))
|
||||
# define G_VA_COPY(ap1, ap2) (*(ap1) = *(ap2))
|
||||
# elif defined (G_VA_COPY_AS_ARRAY)
|
||||
# define G_VA_COPY(ap1, ap2) memmove ((ap1), (ap2), sizeof (va_list))
|
||||
# else /* va_list is a pointer */
|
||||
# define G_VA_COPY(ap1, ap2) ((ap1) = (ap2))
|
||||
# endif /* va_list is a pointer */
|
||||
#endif /* !G_VA_COPY */
|
||||
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
const gchar * g_get_user_name (void);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
|
@ -1614,7 +1614,7 @@ g_cclosure_marshal_generic_va (GClosure *closure,
|
||||
args[n_args-1] = &closure->data;
|
||||
}
|
||||
|
||||
G_VA_COPY (args_copy, args_list);
|
||||
va_copy (args_copy, args_list);
|
||||
|
||||
/* Box non-primitive arguments */
|
||||
for (i = 0; i < n_params; i++)
|
||||
|
@ -671,7 +671,7 @@ def generate_body(retval, params, prefix, va_marshal=False):
|
||||
body += [' va_list args_copy;']
|
||||
body += ['']
|
||||
|
||||
body += [' G_VA_COPY (args_copy, args);']
|
||||
body += [' va_copy (args_copy, args);']
|
||||
|
||||
for idx, arg in enumerate(get_args):
|
||||
ctype = IN_ARGS[arg]['ctype']
|
||||
|
@ -253,7 +253,7 @@ g_cclosure_marshal_VOID__BOOLEANv (GClosure *closure,
|
||||
gboolean arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gboolean) va_arg (args_copy, gboolean);
|
||||
va_end (args_copy);
|
||||
|
||||
@ -361,7 +361,7 @@ g_cclosure_marshal_VOID__CHARv (GClosure *closure,
|
||||
gchar arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gchar) va_arg (args_copy, gint);
|
||||
va_end (args_copy);
|
||||
|
||||
@ -469,7 +469,7 @@ g_cclosure_marshal_VOID__UCHARv (GClosure *closure,
|
||||
guchar arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (guchar) va_arg (args_copy, guint);
|
||||
va_end (args_copy);
|
||||
|
||||
@ -577,7 +577,7 @@ g_cclosure_marshal_VOID__INTv (GClosure *closure,
|
||||
gint arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gint) va_arg (args_copy, gint);
|
||||
va_end (args_copy);
|
||||
|
||||
@ -685,7 +685,7 @@ g_cclosure_marshal_VOID__UINTv (GClosure *closure,
|
||||
guint arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (guint) va_arg (args_copy, guint);
|
||||
va_end (args_copy);
|
||||
|
||||
@ -793,7 +793,7 @@ g_cclosure_marshal_VOID__LONGv (GClosure *closure,
|
||||
glong arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (glong) va_arg (args_copy, glong);
|
||||
va_end (args_copy);
|
||||
|
||||
@ -901,7 +901,7 @@ g_cclosure_marshal_VOID__ULONGv (GClosure *closure,
|
||||
gulong arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gulong) va_arg (args_copy, gulong);
|
||||
va_end (args_copy);
|
||||
|
||||
@ -1009,7 +1009,7 @@ g_cclosure_marshal_VOID__ENUMv (GClosure *closure,
|
||||
gint arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gint) va_arg (args_copy, gint);
|
||||
va_end (args_copy);
|
||||
|
||||
@ -1117,7 +1117,7 @@ g_cclosure_marshal_VOID__FLAGSv (GClosure *closure,
|
||||
guint arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (guint) va_arg (args_copy, guint);
|
||||
va_end (args_copy);
|
||||
|
||||
@ -1225,7 +1225,7 @@ g_cclosure_marshal_VOID__FLOATv (GClosure *closure,
|
||||
gfloat arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gfloat) va_arg (args_copy, gdouble);
|
||||
va_end (args_copy);
|
||||
|
||||
@ -1333,7 +1333,7 @@ g_cclosure_marshal_VOID__DOUBLEv (GClosure *closure,
|
||||
gdouble arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gdouble) va_arg (args_copy, gdouble);
|
||||
va_end (args_copy);
|
||||
|
||||
@ -1441,7 +1441,7 @@ g_cclosure_marshal_VOID__STRINGv (GClosure *closure,
|
||||
gpointer arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
||||
arg0 = g_strdup (arg0);
|
||||
@ -1553,7 +1553,7 @@ g_cclosure_marshal_VOID__PARAMv (GClosure *closure,
|
||||
gpointer arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
||||
arg0 = g_param_spec_ref (arg0);
|
||||
@ -1665,7 +1665,7 @@ g_cclosure_marshal_VOID__BOXEDv (GClosure *closure,
|
||||
gpointer arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
||||
arg0 = g_boxed_copy (param_types[0] & ~G_SIGNAL_TYPE_STATIC_SCOPE, arg0);
|
||||
@ -1781,7 +1781,7 @@ g_cclosure_marshal_VOID__POINTERv (GClosure *closure,
|
||||
gpointer arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
va_end (args_copy);
|
||||
|
||||
@ -1889,7 +1889,7 @@ g_cclosure_marshal_VOID__OBJECTv (GClosure *closure,
|
||||
gpointer arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if (arg0 != NULL)
|
||||
arg0 = g_object_ref (arg0);
|
||||
@ -2001,7 +2001,7 @@ g_cclosure_marshal_VOID__VARIANTv (GClosure *closure,
|
||||
gpointer arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
||||
arg0 = g_variant_ref_sink (arg0);
|
||||
@ -2117,7 +2117,7 @@ g_cclosure_marshal_VOID__UINT_POINTERv (GClosure *closure,
|
||||
gpointer arg1;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (guint) va_arg (args_copy, guint);
|
||||
arg1 = (gpointer) va_arg (args_copy, gpointer);
|
||||
va_end (args_copy);
|
||||
@ -2236,7 +2236,7 @@ g_cclosure_marshal_BOOLEAN__FLAGSv (GClosure *closure,
|
||||
|
||||
g_return_if_fail (return_value != NULL);
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (guint) va_arg (args_copy, guint);
|
||||
va_end (args_copy);
|
||||
|
||||
@ -2358,7 +2358,7 @@ g_cclosure_marshal_STRING__OBJECT_POINTERv (GClosure *closure,
|
||||
|
||||
g_return_if_fail (return_value != NULL);
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if (arg0 != NULL)
|
||||
arg0 = g_object_ref (arg0);
|
||||
@ -2487,7 +2487,7 @@ g_cclosure_marshal_BOOLEAN__BOXED_BOXEDv (GClosure *closure,
|
||||
|
||||
g_return_if_fail (return_value != NULL);
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
||||
arg0 = g_boxed_copy (param_types[0] & ~G_SIGNAL_TYPE_STATIC_SCOPE, arg0);
|
||||
|
@ -497,7 +497,7 @@ class TestGenmarshal(unittest.TestCase):
|
||||
gpointer arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
||||
arg0 = g_variant_ref_sink (arg0);
|
||||
@ -639,7 +639,7 @@ class TestGenmarshal(unittest.TestCase):
|
||||
gpointer arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
||||
arg0 = g_strdup (arg0);
|
||||
@ -782,7 +782,7 @@ class TestGenmarshal(unittest.TestCase):
|
||||
gpointer arg0;
|
||||
va_list args_copy;
|
||||
|
||||
G_VA_COPY (args_copy, args);
|
||||
va_copy (args_copy, args);
|
||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
||||
arg0 = g_param_spec_ref (arg0);
|
||||
|
35
meson.build
35
meson.build
@ -1646,38 +1646,11 @@ else
|
||||
endif
|
||||
|
||||
# === va_copy checks ===
|
||||
# we currently check for all three va_copy possibilities, so we get
|
||||
# all results in config.log for bug reports.
|
||||
|
||||
va_copy_func = ''
|
||||
foreach try_func : [ '__va_copy', 'va_copy' ]
|
||||
if cc.compiles('''#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#ifdef _MSC_VER
|
||||
# include "msvc_recommended_pragmas.h"
|
||||
#endif
|
||||
void f (int i, ...) {
|
||||
va_list args1, args2;
|
||||
va_start (args1, i);
|
||||
@0@ (args2, args1);
|
||||
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
|
||||
exit (1);
|
||||
va_end (args1); va_end (args2);
|
||||
}
|
||||
int main() {
|
||||
f (0, 42);
|
||||
return 0;
|
||||
}'''.format(try_func),
|
||||
name : try_func + ' check')
|
||||
va_copy_func = try_func
|
||||
endif
|
||||
endforeach
|
||||
if va_copy_func != ''
|
||||
glib_conf.set('G_VA_COPY', va_copy_func)
|
||||
glib_vacopy = '#define G_VA_COPY ' + va_copy_func
|
||||
else
|
||||
glib_vacopy = '/* #undef G_VA_COPY */'
|
||||
endif
|
||||
glib_vacopy = ''
|
||||
|
||||
# We check for G_VA_COPY_AS_ARRAY for historical reasons, but we no longer
|
||||
# use it: use Standard C va_copy() instead.
|
||||
|
||||
va_list_val_copy_prog = '''
|
||||
#include <stdarg.h>
|
||||
|
Loading…
Reference in New Issue
Block a user