-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathtypelayouterror.go
66 lines (53 loc) · 1.38 KB
/
typelayouterror.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package clang
// #include <stdlib.h>
// #include "go-clang.h"
import "C"
import (
"fmt"
)
/**
* \brief List the possible error codes for \c clang_Type_getSizeOf,
* \c clang_Type_getAlignOf, \c clang_Type_getOffsetOf and
* \c clang_Cursor_getOffsetOf.
*
* A value of this enumeration type can be returned if the target type is not
* a valid argument to sizeof, alignof or offsetof.
*/
type TypeLayoutError int
const (
/**
* \brief Type is of kind CXType_Invalid.
*/
TLE_Invalid TypeLayoutError = C.CXTypeLayoutError_Invalid
/**
* \brief The type is an incomplete Type.
*/
TLE_Incomplete = C.CXTypeLayoutError_Incomplete
/**
* \brief The type is a dependent Type.
*/
TLE_Dependent = C.CXTypeLayoutError_Dependent
/**
* \brief The type is not a constant size type.
*/
TLE_NotConstantSize = C.CXTypeLayoutError_NotConstantSize
/**
* \brief The Field name is not valid for this record.
*/
TLE_InvalidFieldName = C.CXTypeLayoutError_InvalidFieldName
)
func (tle TypeLayoutError) Error() string {
switch tle {
case TLE_Invalid:
return "TypeLayout=Invalid"
case TLE_Incomplete:
return "TypeLayout=Incomplete"
case TLE_Dependent:
return "TypeLayout=Dependent"
case TLE_NotConstantSize:
return "TypeLayout=NotConstantSize"
case TLE_InvalidFieldName:
return "TypeLayout=InvalidFieldName"
}
return fmt.Sprintf("TypeLayout=unknown (%d)", int(tle))
}