-
Notifications
You must be signed in to change notification settings - Fork 41
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
Consider expanding through an indirect macro #25
Comments
I'm not personally too keen on adding compatibility code to this crate to be compatible so far back, so I'm going to go ahead and close this. If there's a PR though and it's relatively self-contained I'd be happy to review! I would prefer to not have an outstanding open issue for this, though. |
@alexcrichton Note that |
@ogoffart FWIW I tried your approach here with |
@alexcrichton right, repr(align(16)) was just an example, but this is true for anyone trying to use features to gate code using grammar that is only available in a newer version of rust. @gnzlbg right: becuase the the code need to be parsed as an item to be mached b the |
btw, you don't really need cfg_if, the identity macro alone does the trick. |
Oh nice @ogoffart! Want to send a PR with that? That looks like a small enough change and also looks to enable |
FWIW @ogoffart implementation works correctly for libc at least. |
Using the |
See rust-lang/rfcs#2523 (comment), where @ogoffart mentions that:
Currently in libc we can't write:
because older libsyntax versions chuckle on the
align(16)
(https://rust.godbolt.org/z/eZYANH). It would be nice ifcfg_if!
could be improved with such an indirect macro approach to make that work.The text was updated successfully, but these errors were encountered: