diff --git a/src/afd.h b/src/afd.h index f56791b..0b7e27e 100644 --- a/src/afd.h +++ b/src/afd.h @@ -1,9 +1,8 @@ #ifndef EPOLL_AFD_H_ #define EPOLL_AFD_H_ -#include - #include "nt.h" +#include "win.h" #ifndef SIO_BASE_HANDLE #define SIO_BASE_HANDLE 0x48000022 diff --git a/src/epoll.c b/src/epoll.c index 777d4b3..9505615 100644 --- a/src/epoll.c +++ b/src/epoll.c @@ -1,7 +1,3 @@ -#define WIN32_LEAN_AND_MEAN -#include -#include - #include #include #include @@ -11,6 +7,7 @@ #include "epoll.h" #include "error.h" #include "tree.h" +#include "win.h" #ifndef _SSIZE_T_DEFINED #define SSIZE_T_DEFINED diff --git a/src/error.c b/src/error.c index 9a32c17..ef7ecee 100644 --- a/src/error.c +++ b/src/error.c @@ -1,10 +1,7 @@ -#define WIN32_LEAN_AND_MEAN -#include -#include - #include #include "error-map.h" +#include "win.h" #pragma warning(push) #pragma warning(disable : 4127) /* "conditional expression is constant" */ diff --git a/src/nt.h b/src/nt.h index 69052ca..3204301 100644 --- a/src/nt.h +++ b/src/nt.h @@ -1,7 +1,7 @@ #ifndef EPOLL_NT_H_ #define EPOLL_NT_H_ -#include +#include "win.h" #ifndef _NTDEF_ typedef LONG NTSTATUS; diff --git a/src/win.h b/src/win.h new file mode 100644 index 0000000..995f5e9 --- /dev/null +++ b/src/win.h @@ -0,0 +1,12 @@ +#ifndef EPOLL_WIN_H_ +#define EPOLL_WIN_H_ + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#include +#include +#include + +#endif diff --git a/test/test-udp-pings.c b/test/test-udp-pings.c index 3109ba7..7136e58 100644 --- a/test/test-udp-pings.c +++ b/test/test-udp-pings.c @@ -1,10 +1,7 @@ -#include -#include -#include - #include #include +#include "win.h" #include "epoll.h" static const char PING[] = "PING";