builder: replace single `goto start` usage, with `for { ... continue ... break}`
parent
c5cd53ca79
commit
394e9c4c56
|
@ -225,9 +225,9 @@ fn (mut v Builder) cc() {
|
|||
//
|
||||
mut tried_compilation_commands := []string{}
|
||||
original_pwd := os.getwd()
|
||||
// TODO remove the start: goto start construct;
|
||||
// use a labeled for break instead
|
||||
start:
|
||||
for {
|
||||
// try to compile with the choosen compiler
|
||||
// if compilation fails, retry again with another
|
||||
mut ccompiler := v.pref.ccompiler
|
||||
$if windows {
|
||||
if ccompiler == 'msvc' {
|
||||
|
@ -560,7 +560,7 @@ fn (mut v Builder) cc() {
|
|||
}
|
||||
eprintln('recompilation with tcc failed; retrying with cc ...')
|
||||
v.pref.ccompiler = pref.default_c_compiler()
|
||||
goto start
|
||||
continue
|
||||
}
|
||||
if res.exit_code == 127 {
|
||||
verror('C compiler error, while attempting to run: \n' +
|
||||
|
@ -577,6 +577,8 @@ fn (mut v Builder) cc() {
|
|||
println('$ccompiler took $diff ms')
|
||||
println('=========\n')
|
||||
}
|
||||
break
|
||||
}
|
||||
// Link it if we are cross compiling and need an executable
|
||||
/*
|
||||
if v.os == .linux && !linux_host && v.pref.build_mode != .build {
|
||||
|
|
Loading…
Reference in New Issue