btrfs-progs: ioctl: fix build failure if BUILD_ASSERT is not defined
authorDavid Sterba <dsterba@suse.com>
Mon, 24 Oct 2016 12:46:26 +0000 (14:46 +0200)
committerDavid Sterba <dsterba@suse.com>
Tue, 25 Oct 2016 12:28:36 +0000 (14:28 +0200)
The build fails if ioctl.h is included without kerncompat.h which
defines BUILD_ASSERT, as reported. The proposed patches add kerncompat.h
but I don't want to pull that header via ioctl.h, so the fix will
provide an empty macro instead.

Reported-by: Eric Sandeen <sandeen@redhat.com>
Reported-by: Sergei Trofimovich <slyfox@gentoo.org>
Reported-by: Mikhail Pukhlikov <cynede@gentoo.org>
Signed-off-by: David Sterba <dsterba@suse.com>
ioctl.h

diff --git a/ioctl.h b/ioctl.h
index 238e7ef..cdfb888 100644 (file)
--- a/ioctl.h
+++ b/ioctl.h
@@ -30,6 +30,11 @@ extern "C" {
 #define __user
 #endif
 
+/* We don't want to include entire kerncompat.h */
+#ifndef BUILD_ASSERT
+#define BUILD_ASSERT(x)
+#endif
+
 #define BTRFS_IOCTL_MAGIC 0x94
 #define BTRFS_VOL_NAME_MAX 255