From: Rico Tzschichholz Date: Fri, 26 Feb 2021 18:19:54 +0000 (+0100) Subject: codegen: Include "string.h" for strcmp() (POSIX) X-Git-Tag: 0.51.3~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51584fe317612f552a891547133d9dbc14e7ec97;p=thirdparty%2Fvala.git codegen: Include "string.h" for strcmp() (POSIX) --- diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala index 928be5111..cce76bbfe 100644 --- a/codegen/valaccodebasemodule.vala +++ b/codegen/valaccodebasemodule.vala @@ -1999,6 +1999,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")); @@ -3093,6 +3094,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")); @@ -5770,6 +5772,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")); @@ -5850,6 +5853,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"));