summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhao Zhili <zhilizhao@tencent.com>2023-01-11 17:00:35 +0800
committerZhao Zhili <zhilizhao@tencent.com>2023-01-12 20:52:37 +0800
commite30bf5acee1ae07724196c44b6b457cd9f8c94f3 (patch)
tree1a8cb8d96cf0fc1dd4aa7962a6e4d2c7d26cbbaf
parent379e43e6ec4a7da692be3c7b8039e6c716adbf68 (diff)
avformat/file: add S_IFBLK/S_ISBLK compatability macro
They are not available on Windows. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
-rw-r--r--libavformat/file.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libavformat/file.c b/libavformat/file.c
index d20208e31f..cbdf48de0a 100644
--- a/libavformat/file.c
+++ b/libavformat/file.c
@@ -68,6 +68,24 @@
# endif
#endif
+/* S_ISREG not available on Windows */
+#ifndef S_ISREG
+# ifdef S_IFREG
+# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+# else
+# define S_ISREG(m) 0
+# endif
+#endif
+
+/* S_ISBLK not available on Windows */
+#ifndef S_ISBLK
+# ifdef S_IFBLK
+# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
+# else
+# define S_ISBLK(m) 0
+# endif
+#endif
+
/* standard file protocol */
typedef struct FileContext {