summaryrefslogtreecommitdiff
path: root/module/system/base/types.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2017-11-29 21:10:25 +0100
committerAndy Wingo <wingo@pobox.com>2017-11-29 21:10:25 +0100
commit82b57d113ccaa57fde3b0869df1b8798af9d51c8 (patch)
tree93455303a3f45912cfd38a47ec953b20b0d6507a /module/system/base/types.scm
parent5c2da3ac66bcb706fa3a30d25774a58aa7f41d01 (diff)
parent81d2e352663bc5f80734312fec90f250b1fbe2e4 (diff)
downloadguile-82b57d113ccaa57fde3b0869df1b8798af9d51c8.tar.gz
Merge until 81d2e352663bc5f80734312fec90f250b1fbe2e4 from stable-2.2
Diffstat (limited to 'module/system/base/types.scm')
-rw-r--r--module/system/base/types.scm30
1 files changed, 20 insertions, 10 deletions
diff --git a/module/system/base/types.scm b/module/system/base/types.scm
index 0678e1548..c6aaed242 100644
--- a/module/system/base/types.scm
+++ b/module/system/base/types.scm
@@ -16,16 +16,15 @@
(define-module (system base types)
#:use-module (rnrs bytevectors)
- #:use-module ((rnrs io ports) #:hide (bytevector->string))
+ #:use-module (rnrs io ports)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-9 gnu)
#:use-module (srfi srfi-11)
#:use-module (srfi srfi-26)
#:use-module (srfi srfi-60)
- #:use-module (system syntax internal)
#:use-module (ice-9 match)
- #:use-module (ice-9 iconv)
+ #:use-module ((ice-9 iconv) #:prefix iconv:)
#:use-module (ice-9 format)
#:use-module (ice-9 vlist)
#:use-module (system foreign)
@@ -50,6 +49,12 @@
scm->object))
+;; This module can be loaded from GDB-linked-against-2.0, so use 2.2
+;; features conditionally.
+(cond-expand
+ (guile-2.2 (use-modules (system syntax internal))) ;for 'make-syntax'
+ (else #t))
+
;;; Commentary:
;;;
;;; 'SCM' type tag decoding, primarily to support Guile debugging in GDB.
@@ -379,12 +384,13 @@ using BACKEND."
(($ <stringbuf> string)
(substring string start (+ start len)))))
(((_ & #x047f = %tc7-stringbuf) len (bytevector buf len))
- (stringbuf (bytevector->string buf "ISO-8859-1")))
+ (stringbuf (iconv:bytevector->string buf "ISO-8859-1")))
(((_ & #x047f = (bitwise-ior #x400 %tc7-stringbuf))
len (bytevector buf (* 4 len)))
- (stringbuf (bytevector->string buf (match (native-endianness)
- ('little "UTF-32LE")
- ('big "UTF-32BE")))))
+ (stringbuf (iconv:bytevector->string buf
+ (match (native-endianness)
+ ('little "UTF-32LE")
+ ('big "UTF-32BE")))))
(((_ & #x7f = %tc7-bytevector) len address)
(let ((bv-port (memory-port backend address len)))
(get-bytevector-n bv-port len)))
@@ -426,9 +432,13 @@ using BACKEND."
(((_ & #x7f = %tc7-keyword) symbol)
(symbol->keyword (cell->object symbol backend)))
(((_ & #x7f = %tc7-syntax) expression wrap module)
- (make-syntax (cell->object expression backend)
- (cell->object wrap backend)
- (cell->object module backend)))
+ (cond-expand
+ (guile-2.2
+ (make-syntax (cell->object expression backend)
+ (cell->object wrap backend)
+ (cell->object module backend)))
+ (else
+ (inferior-object 'syntax address))))
(((_ & #x7f = %tc7-vm-continuation))
(inferior-object 'vm-continuation address))
(((_ & #x7f = %tc7-weak-set))