/* methods_varargs_gvalue.c generated by valac, the Vala compiler * generated from methods_varargs_gvalue.vala, do not modify */ #include #include #include #include #include #if !defined(VALA_EXTERN) #if defined(_WIN32) || defined(__CYGWIN__) #define VALA_EXTERN __declspec(dllexport) extern #elif __GNUC__ >= 4 #define VALA_EXTERN __attribute__((visibility("default"))) extern #else #define VALA_EXTERN extern #endif #endif #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); #define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; } #define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; } #define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); VALA_EXTERN void foo (gint first_arg, ...); VALA_EXTERN void faz (gint first_arg, ...); static void _vala_main (void); void foo (gint first_arg, ...) { va_list args = {0}; GValue val = {0}; GValue _tmp0_; GValue _tmp1_ = {0}; const gchar* _tmp2_; va_start (args, first_arg); _tmp0_ = *(va_arg (args, GValue*)); if (G_IS_VALUE (&_tmp0_)) { g_value_init (&_tmp1_, G_VALUE_TYPE (&_tmp0_)); g_value_copy (&_tmp0_, &_tmp1_); } else { _tmp1_ = _tmp0_; } val = _tmp1_; _vala_assert (first_arg == 42, "first_arg == 42"); _vala_assert (G_VALUE_HOLDS (&val, G_TYPE_STRING), "val.holds (typeof (string))"); _tmp2_ = g_value_get_string (&val); _vala_assert (g_strcmp0 (_tmp2_, "foo") == 0, "val.get_string () == \"foo\""); G_IS_VALUE (&val) ? (g_value_unset (&val), NULL) : NULL; va_end (args); } void faz (gint first_arg, ...) { va_list args = {0}; GValue* val = NULL; GValue* _tmp0_; const gchar* _tmp1_; va_start (args, first_arg); _tmp0_ = va_arg (args, GValue*); val = _tmp0_; _vala_assert (first_arg == 23, "first_arg == 23"); _vala_assert (G_VALUE_HOLDS (val, G_TYPE_STRING), "val.holds (typeof (string))"); _tmp1_ = g_value_get_string (val); _vala_assert (g_strcmp0 (_tmp1_, "foo") == 0, "val.get_string () == \"foo\""); va_end (args); } static void _vala_main (void) { GValue val = {0}; GValue _tmp0_ = {0}; GValue _tmp1_; GValue _tmp2_; g_value_init (&_tmp0_, G_TYPE_STRING); val = _tmp0_; g_value_set_string (&val, "foo"); _tmp1_ = val; foo (42, &_tmp1_, NULL); _tmp2_ = val; faz (23, &_tmp2_, NULL); G_IS_VALUE (&val) ? (g_value_unset (&val), NULL) : NULL; } int main (int argc, char ** argv) { _vala_main (); return 0; }