github.com/gotranspile/cxgo@v0.3.7/libs/wchar.go (about)

     1  package libs
     2  
     3  import (
     4  	"github.com/gotranspile/cxgo/runtime/libc"
     5  	"github.com/gotranspile/cxgo/types"
     6  )
     7  
     8  const (
     9  	wcharH = "wchar.h"
    10  )
    11  
    12  func init() {
    13  	RegisterLibrary(wcharH, func(c *Env) *Library {
    14  		intT := types.IntT(8)
    15  		return &Library{
    16  			Header: `
    17  #include <` + stddefH + `>
    18  #include <` + wctypeH + `>
    19  int wctob (wint_t wc);
    20  `,
    21  			Imports: map[string]string{
    22  				"libc": RuntimeLibc,
    23  			},
    24  			Idents: map[string]*types.Ident{
    25  				"wctob": c.NewIdent("wctob", "libc.Wctob", libc.Wctob, c.FuncTT(intT, c.C().WChar())),
    26  			},
    27  		}
    28  	})
    29  }