type C.bool is undfined
Environment:
tinygo version: 0.30.0 operating System: macOS architecture: aarch64
Description:
Compilation brakes with an undefined C._Bool
Steps to reproduce:
Given the following Go-code:
package main
/*
#include "stdbool.h"
*/
import "C"
import "fmt"
func main() {
fmt.Printf("%s", C.bool(true))
}
Run
tinygo run main.go
Expected behavior:
❯ tinygo run main.go
%!s(main._Ctype__Bool=true)%
Actual behavior:
❯ tinygo run main.go
# command-line-arguments
../../../../opt/homebrew/Cellar/tinygo/0.30.0/lib/clang/include/stdbool.h:20:14: undefined: C._Bool
I´m not SW expert, but searching this argument - #include "stdbool.h" , I found this:
#include <stdbool.h> (In Go, this syntax is different)
https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html
The difference between "stdbool.h" and <stdbool.H> is searching path. However it doesn't matter on this case. <stdbool.H> failed too.
This was corrected in https://github.com/tinygo-org/tinygo/pull/3928 which will be part of the next release.
@deadprogram I tested with dev branch. This case still failed.
Completed with v0.31.0 so now closing. Thank you!