utils: move some MSVC compat stuff to common place

Signed-off-by: Ran Benita <ran@unusedvar.com>
master
Ran Benita 2022-09-24 10:37:06 +03:00
parent b309514247
commit 4d8293901b
3 changed files with 13 additions and 23 deletions

View File

@ -29,15 +29,6 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <errno.h> #include <errno.h>
#ifdef _MSC_VER
# include <direct.h>
# include <io.h>
# ifndef S_ISDIR
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
# endif
#else
# include <unistd.h>
#endif
#include "xkbcommon/xkbcommon.h" #include "xkbcommon/xkbcommon.h"
#include "utils.h" #include "utils.h"

View File

@ -40,6 +40,14 @@
# define F_OK 0 /* Test for existence. */ # define F_OK 0 /* Test for existence. */
#endif #endif
#ifdef _MSC_VER
# include <direct.h>
# include <io.h>
# ifndef S_ISDIR
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
# endif
#endif
#include "darray.h" #include "darray.h"
#define STATIC_ASSERT(expr, message) do { \ #define STATIC_ASSERT(expr, message) do { \

View File

@ -30,15 +30,6 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef _MSC_VER
# include <io.h>
# include <direct.h>
# ifndef S_ISDIR
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
# endif
#else
# include <unistd.h>
#endif
/* keeps a cache of all makedir/maketmpdir directories so we can free and /* keeps a cache of all makedir/maketmpdir directories so we can free and
* rmdir them in one go, see unmakedirs() */ * rmdir them in one go, see unmakedirs() */