From: Baruch Siach <baruch@tkos.co.il>
To: barebox@lists.infradead.org
Subject: [PATCH] envfs: fix build warning
Date: Thu, 24 Jun 2010 12:04:59 +0300 [thread overview]
Message-ID: <60663606c7efe2aaede86326339cb620c0a6bf8a.1277370124.git.baruch@tkos.co.il> (raw)
__LITTLE_ENDIAN or __BIG_ENDIAN are not always defined. E.g. the CodeSourcery
G++ Lite 2010q1 for ARM (4.4.1) does not define __BIG_ENDIAN. This causes a
compile time warning.
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
include/envfs.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/envfs.h b/include/envfs.h
index b5849d9..0dd4e6a 100644
--- a/include/envfs.h
+++ b/include/envfs.h
@@ -36,7 +36,7 @@ struct envfs_super {
#error "No byte order defined in __BYTE_ORDER"
#endif
-#if __BYTE_ORDER == __LITTLE_ENDIAN
+#if defined(__LITTLE_ENDIAN) && __BYTE_ORDER == __LITTLE_ENDIAN
#define ENVFS_16(x) (x)
#define ENVFS_24(x) (x)
#define ENVFS_32(x) (x)
@@ -44,7 +44,7 @@ struct envfs_super {
#define ENVFS_GET_OFFSET(x) ((x)->offset)
#define ENVFS_SET_OFFSET(x,y) ((x)->offset = (y))
#define ENVFS_SET_NAMELEN(x,y) ((x)->namelen = (y))
-#elif __BYTE_ORDER == __BIG_ENDIAN
+#elif defined(__BIG_ENDIAN) && __BYTE_ORDER == __BIG_ENDIAN
#ifdef __KERNEL__
#define ENVFS_16(x) swab16(x)
#define ENVFS_24(x) ((swab32(x)) >> 8)
--
1.7.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2010-06-24 9:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-24 9:04 Baruch Siach [this message]
2010-06-24 11:10 ` Sascha Hauer
2010-06-24 11:19 ` Baruch Siach
2010-06-24 11:35 ` Sascha Hauer
2010-06-27 5:46 ` [PATCH] byteorder: add missing {BIG,LITTLE}_ENDIAN defines Baruch Siach
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=60663606c7efe2aaede86326339cb620c0a6bf8a.1277370124.git.baruch@tkos.co.il \
--to=baruch@tkos.co.il \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox