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