diff options
author | Charlie Gordon <github@chqrlie.org> | 2024-03-22 00:47:17 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-04-14 19:00:24 +0200 |
commit | 07f88ea2a567faf1501af1563de2336c296f7e49 (patch) | |
tree | bc26e76a5150c6c38dec962ec2ddcd8ef5a87a1c /lib/quickjs/cutils.h | |
parent | ffa46fbb1cd4d3104f27d9fe55a0ac5520aa93ca (diff) | |
download | chawan-07f88ea2a567faf1501af1563de2336c296f7e49.tar.gz |
Improve Date.parse, small fixes
- add `minimum_length` to enforce array length validation - add `JS_NewDate()` API - add `[Symbol.toStringTag]` property in the global object - simplify `string_get_milliseconds` - support more timezone abbrevs using `string_get_tzabbr` and array
Diffstat (limited to 'lib/quickjs/cutils.h')
-rw-r--r-- | lib/quickjs/cutils.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/quickjs/cutils.h b/lib/quickjs/cutils.h index 11246e3c..f079e5c5 100644 --- a/lib/quickjs/cutils.h +++ b/lib/quickjs/cutils.h @@ -51,6 +51,12 @@ #define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member))) #endif +#if !defined(_MSC_VER) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#define minimum_length(n) static n +#else +#define minimum_length(n) n +#endif + typedef int BOOL; #ifndef FALSE |