mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
builtin: fix v -W -Wimpure-v examples/hello_world.v
(move ctovstring_impl to builtin.c.v)
This commit is contained in:
parent
49e77546c9
commit
01f108e349
3 changed files with 18 additions and 13 deletions
|
@ -90,6 +90,11 @@ fn get_all_commands() []Command {
|
||||||
okmsg: 'V can compile hello world.'
|
okmsg: 'V can compile hello world.'
|
||||||
rmfile: 'examples/hello_world'
|
rmfile: 'examples/hello_world'
|
||||||
}
|
}
|
||||||
|
res << Command{
|
||||||
|
line: '${vexe} -W -Wimpure-v run examples/hello_world.v'
|
||||||
|
okmsg: 'V can compile hello world with the stricter `-W -Wimpure-v` mode .'
|
||||||
|
rmfile: 'examples/hello_world'
|
||||||
|
}
|
||||||
$if linux {
|
$if linux {
|
||||||
if l2w_crosscc != '' {
|
if l2w_crosscc != '' {
|
||||||
res << Command{
|
res << Command{
|
||||||
|
|
|
@ -944,3 +944,16 @@ pub fn arguments() []string {
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ctovstring_impl is a temporary API, to enable clean CI runs for https://github.com/vlang/v/pull/25264 .
|
||||||
|
// It will be deleted after the migration to the new `builtin` naming scheme is finished.
|
||||||
|
@[export: 'builtin__ctovstring']
|
||||||
|
pub fn ctovstring_impl(s &u8) string {
|
||||||
|
unsafe {
|
||||||
|
len := C.strlen(voidptr(s))
|
||||||
|
return string{
|
||||||
|
str: memdup(voidptr(s), isize(len))
|
||||||
|
len: len
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -3052,16 +3052,3 @@ pub fn (mut ri RunesIterator) next() ?rune {
|
||||||
}
|
}
|
||||||
return rune(impl_utf8_to_utf32(start, len))
|
return rune(impl_utf8_to_utf32(start, len))
|
||||||
}
|
}
|
||||||
|
|
||||||
// ctovstring_impl is a temporary API, to enable clean CI runs for https://github.com/vlang/v/pull/25264 .
|
|
||||||
// It will be deleted after the migration to the new `builtin` naming scheme is finished.
|
|
||||||
@[export: 'builtin__ctovstring']
|
|
||||||
pub fn ctovstring_impl(s &u8) string {
|
|
||||||
unsafe {
|
|
||||||
len := C.strlen(voidptr(s))
|
|
||||||
return string{
|
|
||||||
str: memdup(voidptr(s), isize(len))
|
|
||||||
len: len
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue