added hcl_add_ntime()/hcl_sub_ntime()

This commit is contained in:
2020-09-03 06:21:01 +00:00
parent 52aa942508
commit e8ac460f59
3 changed files with 147 additions and 2 deletions

View File

@ -564,11 +564,18 @@ typedef struct hcl_obj_t* hcl_oop_t;
#define HCL_SEC_TO_USEC(sec) ((sec) * HCL_USECS_PER_SEC)
#define HCL_USEC_TO_SEC(usec) ((usec) / HCL_USECS_PER_SEC)
#if defined(HCL_SIZEOF_INT64_T) && (HCL_SIZEOF_INT64_T > 0)
typedef hcl_int64_t hcl_ntime_sec_t;
#else
typedef hcl_int32_t hcl_ntime_sec_t;
#endif
typedef hcl_int32_t hcl_ntime_nsec_t;
typedef struct hcl_ntime_t hcl_ntime_t;
struct hcl_ntime_t
{
hcl_intptr_t sec;
hcl_int32_t nsec; /* nanoseconds */
hcl_ntime_sec_t sec;
hcl_ntime_nsec_t nsec; /* nanoseconds */
};
#define HCL_INIT_NTIME(c,s,ns) (((c)->sec = (s)), ((c)->nsec = (ns)))