[babl/wip/msvc] babl/babl-cache.c: Define S_ISDIR and S_ISREG on Windows
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl/wip/msvc] babl/babl-cache.c: Define S_ISDIR and S_ISREG on Windows
- Date: Mon, 20 Jan 2020 09:58:05 +0000 (UTC)
commit 79dff210ef7b1bd69fd17a2cc639ce1c8bb1526b
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Mon Jan 20 17:07:38 2020 +0800
babl/babl-cache.c: Define S_ISDIR and S_ISREG on Windows
...when we are building for Visual Studio, since these macros are
not defined by Visual Studio's sys/stat.h
babl/babl-cache.c | 8 ++++++++
1 file changed, 8 insertions(+)
---
diff --git a/babl/babl-cache.c b/babl/babl-cache.c
index 7479c9068..8fe6b55f9 100644
--- a/babl/babl-cache.c
+++ b/babl/babl-cache.c
@@ -28,6 +28,14 @@
#ifdef _WIN32
#define FALLBACK_CACHE_PATH "C:/babl-fishes.txt"
+
+#if !defined(S_ISREG) && defined(S_IFMT) && defined(S_IFREG)
+#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#endif
+#if !defined(S_ISDIR) && defined(S_IFMT) && defined(S_IFDIR)
+#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#endif
+
#else
#define FALLBACK_CACHE_PATH "/tmp/babl-fishes.txt"
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]