示例#1
0
文件: type.go 项目: zimmski/go-clang
/**
 * \brief Return the alignment of a type in bytes as per C++[expr.alignof]
 *   standard.
 *
 * If the type declaration is invalid, CXTypeLayoutError_Invalid is returned.
 * If the type declaration is an incomplete type, CXTypeLayoutError_Incomplete
 *   is returned.
 * If the type declaration is a dependent type, CXTypeLayoutError_Dependent is
 *   returned.
 * If the type declaration is not a constant size type,
 *   CXTypeLayoutError_NotConstantSize is returned.
 */
func (t Type) AlignOf() (int, error) {
	o := C.clang_Type_getAlignOf(t.c)
	if o < 0 {
		return int(o), TypeLayoutError(o)
	}
	return int(o), nil
}
示例#2
0
文件: type_gen.go 项目: go-clang/v3.4
/*
	Return the alignment of a type in bytes as per C++[expr.alignof]
	standard.

	If the type declaration is invalid, CXTypeLayoutError_Invalid is returned.
	If the type declaration is an incomplete type, CXTypeLayoutError_Incomplete
	is returned.
	If the type declaration is a dependent type, CXTypeLayoutError_Dependent is
	returned.
	If the type declaration is not a constant size type,
	CXTypeLayoutError_NotConstantSize is returned.
*/
func (t Type) AlignOf() int64 {
	return int64(C.clang_Type_getAlignOf(t.c))
}