Example #1
0
/**
 * \brief Return the size of a type in bytes as per C++[expr.sizeof] 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.
 */
func (t Type) SizeOf() (int, error) {
	o := C.clang_Type_getSizeOf(t.c)
	if o < 0 {
		return int(o), TypeLayoutError(o)
	}
	return int(o), nil
}
Example #2
0
/*
	Return the size of a type in bytes as per C++[expr.sizeof] 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.
*/
func (t Type) SizeOf() int64 {
	return int64(C.clang_Type_getSizeOf(t.c))
}