Skip to content

Commit

Permalink
fixed enums
Browse files Browse the repository at this point in the history
Signed-off-by: Julia DeMille <me@jdemille.com>
  • Loading branch information
judemille committed Feb 28, 2024
1 parent 74e00f9 commit 0da9df3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sdk
Submodule sdk updated from 5f960b to 94acd1
14 changes: 8 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@

use std::fmt::Debug;

use core::ffi::c_uint;

use bitfield::{bitfield_bitrange, bitfield_debug, bitfield_fields};

include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

bitfield_bitrange! {struct XPLMDataTypeID(u32)}
bitfield_bitrange! {struct XPLMDataTypeID(c_uint)}
impl XPLMDataTypeID {
bitfield_fields! {
u32;
c_uint;
pub int, _ : 0;
pub float, _ : 1;
pub double, _ : 2;
Expand All @@ -39,10 +41,10 @@ impl Debug for XPLMDataTypeID {
}
}

bitfield_bitrange! {struct XPLMKeyFlags(u32)}
bitfield_bitrange! {struct XPLMKeyFlags(c_uint)}
impl XPLMKeyFlags {
bitfield_fields! {
u32;
c_uint;
pub shift, _ : 0;
pub option_alt, _ : 1;
pub ctrl, _ : 2;
Expand All @@ -64,10 +66,10 @@ impl Debug for XPLMKeyFlags {
}
}

bitfield_bitrange! {struct XPLMNavType(u32)}
bitfield_bitrange! {struct XPLMNavType(c_uint)}
impl XPLMNavType {
bitfield_fields! {
u32;
c_uint;
pub airport, _ : 0;
pub ndb, _ : 1;
pub vor, _ : 2;
Expand Down

0 comments on commit 0da9df3

Please sign in to comment.