diff --git a/src/context.c b/src/context.c index 71c2275..5701a74 100644 --- a/src/context.c +++ b/src/context.c @@ -29,15 +29,6 @@ #include #include #include -#ifdef _MSC_VER -# include -# include -# ifndef S_ISDIR -# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -# endif -#else -# include -#endif #include "xkbcommon/xkbcommon.h" #include "utils.h" diff --git a/src/utils.h b/src/utils.h index 7557dab..c263635 100644 --- a/src/utils.h +++ b/src/utils.h @@ -31,13 +31,21 @@ #include #include #if HAVE_UNISTD_H -#include +# include #else /* Required on Windows where unistd.h doesn't exist */ -#define R_OK 4 /* Test for read permission. */ -#define W_OK 2 /* Test for write permission. */ -#define X_OK 1 /* Test for execute permission. */ -#define F_OK 0 /* Test for existence. */ +# define R_OK 4 /* Test for read permission. */ +# define W_OK 2 /* Test for write permission. */ +# define X_OK 1 /* Test for execute permission. */ +# define F_OK 0 /* Test for existence. */ +#endif + +#ifdef _MSC_VER +# include +# include +# ifndef S_ISDIR +# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +# endif #endif #include "darray.h" diff --git a/test/context.c b/test/context.c index f91be54..9f6cad7 100644 --- a/test/context.c +++ b/test/context.c @@ -30,15 +30,6 @@ #include #include -#ifdef _MSC_VER -# include -# include -# ifndef S_ISDIR -# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -# endif -#else -# include -#endif /* keeps a cache of all makedir/maketmpdir directories so we can free and * rmdir them in one go, see unmakedirs() */