diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-29 20:06:09 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-29 20:06:09 -0400 |
| commit | 05515d8645326efa3db6311f6be1be776452c68a (patch) | |
| tree | 15e58e72fc1aeec61017f02d8bf555e38a8dfda3 /stdlib/optionals.c | |
| parent | 8f7f66d7c894544c7c7e8ffae5d74e3cc602256f (diff) | |
Add DateTime
Diffstat (limited to 'stdlib/optionals.c')
| -rw-r--r-- | stdlib/optionals.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; |
