explicit :BIG-ENDIAN feature
authorLuis Oliveira <luismbo@gmail.com>
Thu, 8 Dec 2011 14:56:01 +0000 (16:56 +0200)
committerNikodemus Siivola <nikodemus@random-state.net>
Thu, 8 Dec 2011 15:24:43 +0000 (17:24 +0200)
 Instead of implying big-endianness by lack of the :LITTLE-ENDIAN feature,
 make it explicit.

NEWS
make-config.sh
tests/interface.impure.lisp
tools-for-build/determine-endianness.c

diff --git a/NEWS b/NEWS
index b096e39..2eab9df 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,9 @@ changes relative to sbcl-1.0.54:
     deadlock errors are reported in an easier-to-decipher manner.
   * enhancement: DESCRIBE on type designators reports the expansion in more
     cases.
+  * enhancement: SBCL now provides either an explicit :BIG-ENDIAN or
+    :LITTLE-ENDIAN in *FEATURES*, instead of :BIG-ENDIAN being implied by lack
+    of the :LITTLE-ENDIAN feature. (Thanks to Luís Oliveira, lp#901661)
   * optimization: the compiler is smarter about representation selection for
     floating point constants used in full calls.
   * optimization: the compiler no longer refuses to coerce large fixnums to
index 60f9fc0..00da0ef 100644 (file)
@@ -583,12 +583,6 @@ elif [ "$sbcl_arch" = "mips" ]; then
     printf ' :stack-allocatable-closures :stack-allocatable-vectors' >> $ltf
     printf ' :stack-allocatable-lists :stack-allocatable-fixed-objects' >> $ltf
     printf ' :alien-callbacks' >> $ltf
-    # Use a little C program to try to guess the endianness.  Ware
-    # cross-compilers!
-    #
-    # FIXME: integrate to grovel-features, mayhaps
-    $GNUMAKE -C tools-for-build determine-endianness -I ../src/runtime
-    tools-for-build/determine-endianness >> $ltf
 elif [ "$sbcl_arch" = "ppc" ]; then
     printf ' :gencgc :stack-allocatable-closures :stack-allocatable-lists' >> $ltf
     printf ' :linkage-table :raw-instance-init-vops :memory-barrier-vops' >> $ltf
@@ -635,6 +629,13 @@ else
     echo > /dev/null
 fi
 
+# Use a little C program to try to guess the endianness.  Ware
+# cross-compilers!
+#
+# FIXME: integrate to grovel-features, mayhaps
+$GNUMAKE -C tools-for-build determine-endianness -I ../src/runtime
+tools-for-build/determine-endianness >> $ltf
+
 export sbcl_os sbcl_arch
 sh tools-for-build/grovel-features.sh >> $ltf
 
index 613bc66..31cb517 100644 (file)
                    (sb-debug:backtrace 100 s))))
         (foo 100 (let ((list (list t)))
                    (nconc list list)))))))
+
+(with-test (:name :endianness-in-features)
+  (assert
+   (or (member :big-endian *features*)
+       (member :little-endian *features*))))
 \f
 ;;;; success
index b59d2ed..8c502f5 100644 (file)
@@ -25,7 +25,7 @@ int main (int argc, char *argv[]) {
     char *bar = (char *) &foo;
     switch(*bar) {
     case ' ':
-        /* Do nothing */
+        printf(" :big-endian");
         break;
     case '#':
         printf(" :little-endian");