* [gccgo] Use AC_C_BIGENDIAN rather than <endian.h>
@ 2009-11-24 21:36 Ian Lance Taylor
0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2009-11-24 21:36 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 147 bytes --]
I committed this patch to the gccgo branch to use the AC_C_BIGENDIAN
configure test rather than assume that the system provides <endian.h>.
Ian
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: ENDIAN --]
[-- Type: text/x-diff, Size: 1466 bytes --]
Index: runtime/go-reflect-chan.c
===================================================================
--- runtime/go-reflect-chan.c (revision 154387)
+++ runtime/go-reflect-chan.c (working copy)
@@ -6,8 +6,8 @@
#include <stdlib.h>
#include <stdint.h>
-#include <endian.h>
+#include "config.h"
#include "go-type.h"
#include "channel.h"
@@ -40,7 +40,7 @@ chansend (unsigned char *ch, unsigned ch
} u;
__builtin_memset (u.b, 0, sizeof (uint64_t));
-#if __BYTE_ORDER == __LITTLE_ENDIAN
+#ifndef WORDS_BIGENDIAN
__builtin_memcpy (u.b, val, channel->element_size);
#else
__builtin_memcpy (u.b + sizeof (uint64_t) - channel->element_size, val,
@@ -89,7 +89,7 @@ chanrecv (unsigned char *ch, unsigned ch
u.v = s.__val;
}
-#if __BYTE_ORDER == __LITTLE_ENDIAN
+#ifndef WORDS_BIGENDIAN
__builtin_memcpy (val, u.b, channel->element_size);
#else
__builtin_memcpy (val, u.b + sizeof (uint64_t) - channel->element_size,
Index: configure.ac
===================================================================
--- configure.ac (revision 154445)
+++ configure.ac (working copy)
@@ -6,7 +6,7 @@
# Process this file with autoreconf to produce configure.
-AC_PREREQ(2.59)
+AC_PREREQ(2.64)
AC_INIT(package-unused, version-unused,, libgo)
AC_CONFIG_SRCDIR(Makefile.am)
AC_CONFIG_HEADER(config.h)
@@ -159,6 +159,8 @@ else
fi
AC_SUBST(SPLIT_STACK)
+AC_C_BIGENDIAN
+
AC_CACHE_SAVE
if test ${multilib} = yes; then
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-11-24 21:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-24 21:36 [gccgo] Use AC_C_BIGENDIAN rather than <endian.h> Ian Lance Taylor
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 read-only IMAP folder(s) and NNTP newsgroup(s).