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

Cast to const user-defined (pointer) types in macro expressions #261

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Cast to const user-defined (pointer) types in macro expressions #261

wants to merge 1 commit into from

Conversation

cbecerescu
Copy link
Contributor

No description provided.

&& isType(tokens[1..$])
&& ((tokens[0] == Token(Token.Kind.Keyword, "const")
&& isType(tokens[1..$]))
|| (tokens[$-1] == Token(Token.Kind.Keyword, "const")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sure that we treat all the cases with const + pointers, and view them as casts.

However, DPP does not currently translate the C cast within a macro. So that means that "(struct foo const *)" or "(struct foo * const)" are not going to be translated to valid D types (although now they are at least going to be seen as casts)

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

Successfully merging this pull request may close these issues.

1 participant