minor tcc fixes

pull/1728/head
Alexander Medvednikov 2019-07-08 03:42:36 +02:00
parent 4c07df6a21
commit cd10890258
4 changed files with 8 additions and 4 deletions

View File

@ -47,7 +47,7 @@ fn (p mut Parser) comp_time() {
} }
if_returns := p.returns if_returns := p.returns
p.returns = false p.returns = false
p.gen('/* returns $p.returns */') //p.gen('/* returns $p.returns */')
if p.tok == .dollar && p.peek() == .key_else { if p.tok == .dollar && p.peek() == .key_else {
p.next() p.next()
p.next() p.next()
@ -57,7 +57,7 @@ fn (p mut Parser) comp_time() {
p.genln('#endif') p.genln('#endif')
else_returns := p.returns else_returns := p.returns
p.returns = if_returns && else_returns p.returns = if_returns && else_returns
p.gen('/* returns $p.returns */') //p.gen('/* returns $p.returns */')
} }
} }
else if p.tok == .key_for { else if p.tok == .key_for {

View File

@ -124,7 +124,7 @@ fn (p mut Parser) fn_decl() {
p.next() p.next()
} }
p.returns = false p.returns = false
p.gen('/* returns $p.returns */') //p.gen('/* returns $p.returns */')
p.next() p.next()
mut f := new_fn(p.mod, is_pub) mut f := new_fn(p.mod, is_pub)
// Method receiver // Method receiver

View File

@ -802,6 +802,9 @@ fn new_v(args[]string) *V {
cflags: cflags cflags: cflags
ccompiler: find_c_compiler() ccompiler: find_c_compiler()
} }
if pref.is_verbose || pref.is_debug {
println('C compiler=$pref.ccompiler')
}
if pref.is_play { if pref.is_play {
println('Playground') println('Playground')
} }

View File

@ -33,7 +33,8 @@ pub fn ptr_str(ptr voidptr) string {
// compare floats using C epsilon // compare floats using C epsilon
pub fn (a f64) eq(b f64) bool { pub fn (a f64) eq(b f64) bool {
return C.fabs(a - b) <= C.DBL_EPSILON //return C.fabs(a - b) <= C.DBL_EPSILON
return (a - b) <= C.DBL_EPSILON
} }
// fn (nn i32) str() string { // fn (nn i32) str() string {