From 786e67f1892b9378078d7acd7f69927ad4a342b6 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 15 Nov 2019 20:28:24 +0000 Subject: [PATCH] u/time: Mark exported functions as C to get even better errors --- src/xrt/auxiliary/util/u_time.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/xrt/auxiliary/util/u_time.cpp b/src/xrt/auxiliary/util/u_time.cpp index b2b4d2193..e5f12ea38 100644 --- a/src/xrt/auxiliary/util/u_time.cpp +++ b/src/xrt/auxiliary/util/u_time.cpp @@ -41,7 +41,7 @@ MatchingTimePoints::getTimestamp(time_state const &prevState) return prevState.lastTime + duration_cast(elapsed).count(); } -struct time_state * +extern "C" struct time_state * time_state_create() { @@ -49,13 +49,13 @@ time_state_create() return state; } -void -time_state_destroy(struct time_state *state) +extern "C" void +time_state_destroy(struct time_state **state_ptr) { delete state; } -timepoint_ns +extern "C" timepoint_ns time_state_get_now(struct time_state const *state) { assert(state != NULL); @@ -64,7 +64,7 @@ time_state_get_now(struct time_state const *state) return now.getTimestamp(*state); } -timepoint_ns +extern "C" timepoint_ns time_state_get_now_and_update(struct time_state *state) { assert(state != NULL); @@ -79,7 +79,7 @@ time_state_get_now_and_update(struct time_state *state) return timestamp; } -void +extern "C" void time_state_to_timespec(struct time_state const *state, timepoint_ns timestamp, struct timespec *out) @@ -104,7 +104,7 @@ time_state_to_timespec(struct time_state const *state, } -timepoint_ns +extern "C" timepoint_ns time_state_from_timespec(struct time_state const *state, const struct timespec *timespecTime) {