nvme-cli: Fix build on aarch64-linux-android-4.9
PATCH 1/1 nvme-cli: Fix build on aarch64-linux-android-4.9
Need to include sys/stat.h to fix:
fabrics.c:414:45: error: 'S_IRUSR' undeclared (first use in this function) fabrics.c:414:53: error: 'S_IWUSR' undeclared (first use in this function)
Standard header had offsetof predefined. Fix this trivial warning. common.h:4:0: warning: "offsetof" redefined
#define offsetof(x, y) __builtin_offsetof(x, y)
^
Signed-off-by Rakesh Pandit <rakesh at tuxera.com>
--- common.h | 2 ++ fabrics.c | 1 + 2 files changed, 3 insertions(+)
common.h +2 -0
@@ -1,7 +1,9 @@#ifndef _COMMON_H#define _COMMON_H +#ifndef offsetof#define offsetof (x, y) __builtin_offsetof(x, y) +#endif #define __round_mask (x, y) ((__typeof__(x))((y)-1))#define round_up (x, y) ((((x)-1) | __round_mask(x, y))+1)
fabrics.c +1 -0
@@ -32,6 +32,7 @@#include <inttypes.h> #include <linux/types.h> #include <libgen.h> +#include <sys/stat.h> #include "parser.h" #include "nvme-ioctl.h"
Signature · 1 line
1.7.10.4
PATCH 1/1 nvme-cli: Fix build on aarch64-linux-android-4.9
common.h line 6
Quoted 6 lines
#ifndef
_COMMON_H
#define_COMMON_Hcommon.h +2
-0+#ifndef offsetof#define offsetof (x, y) __builtin_offsetof(x, y) +#endif
Please just remove the defintion entirely and make sure we always have <stddef.h> included for the offsetoff definition.