mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
builtin: fix compilation (#11445)
This commit is contained in:
parent
43fae5de74
commit
bef3390f36
@ -23,9 +23,9 @@ pub fn (x usize) str() string {
|
|||||||
return u64(x).str()
|
return u64(x).str()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn (x size_t) str() string {
|
// pub fn (x size_t) str() string {
|
||||||
return u64(x).str()
|
// return u64(x).str()
|
||||||
}
|
// }
|
||||||
|
|
||||||
pub fn (cptr &char) str() string {
|
pub fn (cptr &char) str() string {
|
||||||
return u64(cptr).hex()
|
return u64(cptr).hex()
|
||||||
|
@ -498,9 +498,9 @@ pub fn (mut p Parser) find_type_or_add_placeholder(name string, language ast.Lan
|
|||||||
// struct / enum / placeholder
|
// struct / enum / placeholder
|
||||||
mut idx := p.table.find_type_idx(name)
|
mut idx := p.table.find_type_idx(name)
|
||||||
if idx > 0 {
|
if idx > 0 {
|
||||||
if idx == ast.size_t_type_idx {
|
if !p.builtin_mod && idx == ast.size_t_type_idx {
|
||||||
// don't warn in builtin, there is still the `.str` method
|
// don't warn in builtin, there is still the `.str` method
|
||||||
if !p.pref.is_fmt && !p.builtin_mod {
|
if !p.pref.is_fmt {
|
||||||
p.warn_with_pos('`size_t` is deprecated, use `usize` instead', p.prev_tok.position())
|
p.warn_with_pos('`size_t` is deprecated, use `usize` instead', p.prev_tok.position())
|
||||||
}
|
}
|
||||||
return ast.new_type(ast.usize_type_idx)
|
return ast.new_type(ast.usize_type_idx)
|
||||||
|
Loading…
Reference in New Issue
Block a user