github.com/gotranspile/cxgo@v0.3.7/libs/stdbool.go (about) 1 package libs 2 3 import "github.com/gotranspile/cxgo/types" 4 5 const ( 6 stdboolH = "stdbool.h" 7 ) 8 9 func init() { 10 RegisterLibrary(stdboolH, func(c *Env) *Library { 11 return &Library{ 12 Types: map[string]types.Type{ 13 "bool": types.BoolT(), 14 }, 15 Idents: map[string]*types.Ident{ 16 "true": types.NewIdentGo("true", "true", types.BoolT()), 17 "false": types.NewIdentGo("false", "false", types.BoolT()), 18 }, 19 Header: ` 20 #define bool _Bool 21 #define false 0 22 #define true 1 23 #define __bool_true_false_are_defined 24 `, 25 ForceMacros: map[string]bool{ 26 "bool": true, 27 "false": true, 28 "true": true, 29 }, 30 } 31 }) 32 }