Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions crates/rb-sys/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,3 +341,31 @@ pub unsafe fn RTYPEDDATA_TYPE(obj: VALUE) -> *const rb_data_type_t {
pub unsafe fn RTYPEDDATA_GET_DATA(obj: VALUE) -> *mut c_void {
api().rtypeddata_get_data(obj)
}

/// Checks if the bignum is positive.
///
/// @param[in] b An object of RBignum.
/// @retval false `b` is less than zero.
/// @retval true Otherwise.
///
/// # Safety
/// This function is unsafe because it could dereference a raw pointer when
/// accessing the underlying bignum structure.
#[inline]
pub unsafe fn RBIGNUM_POSITIVE_P(b: VALUE) -> bool {
api().bignum_positive_p(b)
}

/// Checks if the bignum is negative.
///
/// @param[in] b An object of RBignum.
/// @retval true `b` is less than zero.
/// @retval false Otherwise.
///
/// # Safety
/// This function is unsafe because it could dereference a raw pointer when
/// accessing the underlying bignum structure.
#[inline]
pub unsafe fn RBIGNUM_NEGATIVE_P(b: VALUE) -> bool {
api().bignum_negative_p(b)
}
Loading