illicitonion / num_enum

Apache License 2.0
264 stars 34 forks source link

Problem with no_std #130

Closed vlabo closed 1 year ago

vlabo commented 1 year ago

Im trying to add no_std support to the ntstatus which is using num_enum. But Im having trouble with the compilation. After looking at the generated code with cargo expand I think the issue is that the generated code is using macros from std

#![feature(prelude_import)]
#[prelude_import]
use std::prelude::rust_2021::*;

#[macro_use]
extern crate std;

#[cfg(feature = "std")]
extern crate std;
pub mod ntstatus {
    use num_enum::TryFromPrimitive;
    #[repr(u32)]
    #[allow(non_camel_case_types)]
    pub enum NtStatus {
...

Is this the issue? Wanted to create a PR but Im still noob at reading rust preprocessor code.

Here is a link to the repo https://github.com/vlabo/ntstatus/tree/08a3ae5ea460a950cd85f3cf93bd03cbb450f943

vlabo commented 1 year ago

Sorry It was my error.