#winapi #re-exports #libc

c-types

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

16 releases (stable)

Uses new Rust 2024

6.0.0 Sep 6, 2025
5.0.0 Jun 11, 2025
4.0.0 Aug 2, 2024
3.0.2 Aug 2, 2024
0.1.2 Nov 21, 2015

#6 in #libc

Download history 3610/week @ 2025-10-05 2697/week @ 2025-10-12 2263/week @ 2025-10-19 2964/week @ 2025-10-26 2293/week @ 2025-11-02 2578/week @ 2025-11-09 2709/week @ 2025-11-16 2339/week @ 2025-11-23 1906/week @ 2025-11-30 3009/week @ 2025-12-07 4229/week @ 2025-12-14 1817/week @ 2025-12-21 1267/week @ 2025-12-28 3016/week @ 2026-01-04 3189/week @ 2026-01-11 4050/week @ 2026-01-18

11,647 downloads per month
Used in 21 crates (4 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–3MB
~60K SLoC