diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-03-15 14:10:24 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-03-15 14:10:24 -0400 |
| commit | 7a2653501310825e02d99d51fb4b9f1aacc75214 (patch) | |
| tree | 7225f6b82e52171f1b9f1ab593333e28595f816b /stdlib | |
| parent | 1dd5e726dc31d22a95234f1f4384421c2ca53a05 (diff) | |
Bugfix optional moments
Diffstat (limited to 'stdlib')
| -rw-r--r-- | stdlib/moments.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/stdlib/moments.c b/stdlib/moments.c index 1fadd2e8..bb3d70a9 100644 --- a/stdlib/moments.c +++ b/stdlib/moments.c @@ -50,6 +50,11 @@ PUREFUNC public int32_t Moment$compare(const void *va, const void *vb, const Typ return (a->tv_usec > b->tv_usec) - (a->tv_usec < b->tv_usec); } +CONSTFUNC public bool Moment$is_none(const void *m, const TypeInfo_t*) +{ + return ((Moment_t*)m)->tv_usec < 0; +} + public Moment_t Moment$now(void) { struct timespec ts; @@ -311,6 +316,7 @@ public const TypeInfo_t Moment$info = { .metamethods={ .as_text=Moment$as_text, .compare=Moment$compare, + .is_none=Moment$is_none, }, }; |
