diff --git a/include/bits/sys/time.h b/include/bits/sys/time.h deleted file mode 100644 index 73b0683f5c..0000000000 --- a/include/bits/sys/time.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef _BITS_SYS_TIME -#define _BITS_SYS_TIME - -#define timeradd(x,y,res) (void) (\ - (res)->tv_sec = (x)->tv_sec + (y)->tv_sec + (((x)->tv_usec + (y)->tv_usec) / 1000000), \ - (res)->tv_usec = ((x)->tv_usec + (y)->tv_usec) % 1000000 \ - ) -#define timersub(x,y,res) (void) ( \ - (res)->tv_sec = (x)->tv_sec - (y)->tv_sec, \ - (res)->tv_usec = ((x)->tv_usec - (y)->tv_usec), \ - ((res)->tv_usec < 0) && ((res)->tv_sec -= 1, (res)->tv_usec += 1000000) \ - ) -#define timerclear(t) (void) ( \ - (t)->tv_sec = 0, \ - (t)->tv_usec = 0 \ - ) -#define timerisset(t) ((t)->tv_sec || (t)->tv_usec) -#define timercmp(x,y,op) ((x)->tv_sec == (y)->tv_sec ? \ - (x)->tv_usec op (y)->tv_usec \ - : \ - (x)->tv_sec op (y)->tv_sec) - -#endif diff --git a/src/header/sys_time/cbindgen.toml b/src/header/sys_time/cbindgen.toml index dea065fa69..5756a47625 100644 --- a/src/header/sys_time/cbindgen.toml +++ b/src/header/sys_time/cbindgen.toml @@ -1,9 +1,28 @@ -sys_includes = ["sys/types.h", "features.h", "sys/select.h"] +# sys/types.h brings in features.h (needed for #[deprecated] annotations) +sys_includes = ["sys/types.h", "sys/select.h"] include_guard = "_SYS_TIME_H" language = "C" after_includes = """ #include // for timespec -#include + +#define timeradd(x,y,res) (void) (\ + (res)->tv_sec = (x)->tv_sec + (y)->tv_sec + (((x)->tv_usec + (y)->tv_usec) / 1000000), \ + (res)->tv_usec = ((x)->tv_usec + (y)->tv_usec) % 1000000 \ + ) +#define timersub(x,y,res) (void) ( \ + (res)->tv_sec = (x)->tv_sec - (y)->tv_sec, \ + (res)->tv_usec = ((x)->tv_usec - (y)->tv_usec), \ + ((res)->tv_usec < 0) && ((res)->tv_sec -= 1, (res)->tv_usec += 1000000) \ + ) +#define timerclear(t) (void) ( \ + (t)->tv_sec = 0, \ + (t)->tv_usec = 0 \ + ) +#define timerisset(t) ((t)->tv_sec || (t)->tv_usec) +#define timercmp(x,y,op) ((x)->tv_sec == (y)->tv_sec ? \ + (x)->tv_usec op (y)->tv_usec \ + : \ + (x)->tv_sec op (y)->tv_sec) """ style = "Tag" no_includes = true