mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
string cloning; fix foo.str += 's'
This commit is contained in:
@@ -76,18 +76,6 @@ pub fn panic(s string) {
|
||||
C.exit(1)
|
||||
}
|
||||
|
||||
pub fn println(s string) {
|
||||
// Should never happen
|
||||
if isnil(s.str) {
|
||||
panic('println(NIL)')
|
||||
}
|
||||
$if windows {
|
||||
C._putws(s.to_wide())
|
||||
} $else {
|
||||
C.printf('%.*s\n', s.len, s.str)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn eprintln(s string) {
|
||||
if isnil(s.str) {
|
||||
panic('eprintln(NIL)')
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
|
||||
module builtin
|
||||
|
||||
pub fn println(s string) {
|
||||
C.printf('%.*s\n', s.len, s.str)
|
||||
}
|
||||
|
||||
fn print_backtrace_skipping_top_frames_msvc(skipframes int) bool {
|
||||
println('not implemented, see builtin_windows.v')
|
||||
return false
|
||||
|
||||
@@ -73,7 +73,7 @@ $if msvc {
|
||||
|
||||
handle := C.GetCurrentProcess()
|
||||
defer { C.SymCleanup(handle) }
|
||||
|
||||
|
||||
options := C.SymSetOptions(SYMOPT_DEBUG | SYMOPT_LOAD_LINES | SYMOPT_UNDNAME)
|
||||
syminitok := C.SymInitialize( handle, 0, 1)
|
||||
if syminitok != 1 {
|
||||
@@ -133,3 +133,8 @@ fn print_backtrace_skipping_top_frames_nix(skipframes int) bool {
|
||||
println('not implemented, see builtin_nix.v')
|
||||
return false
|
||||
}
|
||||
|
||||
pub fn println(s string) {
|
||||
C._putws(s.to_wide())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user