diff mbox series

[FFmpeg-devel] avformat/file: add S_IFBLK/S_ISBLK compatability macro

Message ID tencent_70413FCF57BB9D96E08E5A5C34D780703409@qq.com
State Accepted
Commit e30bf5acee1ae07724196c44b6b457cd9f8c94f3
Headers show
Series [FFmpeg-devel] avformat/file: add S_IFBLK/S_ISBLK compatability macro | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

zhilizhao(赵志立) Jan. 11, 2023, 9 a.m. UTC
From: Zhao Zhili <zhilizhao@tencent.com>

They are not available on Windows.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
 libavformat/file.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
diff mbox series

Patch

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 {