From de1a024fffb224378f20a60afdb73d102e9f3db9 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sun, 14 Nov 2010 13:37:59 +0100 Subject: [PATCH] Properly define WORDS_BIGENDIAN in wrapped environments. * grub-core/lib/libgcrypt_wrap/cipher_wrap.h (WORDS_BIGENDIAN): New definition. * grub-core/lib/posix_wrap/sys/types.h (WORDS_BIGENDIAN): Likewise. Reported by: Manoel Rebelo Abranches. Tested by: Manoel Rebelo Abranches. --- ChangeLog | 11 +++++++++++ grub-core/lib/libgcrypt_wrap/cipher_wrap.h | 6 ++++++ grub-core/lib/posix_wrap/sys/types.h | 6 ++++++ 3 files changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7aa535548..e87dd9ff4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2010-11-14 Vladimir Serbinenko + + Properly define WORDS_BIGENDIAN in wrapped environments. + + * grub-core/lib/libgcrypt_wrap/cipher_wrap.h (WORDS_BIGENDIAN): New + definition. + * grub-core/lib/posix_wrap/sys/types.h (WORDS_BIGENDIAN): Likewise. + + Reported by: Manoel Rebelo Abranches. + Tested by: Manoel Rebelo Abranches. + 2010-11-13 Vladimir Serbinenko * util/grub-mkconfig.in: Fix quoting. diff --git a/grub-core/lib/libgcrypt_wrap/cipher_wrap.h b/grub-core/lib/libgcrypt_wrap/cipher_wrap.h index b4530c112..59febaeb5 100644 --- a/grub-core/lib/libgcrypt_wrap/cipher_wrap.h +++ b/grub-core/lib/libgcrypt_wrap/cipher_wrap.h @@ -25,6 +25,12 @@ #include #include +#ifdef GRUB_CPU_WORDS_BIGENDIAN +#define WORDS_BIGENDIAN +#else +#undef WORDS_BIGENDIAN +#endif + #define __GNU_LIBRARY__ #define DIM ARRAY_SIZE diff --git a/grub-core/lib/posix_wrap/sys/types.h b/grub-core/lib/posix_wrap/sys/types.h index 28e354759..4e8331fdd 100644 --- a/grub-core/lib/posix_wrap/sys/types.h +++ b/grub-core/lib/posix_wrap/sys/types.h @@ -32,4 +32,10 @@ typedef grub_uint16_t uint16_t; typedef grub_uint32_t uint32_t; typedef grub_uint64_t uint64_t; +#ifdef GRUB_CPU_WORDS_BIGENDIAN +#define WORDS_BIGENDIAN +#else +#undef WORDS_BIGENDIAN +#endif + #endif