From: Alvarito050506 Date: Mon, 17 Jan 2022 19:00:16 +0000 (-0300) Subject: codegen: Avoid symbol clashes with "va_*" from "stdarg.h" X-Git-Tag: 0.52.11~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2dd91bcf220ca3286f5836e78036c527262edbbf;p=thirdparty%2Fvala.git codegen: Avoid symbol clashes with "va_*" from "stdarg.h" A few more symbol clashes with the va_* macros from stdarg.h, that seem to happen only in some systems, like Alpine Linux or NetBSD. --- diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala index bfa75cde9..8fa45ed37 100644 --- a/codegen/valaccodemethodcallmodule.vala +++ b/codegen/valaccodemethodcallmodule.vala @@ -1104,11 +1104,11 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule { ccode.add_declaration ("va_list", new CCodeVariableDeclarator ("ap")); ccode.add_declaration ("char*", new CCodeVariableDeclarator ("result")); - var va_start = new CCodeFunctionCall (new CCodeIdentifier ("va_start")); - va_start.add_argument (new CCodeIdentifier ("ap")); - va_start.add_argument (new CCodeIdentifier ("format")); + var vastart = new CCodeFunctionCall (new CCodeIdentifier ("va_start")); + vastart.add_argument (new CCodeIdentifier ("ap")); + vastart.add_argument (new CCodeIdentifier ("format")); - ccode.add_expression (va_start); + ccode.add_expression (vastart); if (context.profile == Profile.POSIX) { cfile.add_include ("stdio.h"); @@ -1132,11 +1132,11 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule { ccode.add_assignment (new CCodeIdentifier ("result"), malloc); - va_start = new CCodeFunctionCall (new CCodeIdentifier ("va_start")); - va_start.add_argument (new CCodeIdentifier ("ap")); - va_start.add_argument (new CCodeIdentifier ("format")); + vastart = new CCodeFunctionCall (new CCodeIdentifier ("va_start")); + vastart.add_argument (new CCodeIdentifier ("ap")); + vastart.add_argument (new CCodeIdentifier ("format")); - ccode.add_expression (va_start); + ccode.add_expression (vastart); vsnprintf = new CCodeFunctionCall (new CCodeIdentifier ("vsnprintf")); vsnprintf.add_argument (new CCodeIdentifier ("result")); diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala index 0b1d69c02..1fc84b2db 100644 --- a/codegen/valaccodemethodmodule.vala +++ b/codegen/valaccodemethodmodule.vala @@ -1321,12 +1321,12 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule { vcall.add_argument (carg); } - var va_start = new CCodeFunctionCall (new CCodeIdentifier ("va_start")); - va_start.add_argument (new CCodeIdentifier ("_vala_va_list_obj")); - va_start.add_argument (carg); + var vastart = new CCodeFunctionCall (new CCodeIdentifier ("va_start")); + vastart.add_argument (new CCodeIdentifier ("_vala_va_list_obj")); + vastart.add_argument (carg); ccode.add_declaration ("va_list", new CCodeVariableDeclarator ("_vala_va_list_obj")); - ccode.add_expression (va_start); + ccode.add_expression (vastart); vcall.add_argument (new CCodeIdentifier("_vala_va_list_obj")); }