Skip to content

Commit

Permalink
Add Function to C API for Adding Time Spans (#846)
Browse files Browse the repository at this point in the history
This allows the users of the C API to add multiple time spans together.
  • Loading branch information
CryZe authored Oct 24, 2024
1 parent c2e1fa6 commit 5177532
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions capi/src/time_span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,9 @@ pub extern "C" fn TimeSpan_whole_seconds(this: &TimeSpan) -> i64 {
pub extern "C" fn TimeSpan_subsec_nanoseconds(this: &TimeSpan) -> i32 {
this.to_seconds_and_subsec_nanoseconds().1
}

/// Changes a Time Span by adding a Time Span onto it.
#[no_mangle]
pub extern "C" fn TimeSpan_add_assign(this: &mut TimeSpan, other: &TimeSpan) {
*this += *other;
}

0 comments on commit 5177532

Please sign in to comment.