* [PATCH] Remove invalid macro starting with _ from libfdt_env.h
@ 2012-04-10 15:00 Bert Kenward
[not found] ` <89AE14E37D740B4796DC14566DF6325EF50AFFFAA9-O8zWF298ijDMzT0UNPJNr71+IgudQmzARxWJa1zDYLQ@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Bert Kenward @ 2012-04-10 15:00 UTC (permalink / raw)
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
libfdt_env.h in the device tree compiler currently defines a _B() macro. This is in the
namespace reserved for the implementation, and Cygwin's ctype.h actually defines a macro
with this name. This renames _B to EXTRACT_BYTE.
Signed-off-by: Bert Kenward <bert.kenward-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
---
libfdt/libfdt_env.h | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/libfdt/libfdt_env.h b/libfdt/libfdt_env.h
index da952e7..213d7fb 100644
--- a/libfdt/libfdt_env.h
+++ b/libfdt/libfdt_env.h
@@ -5,25 +5,25 @@
#include <stdint.h>
#include <string.h>
-#define _B(n) ((unsigned long long)((uint8_t *)&x)[n])
+#define EXTRACT_BYTE(n) ((unsigned long long)((uint8_t *)&x)[n])
static inline uint16_t fdt16_to_cpu(uint16_t x)
{
- return (_B(0) << 8) | _B(1);
+ return (EXTRACT_BYTE(0) << 8) | EXTRACT_BYTE(1);
}
#define cpu_to_fdt16(x) fdt16_to_cpu(x)
static inline uint32_t fdt32_to_cpu(uint32_t x)
{
- return (_B(0) << 24) | (_B(1) << 16) | (_B(2) << 8) | _B(3);
+ return (EXTRACT_BYTE(0) << 24) | (EXTRACT_BYTE(1) << 16) | (EXTRACT_BYTE(2) << 8) | EXTRACT_BYTE(3);
}
#define cpu_to_fdt32(x) fdt32_to_cpu(x)
static inline uint64_t fdt64_to_cpu(uint64_t x)
{
- return (_B(0) << 56) | (_B(1) << 48) | (_B(2) << 40) | (_B(3) << 32)
- | (_B(4) << 24) | (_B(5) << 16) | (_B(6) << 8) | _B(7);
+ return (EXTRACT_BYTE(0) << 56) | (EXTRACT_BYTE(1) << 48) | (EXTRACT_BYTE(2) << 40) | (EXTRACT_BYTE(3) << 32)
+ | (EXTRACT_BYTE(4) << 24) | (EXTRACT_BYTE(5) << 16) | (EXTRACT_BYTE(6) << 8) | EXTRACT_BYTE(7);
}
#define cpu_to_fdt64(x) fdt64_to_cpu(x)
-#undef _B
+#undef EXTRACT_BYTE
#endif /* _LIBFDT_ENV_H */
--
1.7.9
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Remove invalid macro starting with _ from libfdt_env.h
[not found] ` <89AE14E37D740B4796DC14566DF6325EF50AFFFAA9-O8zWF298ijDMzT0UNPJNr71+IgudQmzARxWJa1zDYLQ@public.gmane.org>
@ 2012-04-11 1:13 ` David Gibson
2012-04-14 14:29 ` Jon Loeliger
1 sibling, 0 replies; 3+ messages in thread
From: David Gibson @ 2012-04-11 1:13 UTC (permalink / raw)
To: Bert Kenward; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
On Tue, Apr 10, 2012 at 08:00:15AM -0700, Bert Kenward wrote:
> libfdt_env.h in the device tree compiler currently defines a _B() macro. This is in the
> namespace reserved for the implementation, and Cygwin's ctype.h actually defines a macro
> with this name. This renames _B to EXTRACT_BYTE.
>
> Signed-off-by: Bert Kenward <bert.kenward-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Acked-by: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Remove invalid macro starting with _ from libfdt_env.h
[not found] ` <89AE14E37D740B4796DC14566DF6325EF50AFFFAA9-O8zWF298ijDMzT0UNPJNr71+IgudQmzARxWJa1zDYLQ@public.gmane.org>
2012-04-11 1:13 ` David Gibson
@ 2012-04-14 14:29 ` Jon Loeliger
1 sibling, 0 replies; 3+ messages in thread
From: Jon Loeliger @ 2012-04-14 14:29 UTC (permalink / raw)
To: Bert Kenward; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
> libfdt_env.h in the device tree compiler currently defines a _B() macro. This is in the
> namespace reserved for the implementation, and Cygwin's ctype.h actually defines a macro
> with this name. This renames _B to EXTRACT_BYTE.
>
> Signed-off-by: Bert Kenward <bert.kenward-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Applied.
Thanks,
jdl
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-04-14 14:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-10 15:00 [PATCH] Remove invalid macro starting with _ from libfdt_env.h Bert Kenward
[not found] ` <89AE14E37D740B4796DC14566DF6325EF50AFFFAA9-O8zWF298ijDMzT0UNPJNr71+IgudQmzARxWJa1zDYLQ@public.gmane.org>
2012-04-11 1:13 ` David Gibson
2012-04-14 14:29 ` Jon Loeliger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).