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

[C2M] ungetc_func should take a user supplied void pointer argument #25

Closed
dibyendumajumdar opened this issue Dec 26, 2019 · 3 comments
Closed

Comments

@dibyendumajumdar
Copy link
Contributor

The c2mir_compile() takes ungetc_func function as parameter. However ungetc_func() implementation needs to be able to refer to some state in order to work. The standard way to allow the ungetc_func() to access its state is to pass a void * argument which is then passed to ungetc_func().

At the moment the only way for ungetc_func() to work is to access through static lifetime data.

@vnmakarov
Copy link
Owner

OK. I see. Thank you. I'll do it on this week.

@vnmakarov
Copy link
Owner

I've added the state for ungetc_func. Here is the patch https://github.com/vnmakarov/mir/compare/5f91154..f7e73aa

@dibyendumajumdar
Copy link
Contributor Author

@vnmakarov Thank you - much appreciated!

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

2 participants