Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incompatible with stdbool.h #260

Open
emekoi opened this issue Nov 27, 2020 · 0 comments
Open

incompatible with stdbool.h #260

emekoi opened this issue Nov 27, 2020 · 0 comments

Comments

@emekoi
Copy link

emekoi commented Nov 27, 2020

stdbool.h defined bool as _Bool which nimterop doesn't like, leading to cryptic errors like:

Error: unhandled exception: getters.nim(174, 14) `name[0] != '_' and name[^1] != '_'` Identifier 'sapp_touchpoint:_Bool' (nskType) has leading/trailing underscores '_' which Nim does not allow. Use toast flag '--prefix or --suffix' or 'cPlugin()' to modify. [AssertionDefect]

the following workaround is possible:

cPlugin:
  proc onSymbol*(sym: var Symbol) {.exportc, dynlib.} =
    if sym.name == "_Bool": sym.name = "bool"

but it would be nice if nimterop was able to detect cases like this. if that's not a goal i guess maybe this could be added to wiki as a pitfall in case anyone else encounters this problem in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant