#conditional-compilation #cross-platform #winapi #libc #re-exports #type #windows

c-types

Re-exports of cross-platform types, gathered from libc and winapi

14 releases (9 stable)

Uses old Rust 2015

4.0.0 Aug 2, 2024
3.0.2 Aug 2, 2024
3.0.1 Dec 1, 2023
3.0.0 Oct 21, 2023
0.1.2 Nov 21, 2015

#4 in #re-exports

Download history 722/week @ 2024-07-17 1136/week @ 2024-07-24 1219/week @ 2024-07-31 959/week @ 2024-08-07 1287/week @ 2024-08-14 899/week @ 2024-08-21 962/week @ 2024-08-28 1084/week @ 2024-09-04 691/week @ 2024-09-11 1110/week @ 2024-09-18 980/week @ 2024-09-25 1032/week @ 2024-10-02 1346/week @ 2024-10-09 856/week @ 2024-10-16 965/week @ 2024-10-23 827/week @ 2024-10-30

4,426 downloads per month
Used in 13 crates (3 directly)

MIT license

6KB

rust-c-types

Re-exports types defined in both libc and winapi, to reduce the amount of conditional compilation required in your code. Stop having to write code like this:

#[cfg(unix)]
use libc::some_type;

#[cfg(windows)]
use winapi::some_type;

Instead, write code like this:

use c_types::some_type;

Crates.io Build Status

Documentation

API documentation is here.

Contributing

This crate is non-exhaustive - I add types to it as and when I need them for my own projects.

If there's a type that could be included but isn't, there should be no problem adding it. Please open an issue or, even better, send a pull request.

Dependencies

~0–7.5MB
~58K SLoC