1 #pragma once
2 
3 #include <stdbool.h>
4 #include <stdint.h>
5 
6 #define UNUSED_ATTR __attribute__((unused))
7 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
8 #define INVALID_FD (-1)
9 
10 #define CONCAT(a, b) a##b
11 
12 // Use during compile time to check conditional values
13 // NOTE: The the failures will present as a generic error
14 // "error: initialization makes pointer from integer without a cast"
15 // but the file and line number will present the condition that
16 // failed.
17 #define DUMMY_COUNTER(c) CONCAT(__osi_dummy_, c)
18 #define DUMMY_PTR DUMMY_COUNTER(__COUNTER__)
19 
20 #define COMPILE_ASSERT(x) char * DUMMY_PTR = !(x)
21 
22 typedef uint32_t timeout_t;
23