diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2012-07-27 10:41:07 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2012-07-27 10:41:07 +0000 |
commit | efa54c4db32c96472665a857ec9e65bb8ca863c5 (patch) | |
tree | c7de00d9c7d5181ae4aa4942740951db09d1175e /src/fpif.c | |
parent | e23917af1087205e08edeba8f1c3d024d416ded8 (diff) | |
download | mpfr-efa54c4db32c96472665a857ec9e65bb8ca863c5.tar.gz |
[src/fpif.c] No longer assume that if HAVE_BIG_ENDIAN is not defined,
the architecture is little endian. Detect the case where neither
HAVE_BIG_ENDIAN nor HAVE_LITTLE_ENDIAN is defined (currently an
error).
[configure.ac] Fixed the use of AC_C_BIGENDIAN (since AC_CONFIG_HEADERS
is not used, one must have an ACTION-IF-UNIVERSAL argument).
[doc/README.dev] Check with "-UHAVE_BIG_ENDIAN -UHAVE_LITTLE_ENDIAN"
(unknown/unspecified endianness) before a release.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8367 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/fpif.c')
-rw-r--r-- | src/fpif.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/fpif.c b/src/fpif.c index d672b9867..4efb87e43 100644 --- a/src/fpif.c +++ b/src/fpif.c @@ -23,6 +23,10 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-impl.h" +#if !defined (HAVE_BIG_ENDIAN) && !defined (HAVE_LITTLE_ENDIAN) +#error "Endianness is unknown. Not supported yet." +#endif + #define MPFR_KIND_ZERO 119 #define MPFR_KIND_INF 120 #define MPFR_KIND_NAN 121 @@ -68,10 +72,10 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., where data_size might be smaller than data_max_size, so that we only copy data_size bytes */ static void -#ifdef HAVE_BIG_ENDIAN +#if defined (HAVE_BIG_ENDIAN) putLittleEndianData (unsigned char * result, unsigned char * data, size_t data_max_size, size_t data_size) -#else /* little endian */ +#elif defined (HAVE_LITTLE_ENDIAN) putBigEndianData (unsigned char * result, unsigned char * data, size_t data_max_size, size_t data_size) #endif @@ -85,10 +89,10 @@ putBigEndianData (unsigned char * result, unsigned char * data, /* copy in result[] the values in data[] with the same endianness */ static void -#ifdef HAVE_BIG_ENDIAN +#if defined (HAVE_BIG_ENDIAN) putBigEndianData (unsigned char * result, unsigned char * data, size_t data_max_size, size_t data_size) -#else /* little endian */ +#elif defined (HAVE_LITTLE_ENDIAN) putLittleEndianData (unsigned char * result, unsigned char * data, size_t data_max_size, size_t data_size) #endif @@ -99,10 +103,10 @@ putLittleEndianData (unsigned char * result, unsigned char * data, /* copy in result[] the values in data[] with a different endianness */ static void -#ifdef HAVE_BIG_ENDIAN +#if defined (HAVE_BIG_ENDIAN) getLittleEndianData (unsigned char * result, unsigned char * data, size_t data_max_size, size_t data_size) -#else /* little endian */ +#elif defined (HAVE_LITTLE_ENDIAN) getBigEndianData (unsigned char * result, unsigned char * data, size_t data_max_size, size_t data_size) #endif @@ -116,10 +120,10 @@ getBigEndianData (unsigned char * result, unsigned char * data, /* copy in result[] the values in data[] with the same endianness */ static void -#ifdef HAVE_BIG_ENDIAN +#if defined (HAVE_BIG_ENDIAN) getBigEndianData (unsigned char * result, unsigned char * data, size_t data_max_size, size_t data_size) -#else /* little endian */ +#elif defined (HAVE_LITTLE_ENDIAN) getLittleEndianData (unsigned char * result, unsigned char * data, size_t data_max_size, size_t data_size) #endif |