Skip to content

Commit 5177532

Browse files
authored
Add Function to C API for Adding Time Spans (#846)
This allows the users of the C API to add multiple time spans together.
1 parent c2e1fa6 commit 5177532

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

capi/src/time_span.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,9 @@ pub extern "C" fn TimeSpan_whole_seconds(this: &TimeSpan) -> i64 {
5656
pub extern "C" fn TimeSpan_subsec_nanoseconds(this: &TimeSpan) -> i32 {
5757
this.to_seconds_and_subsec_nanoseconds().1
5858
}
59+
60+
/// Changes a Time Span by adding a Time Span onto it.
61+
#[no_mangle]
62+
pub extern "C" fn TimeSpan_add_assign(this: &mut TimeSpan, other: &TimeSpan) {
63+
*this += *other;
64+
}

0 commit comments

Comments
 (0)