8 releases

0.1.7 Sep 11, 2023
0.1.6 Sep 11, 2023

#2 in #wasm32-unknown-unknown

Download history 20/week @ 2024-02-18 6/week @ 2024-02-25 1/week @ 2024-03-03 14/week @ 2024-03-10 47/week @ 2024-03-31

61 downloads per month
Used in dav1d-sys-po6

MIT license

14KB
404 lines

po6

A C POSIX library in Rust meant for building C libraries in environments without one (eg. wasm32-unknown-unknown or Windows).

po6 allows you to create "isomorphic" Rust crates for C libraries: these will work in any platform where the Rust standard library runs, allowings APIs such as pthread to work on Windows or wasm-bindgen.

Makes it possible to build C libraries with wasm-bindgen.

Usage

  1. Install it to your build-dependencies:
    $ cargo add po6 --build
    
  2. Use it in your build.rs by adding the output of po6::build to your include paths:
    cc::Build::new()
      .includes(po6::build()?)
    
  3. Use it in your lib.rs by including the generated runtime file:
    mod po6 {
      include!(concat!(env!("OUT_DIR"), "/po6.rs"));
    }
    

No runtime deps