]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Avoid symbol clashes with "va_*" from "stdarg.h"
authorAlvarito050506 <donfrutosgomez@gmail.com>
Mon, 17 Jan 2022 19:00:16 +0000 (16:00 -0300)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 9 Feb 2022 21:17:07 +0000 (22:17 +0100)
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.

codegen/valaccodemethodcallmodule.vala
codegen/valaccodemethodmodule.vala

index bfa75cde9630a6fdc73b4faf8149ccef591fbad2..8fa45ed374888a08b5daca6a47d5fa42dd4d7b11 100644 (file)
@@ -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"));
index 0b1d69c028dd80005ec64bc983eecb91dcc7d392..1fc84b2db3523edb48876a022755e2a9ac730b89 100644 (file)
@@ -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"));
                }