From 05515d8645326efa3db6311f6be1be776452c68a Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 29 Sep 2024 20:06:09 -0400 Subject: Add DateTime --- stdlib/optionals.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'stdlib/optionals.c') diff --git a/stdlib/optionals.c b/stdlib/optionals.c index 717a1e0c..15f93846 100644 --- a/stdlib/optionals.c +++ b/stdlib/optionals.c @@ -5,10 +5,11 @@ #include "bools.h" #include "bytes.h" #include "datatypes.h" +#include "datetime.h" #include "integers.h" #include "metamethods.h" -#include "threads.h" #include "text.h" +#include "threads.h" #include "util.h" public PUREFUNC bool is_null(const void *obj, const TypeInfo *non_optional_type) @@ -31,6 +32,8 @@ public PUREFUNC bool is_null(const void *obj, const TypeInfo *non_optional_type) return ((OptionalByte_t*)obj)->is_null; else if (non_optional_type == &Thread$info) return *(pthread_t**)obj == NULL; + else if (non_optional_type == &DateTime$info) + return ((OptionalDateTime_t*)obj)->tv_usec < 0; switch (non_optional_type->tag) { case ChannelInfo: return *(Channel_t**)obj == NULL; -- cgit v1.2.3