Skip to content

Commit

Permalink
Fix definition of c_bool for non-MSVC targets (#54)
Browse files Browse the repository at this point in the history
Fixes #53

Signed-off-by: Arnav Singh <me@arnavion.dev>
  • Loading branch information
Arnavion authored May 10, 2023
1 parent fd00e12 commit 0fef730
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions jemalloc-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down

0 comments on commit 0fef730

Please sign in to comment.