1
0
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:
Alexander Medvednikov
2019-12-12 04:09:31 +03:00
parent e182274fe7
commit 576618d8cc
6 changed files with 34 additions and 23 deletions

View File

@@ -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)')

View File

@@ -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

View File

@@ -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())
}