Skip to content

Commit

Permalink
docs: add missing @ on export attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
JalonSolov committed Jul 12, 2024
1 parent 7908957 commit cd9b2ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -7443,7 +7443,7 @@ By default all V functions have the following naming scheme in C: `[module name]
For example, `fn foo() {}` in module `bar` will result in `bar__foo()`.
To use a custom export name, use the `[export]` attribute:
To use a custom export name, use the `@[export]` attribute:
```
@[export: 'my_custom_c_name']
Expand Down
8 changes: 4 additions & 4 deletions vlib/v/help/build/build-c.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ see also `v help build`.
bare_panic(msg string)
Print "V panic: " + msg, along with an optional backtrace
and/or the V commit hash, and then exit.
[export: 'malloc']
@[export: 'malloc']
__malloc(n usize) &C.void
Allocates n bytes of memory and returns the pointer to the first
byte.
[export: 'free']
@[export: 'free']
__free(ptr &C.void)
Free the block of memory ptr allocated by malloc.
realloc(old_area &C.void, new_size usize) &C.void
Allocates a new area of size new_size, copies old_area
to the new area, and returns a pointer to the new area.
[export: 'calloc']
@[export: 'calloc']
__calloc(nmemb usize, size usize) &C.void
Like malloc, but sets all the bytes to `0` first.
memcpy(dest &C.void, src &C.void, n usize) &C.void
Expand All @@ -102,7 +102,7 @@ see also `v help build`.
bare_backtrace() string
Return a backtrace that can be printed. If backtraces are not
supported, return a message stating that backtraces do not work.
[export: 'exit']
@[export: 'exit']
__exit(code int)
Exit with code code. code is allowed to be ignored.

Expand Down

0 comments on commit cd9b2ad

Please sign in to comment.