From: Denys Vlasenko Date: Sun, 14 Jan 2018 12:43:31 +0000 (+0100) Subject: nandwrite: cope with old headers which have no MTD_FILE_MODE_RAW X-Git-Tag: 1_29_0~367 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=586f1ee7cfcb442caf467a4ea5fb9351ef3c0d11;p=oweals%2Fbusybox.git nandwrite: cope with old headers which have no MTD_FILE_MODE_RAW Signed-off-by: Denys Vlasenko --- diff --git a/miscutils/nandwrite.c b/miscutils/nandwrite.c index 72f028ed3..29c800612 100644 --- a/miscutils/nandwrite.c +++ b/miscutils/nandwrite.c @@ -53,6 +53,15 @@ #include "libbb.h" #include +/* Old headers call it MTD_MODE_RAW. + * FIXME: In kernel headers, MTD_FILE_MODE_RAW is not a define, + * it's an enum. How I can test for existence of an enum? + */ +#if !defined(MTD_FILE_MODE_RAW) +# define MTD_FILE_MODE_RAW 3 +#endif + + #define IS_NANDDUMP (ENABLE_NANDDUMP && (!ENABLE_NANDWRITE || (applet_name[4] == 'd'))) #define IS_NANDWRITE (ENABLE_NANDWRITE && (!ENABLE_NANDDUMP || (applet_name[4] != 'd')))