Fix definition of c_bool for non-MSVC targets (#54)

Fixes #53

Signed-off-by: Arnav Singh <me@arnavion.dev>
This commit is contained in:
Arnav Singh 2023-05-10 01:28:12 -07:00 committed by GitHub
parent fd00e12cc5
commit 0fef73074b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,7 +50,14 @@
#![deny(missing_docs, broken_intra_doc_links)]
use libc::{c_char, c_int, c_uint, c_void, size_t};
// jemalloc uses `stdbool.h` to define `bool` for which the Rust equivalent is `bool`.
// However jemalloc also has its own `stdbool.h` that it uses when compiling with MSVC,
// and this header defines `bool` as `BOOL` which in turn is `int`.
#[cfg(target_env = "msvc")]
type c_bool = c_int;
#[cfg(not(target_env = "msvc"))]
type c_bool = bool;
/// Align the memory allocation to start at an address that is a
/// multiple of `1 << la`.