You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

24 lines
527 B

  1. #pragma once
  2. #include <threads.h>
  3. #define ALEN(v) (sizeof(v) / sizeof((v)[0]))
  4. #define min(x, y) ((x) < (y) ? (x) : (y))
  5. #define max(x, y) ((x) > (y) ? (x) : (y))
  6. static inline const char *
  7. thrd_err_as_string(int thrd_err)
  8. {
  9. switch (thrd_err) {
  10. case thrd_success: return "success";
  11. case thrd_busy: return "busy";
  12. case thrd_nomem: return "no memory";
  13. case thrd_timedout: return "timedout";
  14. case thrd_error:
  15. default: return "unknown error";
  16. }
  17. return "unknown error";
  18. }