aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2022-05-25 17:12:43 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2022-05-25 17:14:03 -0700
commitc1144bf472f69fdfac8f3fd7634aab19b771c32e (patch)
tree7c3c3e39c273562ef6186c79d2afed15b9785018
parentbcb992989d1a7923ff3c014113dd9a0f7755441b (diff)
downloadf2fs-tools-c1144bf472f69fdfac8f3fd7634aab19b771c32e.tar.gz
Check fallthrough in mount.h for Mac
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/os/base.h:128:23: error: missing ')' after 'do' ^~~~~~~~~~~ external/f2fs-tools/include/f2fs_fs.h:81:24: note: expanded from macro 'fallthrough' ~~ ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/os/base.h:128:22: note: to match this '(' Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--include/f2fs_fs.h6
-rw-r--r--lib/libf2fs.c3
2 files changed, 6 insertions, 3 deletions
diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
index ad2798c..21a7e70 100644
--- a/include/f2fs_fs.h
+++ b/include/f2fs_fs.h
@@ -77,11 +77,17 @@
#define static_assert _Static_assert
#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+
+#ifndef fallthrough
#ifdef __clang__
#define fallthrough do {} while (0) /* fall through */
#else
#define fallthrough __attribute__((__fallthrough__))
#endif
+#endif
#ifdef _WIN32
#undef HAVE_LINUX_TYPES_H
diff --git a/lib/libf2fs.c b/lib/libf2fs.c
index 36b8c25..ecaa2e9 100644
--- a/lib/libf2fs.c
+++ b/lib/libf2fs.c
@@ -22,9 +22,6 @@
#endif
#include <time.h>
#include <sys/stat.h>
-#ifdef HAVE_SYS_MOUNT_H
-#include <sys/mount.h>
-#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif