From 716d867f250e91847e6dbb913fb651485451d358 Mon Sep 17 00:00:00 2001 From: eyelash Date: Sat, 2 May 2020 10:42:38 +0200 Subject: [PATCH] cgen: generate static C functions --- vlib/v/gen/fn.v | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vlib/v/gen/fn.v b/vlib/v/gen/fn.v index a47d8670ed..d930140cf0 100644 --- a/vlib/v/gen/fn.v +++ b/vlib/v/gen/fn.v @@ -89,6 +89,10 @@ fn (mut g Gen) gen_fn_decl(it ast.FnDecl) { g.write('$type_name ${impl_fn_name}(') } } else { + if !it.is_pub { + g.write('static ') + g.definitions.write('static ') + } g.definitions.write('$type_name ${name}(') g.write('$type_name ${name}(') }