[PATCH 3/8] Make sure __LITTLE_ENDIAN/__BIG_ENDIAN are defined in libunwind-frame.c

Joel Brobecker
2010-12-28T04:43:32Z

These macros do not seem to exist on ia64-hpux.

gdb/ChangeLog:

* libunwind-frame.c (__LITTLE_ENDIAN, __BIG_ENDIAN): Define if
not already defined.
---
gdb/libunwind-frame.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/gdb/libunwind-frame.c b/gdb/libunwind-frame.c
index ece93bd..dc28064 100644
--- a/gdb/libunwind-frame.c
+++ b/gdb/libunwind-frame.c
@@ -41,6 +41,16 @@

#include "complaints.h"

+/* The following two macros are normally defined in <endian.h>.
+ But systems such as ia64-hpux do not provide such header, so
+ we just define them here if not already defined. */
+#ifndef __LITTLE_ENDIAN
+#define __LITTLE_ENDIAN 1234
+#endif
+#ifndef __BIG_ENDIAN
+#define __BIG_ENDIAN 4321
+#endif
+
static int libunwind_initialized;
static struct gdbarch_data *libunwind_descr_handle;

--
1.7.1