[vala/0.48] codegen: Include "string.h" for strcmp() (POSIX)



commit 0d41fda7c9f2706a700c331c7d916d8a3f30340e
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Fri Feb 26 19:19:54 2021 +0100

    codegen: Include "string.h" for strcmp() (POSIX)

 codegen/valaccodebasemodule.vala | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index b1ebf5786..60c4d34cd 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -1922,6 +1922,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                                                ccode.add_assignment (new CCodeIdentifier ("old_value"), 
get_call);
                                                CCodeFunctionCall ccall;
                                                if (context.profile == Profile.POSIX) {
+                                                       cfile.add_include ("string.h");
                                                        ccall = new CCodeFunctionCall (new CCodeIdentifier 
(generate_cmp_wrapper (new CCodeIdentifier ("strcmp"))));
                                                } else {
                                                        ccall = new CCodeFunctionCall (new CCodeIdentifier 
("g_strcmp0"));
@@ -3020,6 +3021,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                        if (!(f.variable_type is NullType) && f.variable_type.compatible (string_type)) {
                                CCodeFunctionCall ccall;
                                if (context.profile == Profile.POSIX) {
+                                       cfile.add_include ("string.h");
                                        ccall = new CCodeFunctionCall (new CCodeIdentifier 
(generate_cmp_wrapper (new CCodeIdentifier ("strcmp"))));
                                } else {
                                        ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_strcmp0"));
@@ -5689,6 +5691,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                        case BinaryOperator.GREATER_THAN_OR_EQUAL:
                                CCodeFunctionCall ccall;
                                if (context.profile == Profile.POSIX) {
+                                       cfile.add_include ("string.h");
                                        ccall = new CCodeFunctionCall (new CCodeIdentifier 
(generate_cmp_wrapper (new CCodeIdentifier ("strcmp"))));
                                } else {
                                        ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_strcmp0"));
@@ -5773,6 +5776,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                if (array_type.element_type.compatible (string_type)) {
                        CCodeFunctionCall ccall;
                        if (context.profile == Profile.POSIX) {
+                               cfile.add_include ("string.h");
                                ccall = new CCodeFunctionCall (new CCodeIdentifier (generate_cmp_wrapper (new 
CCodeIdentifier ("strcmp"))));
                        } else {
                                ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_strcmp0"));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]