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

conditional compilation #2

Open
chuqingr opened this issue Dec 13, 2023 · 2 comments
Open

conditional compilation #2

chuqingr opened this issue Dec 13, 2023 · 2 comments

Comments

@chuqingr
Copy link

Hi,
I've been studying this recently, and I've come across a tricky question。How do you use conditional compilation in rust? For example, attribute((annotate("annotation")) in c++?

@joaovarelas
Copy link
Owner

joaovarelas commented Dec 13, 2023 via email

@chuqingr
Copy link
Author

Hello,Thanks for your reply. At present, it seems that #[cfg_attr] & #[cfg] can't take effect. proc_macro may be needed, but it is troublesome to use
https://github.com/rust-lang/rfcs/blob/master/text/1566-proc-macros.md

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