diff --git a/src/epoll.c b/src/epoll.c index 0cb3618..6c592a4 100644 --- a/src/epoll.c +++ b/src/epoll.c @@ -8,19 +8,13 @@ #include "error.h" #include "nt.h" #include "tree.h" +#include "util.h" #include "win.h" #ifndef SIO_BASE_HANDLE #define SIO_BASE_HANDLE 0x48000022 #endif -#ifndef _SSIZE_T_DEFINED -#define SSIZE_T_DEFINED -typedef intptr_t ssize_t; -#endif - -#define ARRAY_COUNT(a) (sizeof(a) / (sizeof((a)[0]))) - #define EPOLL__EVENT_MASK 0xffff #define EPOLL__SOCK_LISTED 0x1 diff --git a/src/util.h b/src/util.h new file mode 100644 index 0000000..982d86d --- /dev/null +++ b/src/util.h @@ -0,0 +1,11 @@ +#ifndef EPOLL_UTIL_H_ +#define EPOLL_UTIL_H_ + +#ifndef _SSIZE_T_DEFINED +#define SSIZE_T_DEFINED +typedef intptr_t ssize_t; +#endif + +#define ARRAY_COUNT(a) (sizeof(a) / (sizeof((a)[0]))) + +#endif /* EPOLL_UTIL_H_ */