Amanieu / naked-function

Proc macro implementation of #[naked]
Apache License 2.0
29 stars 5 forks source link

Allow cfg attr to pass through #3

Closed jordanisaacs closed 1 year ago

jordanisaacs commented 1 year ago

Adds the cfg attribute to the whitelist. So you can do conditional compilation.

Amanieu commented 1 year ago

This needs a bit more handling: the macro generates both an extern block and a global_asm!. The cfg needs to be passed on to both.

Also please add a test for this.

jordanisaacs commented 1 year ago

@Amanieu I believe I got the cfg working in both places. I also added a test.

jordanisaacs commented 1 year ago

Should be fixed. Added a line to the docs about cfg. Also updated the test to take into account multiple attributes.

jordanisaacs commented 1 year ago

Also small favor, do you mind pushing a release to cargo once this is merged as I would like to use it in one of my crates. Thanks! this crate is fantastic as I don't need to be on nightly rust :)

Amanieu commented 1 year ago

Publish 0.1.1.