mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: unwrap long single line ifs (#7608)
This commit is contained in:
@@ -289,7 +289,11 @@ fn (b &Builder) print_warnings_and_errors() {
|
||||
}
|
||||
if b.checker.nr_warnings > 0 && !b.pref.skip_warnings {
|
||||
for i, err in b.checker.warnings {
|
||||
kind := if b.pref.is_verbose { '$err.reporter warning #$b.checker.nr_warnings:' } else { 'warning:' }
|
||||
kind := if b.pref.is_verbose {
|
||||
'$err.reporter warning #$b.checker.nr_warnings:'
|
||||
} else {
|
||||
'warning:'
|
||||
}
|
||||
ferror := util.formatted_error(kind, err.message, err.file_path, err.pos)
|
||||
eprintln(ferror)
|
||||
if err.details.len > 0 {
|
||||
@@ -307,7 +311,11 @@ fn (b &Builder) print_warnings_and_errors() {
|
||||
}
|
||||
if b.checker.nr_errors > 0 {
|
||||
for i, err in b.checker.errors {
|
||||
kind := if b.pref.is_verbose { '$err.reporter error #$b.checker.nr_errors:' } else { 'error:' }
|
||||
kind := if b.pref.is_verbose {
|
||||
'$err.reporter error #$b.checker.nr_errors:'
|
||||
} else {
|
||||
'error:'
|
||||
}
|
||||
ferror := util.formatted_error(kind, err.message, err.file_path, err.pos)
|
||||
eprintln(ferror)
|
||||
if err.details.len > 0 {
|
||||
|
||||
@@ -778,7 +778,11 @@ fn (mut c Builder) cc_windows_cross() {
|
||||
//
|
||||
cflags := c.get_os_cflags()
|
||||
// -I flags
|
||||
args += if c.pref.ccompiler == 'msvc' { cflags.c_options_before_target_msvc() } else { cflags.c_options_before_target() }
|
||||
args += if c.pref.ccompiler == 'msvc' {
|
||||
cflags.c_options_before_target_msvc()
|
||||
} else {
|
||||
cflags.c_options_before_target()
|
||||
}
|
||||
mut optimization_options := ''
|
||||
mut debug_options := ''
|
||||
if c.pref.is_prod {
|
||||
@@ -804,7 +808,11 @@ fn (mut c Builder) cc_windows_cross() {
|
||||
// add the thirdparty .o files, produced by all the #flag directives:
|
||||
args += ' ' + cflags.c_options_only_object_files() + ' '
|
||||
args += ' $c.out_name_c '
|
||||
args += if c.pref.ccompiler == 'msvc' { cflags.c_options_after_target_msvc() } else { cflags.c_options_after_target() }
|
||||
args += if c.pref.ccompiler == 'msvc' {
|
||||
cflags.c_options_after_target_msvc()
|
||||
} else {
|
||||
cflags.c_options_after_target()
|
||||
}
|
||||
/*
|
||||
winroot := '${pref.default_module_path}/winroot'
|
||||
if !os.is_dir(winroot) {
|
||||
|
||||
@@ -163,7 +163,11 @@ fn find_vs(vswhere_dir string, host_arch string) ?VsInstallation {
|
||||
fn find_msvc() ?MsvcResult {
|
||||
$if windows {
|
||||
processor_architecture := os.getenv('PROCESSOR_ARCHITECTURE')
|
||||
vswhere_dir := if processor_architecture == 'x86' { '%ProgramFiles%' } else { '%ProgramFiles(x86)%' }
|
||||
vswhere_dir := if processor_architecture == 'x86' {
|
||||
'%ProgramFiles%'
|
||||
} else {
|
||||
'%ProgramFiles(x86)%'
|
||||
}
|
||||
host_arch := if processor_architecture == 'x86' { 'X86' } else { 'X64' }
|
||||
wk := find_windows_kit_root(host_arch) or { return error('Unable to find windows sdk') }
|
||||
vs := find_vs(vswhere_dir, host_arch) or { return error('Unable to find visual studio') }
|
||||
|
||||
Reference in New Issue
Block a user