Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template typeImportC*(typeName: untyped, importC: string, header: string, baseType: typed, decl: untyped): typed =
- when defined(useHeaderImportC):
- type
- typeName {.importC: importC, header: header.} = baseType
- decl
- else:
- type
- typeName = baseType
- decl
- typeImportC(`NimType *`, "NativeType", "imported.h", object):
- f1*: uint
- f2*: uint
- # Should Produce
- when defined(useHeaderImportC):
- type
- NimType* {.importC: "NativeType", header: "imported.h".} = object
- f1*: cint
- f2*: cint
- else:
- type
- NimType* = object
- f1*: cint
- f2*: cint
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement