From dbacf9cfab5fc020f9a626ebcbe492681cc51270 Mon Sep 17 00:00:00 2001 From: JalonSolov Date: Fri, 30 Jul 2021 19:31:15 -0400 Subject: [PATCH] doc: add calling V from C to toc (#11006) --- doc/docs.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/docs.md b/doc/docs.md index e4a60834ee..44cfdcb461 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -131,6 +131,7 @@ For more details and troubleshooting, please visit the [vab GitHub repository](h * [Structs with reference fields](#structs-with-reference-fields) * [sizeof and __offsetof](#sizeof-and-__offsetof) * [Calling C from V](#calling-c-from-v) + * [Calling V from C](#calling-v-from-c) * [Atomics](#atomics) * [Global Variables](#global-variables) * [Debugging](#debugging) @@ -4270,11 +4271,11 @@ fn main() { ## Calling V from C -Since V can compile to C, calling V code from C is very easy. +Since V can compile to C, calling V code from C is very easy. By default all V functions have the following naming scheme in C: `[module name]__[fn_name]`. -For example, `fn foo() {}` in module `bar` will result in `foo__bar()`. +For example, `fn foo() {}` in module `bar` will result in `bar__foo()`. To use a custom export name, use the `[export]` attribute: