diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-08-26 20:34:26 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-09-03 20:03:47 +0000 |
commit | 6872c14e1a02445d945623ee6e85230c5d7ecbce (patch) | |
tree | 30d90b93445976e56b96946b6e87b764eddd48a8 /toxcore/mono_time.h | |
parent | d296490a742b226fc17a71cf96ab73fc16719b20 (diff) |
Avoid use of global mutable state in mono_time on win32.
This uses a trick to get read-write access to `this` from a `const`
member function, similar to C++ `mutable`, but uglier.
Diffstat (limited to 'toxcore/mono_time.h')
-rw-r--r-- | toxcore/mono_time.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/mono_time.h b/toxcore/mono_time.h index b735f2c3..c2934d06 100644 --- a/toxcore/mono_time.h +++ b/toxcore/mono_time.h | |||
@@ -50,9 +50,9 @@ uint64_t mono_time_get(const Mono_Time *mono_time); | |||
50 | bool mono_time_is_timeout(const Mono_Time *mono_time, uint64_t timestamp, uint64_t timeout); | 50 | bool mono_time_is_timeout(const Mono_Time *mono_time, uint64_t timestamp, uint64_t timeout); |
51 | 51 | ||
52 | /* return current monotonic time in milliseconds (ms). */ | 52 | /* return current monotonic time in milliseconds (ms). */ |
53 | uint64_t current_time_monotonic(const Mono_Time *mono_time); | 53 | uint64_t current_time_monotonic(Mono_Time *mono_time); |
54 | 54 | ||
55 | typedef uint64_t mono_time_current_time_cb(void *user_data); | 55 | typedef uint64_t mono_time_current_time_cb(Mono_Time *mono_time, void *user_data); |
56 | 56 | ||
57 | /* Override implementation of current_time_monotonic() (for tests). | 57 | /* Override implementation of current_time_monotonic() (for tests). |
58 | * | 58 | * |