1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

docs: describe usage of atomic C functions (#10861)

This commit is contained in:
Uwe Krüger
2021-07-20 07:31:20 +02:00
committed by GitHub
parent de39bba7bd
commit dc045806f9
2 changed files with 105 additions and 0 deletions

View File

@ -444,6 +444,23 @@ fn (mut f MDFile) check_examples() CheckResult {
}
oks++
}
'globals' {
res := cmdexecute('"$vexe" -w -Wfatal-errors -enable-globals -o x.c $vfile')
os.rm('x.c') or {}
if res != 0 || fmt_res != 0 {
if res != 0 {
eprintln(eline(f.path, e.sline, 0, '`example failed to compile with -enable-globals'))
}
if fmt_res != 0 {
eprintln(eline(f.path, e.sline, 0, '`example is not formatted'))
}
eprintln(vcontent)
should_cleanup_vfile = false
errors++
continue
}
oks++
}
'live' {
res := cmdexecute('"$vexe" -w -Wfatal-errors -live -o x.c $vfile')
if res != 0 || fmt_res != 0 {