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

Falling back to blunt pre-processor phase #154

Closed
mihails-strasuns-sociomantic opened this issue Jun 20, 2017 · 4 comments
Closed

Falling back to blunt pre-processor phase #154

mihails-strasuns-sociomantic opened this issue Jun 20, 2017 · 4 comments

Comments

@mihails-strasuns-sociomantic
Copy link
Contributor

Experimenting with new dstep features regarding pre-processor (i.e. alias / function translation) I have found it to be causing too much trouble for D1 compatibility case to try patching it. Is there a simple way to disable it (by flag or something) to just run pre-processor blindly same as in earlier dstep versions?

Mostly @ciechowoj question I presume.

@ciechowoj
Copy link
Contributor

You mean you want to disable pre-processing of macros completely?

@ciechowoj
Copy link
Contributor

Just out of curiosity could you give some examples of what would be needed?

@mihails-strasuns-sociomantic
Copy link
Contributor Author

Yeah in old dstep versions it run actual C pre-processor first and only did conversion to D after (== no symbolic constants or type aliases from defines, everything expanded literally). Would be good to have such behaviour as a fallback option available in cases where smart translation fails for any reason.

@ciechowoj
Copy link
Contributor

ciechowoj commented Jul 2, 2017

I looked into the code, and adding such a feature seems as simple as adding single if in one place (and appropriate command to CLI). In particular add the if to translateMacroDefinition function from Translator.d.... I'll create PR when I have some spare time.

ciechowoj added a commit to ciechowoj/dstep that referenced this issue Jul 9, 2017
Adds enabling/disabling macro translation.
ciechowoj added a commit to ciechowoj/dstep that referenced this issue Jul 9, 2017
Adds enabling/disabling macro translation.
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