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
1 changed files with 7 additions and 0 deletions

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`.