Closed LucasMW closed 5 years ago
Hello, @LucasMW Generally MacOs is not supported.
@Konstantin8105 c4go does not support MacOs? That is sad. I've managed to make the program run by removing content. I removed the content of sputc (which wasn't used) and removed several unused headers. It worked, but I had to do it manually. I think c4go is actually close to supporting MacOs.
Yes, you right. MacOS use to many specific. I recomend use project https://github.com/elliotchance/c2go for MacOs.
Why does have Transpiler works on linux and Mac machines
in readme then?
Also, the fact it's failing on Darwin stdio doesn't mean Darwin stdio is bad, it means that c4go can't handle it -- and same error can happen in the code being transpiled on linux too.
Thank you @stek29, I will fix , because Mac is not support.
Compiler message: syntax error: unexpected =, expecting )
in function sputc / __sputc - transpiled function from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/stdio.h:264
The syntax error is in this line: }())[0] = uint8(_c)))
The whole function: func __sputc(_c int, _p noarch.File) (c4goDefaultReturn int) { if func() int { tempVar := &_p[0]._w tempVar -- defer func() { }() return tempVar }() >= 0 || _p[0]._w >= _p[0]._lbfsize && int(byte(_c)) != int('\n') { return int(((func() []uint8 { tempVar := &_p[0]._p defer func() { tempVar ++ }() return tempVar }())[0] = uint8(_c))) // Warning (ast.MemberExpr): /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/stdio.h:265 :cannot determine type for LHS 'FILE ', will use 'void ' for all fields. Is lvalue = true. n.Name = _w // Warning (ast.MemberExpr): /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/stdio.h:265 :cannot determine type for LHS 'FILE ', will use 'void ' for all fields. Is lvalue = true. n.Name = _lbfsize // Warning (ast.MemberExpr): /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/stdio.h:265 :cannot determine type for LHS 'FILE ', will use 'void ' for all fields. Is lvalue = true. n.Name = _w // Warning (ast.MemberExpr): /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/stdio.h:265 :cannot determine type for LHS 'FILE ', will use 'void ' for all fields. Is lvalue = true. n.Name = _lbfsize // Warning (ast.MemberExpr): /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/stdio.h:266 :cannot determine type for LHS 'FILE ', will use 'void ' for all fields. Is lvalue = true. n.Name = _p } else { return (__swbuf(_c, _p)) } return }