Fix #196 - allow remapping of types
This commit is contained in:
parent
ecb5f2ede6
commit
8d4866160e
7 changed files with 38 additions and 5 deletions
|
|
@ -243,6 +243,12 @@ static inline int sitest1(int f1) {
|
|||
return f1 * 2;
|
||||
}
|
||||
|
||||
// Issue #196
|
||||
typedef int MyInt;
|
||||
struct TestMyInt {
|
||||
MyInt f1;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// DUPLICATES
|
||||
|
|
@ -439,6 +445,12 @@ static inline int sitest1(int f1) {
|
|||
return f1 * 2;
|
||||
}
|
||||
|
||||
// Issue #196
|
||||
typedef int MyInt;
|
||||
struct TestMyInt {
|
||||
MyInt f1;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ cOverride:
|
|||
type
|
||||
A1* = A0
|
||||
|
||||
cImport(path, flags="-f:ast2 -ENK_,SDL_ -GVICE=SLICE" & flags)
|
||||
cImport(path, flags="-f:ast2 -ENK_,SDL_ -GVICE=SLICE -TMyInt=cint" & flags)
|
||||
|
||||
proc getPragmas(n: NimNode): HashSet[string] =
|
||||
# Find all pragmas in AST, return as "name" or "name:value" in set
|
||||
|
|
@ -478,3 +478,8 @@ checkPragmas(nested, pHeaderImpBy)
|
|||
when not defined(NOHEADER):
|
||||
assert sitest1(5) == 10
|
||||
assert sitest1(10) == 20
|
||||
|
||||
when declared(MyInt):
|
||||
assert false, "MyInt is defined!"
|
||||
testFields(TestMyInt, "f1!cint")
|
||||
checkPragmas(TestMyInt, pHeaderBy, isType = false)
|
||||
Loading…
Add table
Add a link
Reference in a new issue