From: Luis Oliveira Date: Thu, 8 Dec 2011 14:56:01 +0000 (+0200) Subject: explicit :BIG-ENDIAN feature X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=32d3b398d33736e61b51a14afca8c14decec4437;p=sbcl.git explicit :BIG-ENDIAN feature Instead of implying big-endianness by lack of the :LITTLE-ENDIAN feature, make it explicit. --- diff --git a/NEWS b/NEWS index b096e39..2eab9df 100644 --- 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 diff --git a/make-config.sh b/make-config.sh index 60f9fc0..00da0ef 100644 --- a/make-config.sh +++ b/make-config.sh @@ -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 diff --git a/tests/interface.impure.lisp b/tests/interface.impure.lisp index 613bc66..31cb517 100644 --- a/tests/interface.impure.lisp +++ b/tests/interface.impure.lisp @@ -292,5 +292,10 @@ (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*)))) ;;;; success diff --git a/tools-for-build/determine-endianness.c b/tools-for-build/determine-endianness.c index b59d2ed..8c502f5 100644 --- a/tools-for-build/determine-endianness.c +++ b/tools-for-build/determine-endianness.c @@ -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");