From 112af512f659e06e214c9512a280502be23ecfa0 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 15 Feb 2010 16:09:14 -0800 Subject: [PATCH] Don't fix constant at compile time; breaks liarc build. --- src/runtime/string.scm | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/runtime/string.scm b/src/runtime/string.scm index 7bb4e664b..7b30f6e26 100644 --- a/src/runtime/string.scm +++ b/src/runtime/string.scm @@ -183,21 +183,18 @@ USA. (define (string-maximum-length string) (guarantee-string string 'STRING-MAXIMUM-LENGTH) (fix:- (fix:lsh (fix:- (system-vector-length string) 1) - (fix:- 0 %octets->words-shift)) + %words->octets-shift) 1)) -(define-integrable %octets->words-shift - ((sc-macro-transformer - (lambda (form environment) - form environment - ;; This is written as a macro so that the shift will be a - ;; constant in the compiled code. It does not work when - ;; cross-compiled! - (let ((chars-per-word (vector-ref (gc-space-status) 0))) - (case chars-per-word - ((4) -2) - ((8) -3) - (else (error "Can't support this word size:" chars-per-word)))))))) +(define %octets->words-shift + (let ((chars-per-word (vector-ref (gc-space-status) 0))) + (case chars-per-word + ((4) -2) + ((8) -3) + (else (error "Can't support this word size:" chars-per-word))))) + +(define %words->octets-shift + (- %octets->words-shift)) (define (string . objects) (%string-append (map ->string objects))) -- 2.25.1