diff options
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; |
