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

Revert "Support for the printf optimisation for windows and wide strings"

This reverts commit acd28fa495.
This commit is contained in:
Alexander Medvednikov
2019-07-30 18:28:00 +02:00
parent 3e458a8801
commit 79be98d2fb
4 changed files with 7 additions and 27 deletions

View File

@ -2398,19 +2398,9 @@ fn (p mut Parser) string_expr() {
cur_line := p.cgen.cur_line.trim_space()
if cur_line.contains('println (') && p.tok != .plus &&
!cur_line.contains('string_add') && !cur_line.contains('eprintln') {
if p.os == .windows || p.os == .msvc {
p.cgen.resetln(cur_line.replace('println (', 'wprintf( TEXT('))// .replace('%.*s', '%.*S'))
// Emily: HACKY HACK
real_format := format.replace('%.*s', '%.*S')
real_args := args.right(1)
p.gen('$real_format\\n")$real_args')
} else {
p.cgen.resetln(cur_line.replace('println (', 'printf('))
p.gen('$format\\n$args')
}
return
p.cgen.resetln(cur_line.replace('println (', 'printf('))
p.gen('$format\\n$args')
return
}
// '$age'! means the user wants this to be a tmp string (uses global buffer, no allocation,
// won't be used again)