summaryrefslogtreecommitdiff
path: root/module/system
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2024-03-06 10:18:08 +0100
committerAndy Wingo <wingo@pobox.com>2024-03-17 21:40:58 +0100
commit137b0e85b956a7b7e7c9bc0029d09fe6868e5b17 (patch)
treef97531b8804989214a62e76a071386c3d2a3e53e /module/system
parent5bbc2d41d9cb4d42a226c753469bc0a7a81b33ae (diff)
downloadguile-137b0e85b956a7b7e7c9bc0029d09fe6868e5b17.tar.gz
(system base target) doesn't load (system foreign)
* module/system/base/target.scm (%native-word-size): Use most-positive-fixnum instead of importing (system foreign).
Diffstat (limited to 'module/system')
-rw-r--r--module/system/base/target.scm14
1 files changed, 11 insertions, 3 deletions
diff --git a/module/system/base/target.scm b/module/system/base/target.scm
index f06798789..474a1d5e0 100644
--- a/module/system/base/target.scm
+++ b/module/system/base/target.scm
@@ -1,6 +1,6 @@
;;; Compilation targets
-;; Copyright (C) 2011-2014,2017-2018,2023 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2014,2017-2018,2023-2024 Free Software Foundation, Inc.
;; This library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public
@@ -44,8 +44,16 @@
;;; Target types
;;;
-(define %native-word-size
- ((@ (system foreign) sizeof) '*))
+;; Hacky way to get native pointer size without having to load (system
+;; foreign).
+(define-syntax %native-word-size
+ (lambda (stx)
+ (syntax-case stx ()
+ (id (identifier? #'id)
+ (cond
+ ((< most-positive-fixnum (ash 1 32)) 4)
+ ((< most-positive-fixnum (ash 1 64)) 8)
+ (else (error "unexpected!" most-positive-fixnum)))))))
(define %target-type (make-fluid %host-type))
(define %target-endianness (make-fluid (native-endianness)))