You can use define the CSIZE a couple times in your file, with conditional
compilation: http://doc.rust-lang.org/rust.html#conditional-compilation


On Sun, Sep 7, 2014 at 6:03 PM, Fox, Michael <michael....@caviumnetworks.com
> wrote:

> How can FFI work across platforms unless you compile against the specific
> platform’s headers?
>
> Sometimes a common header defines the same-named structure, type or macro
> differently depending on your platform.
>
> For example, here’s a definition from termios.h on OSX:
>
>  #define CSIZE       0x00000300  /* character size mask */
>
> And here’s the same one on some old Linux:
>
>  #define CSIZE   0000060
>
> So, you can’t just take one of them and define it like:
>
>   pub static CSIZE: ulong_t = 0x300;
>
> I don’t see how it can work unless you embed a C compiler which reads and
> uses the actual platform’s headers.
> _______________________________________________
> Rust-dev mailing list
> Rust-dev@mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
>
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to