[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 01/06: (system base target) doesn't load (system foreign
From: |
Andy Wingo |
Subject: |
[Guile-commits] 01/06: (system base target) doesn't load (system foreign) |
Date: |
Sun, 17 Mar 2024 16:42:30 -0400 (EDT) |
wingo pushed a commit to branch main
in repository guile.
commit 137b0e85b956a7b7e7c9bc0029d09fe6868e5b17
Author: Andy Wingo <wingo@pobox.com>
AuthorDate: Wed Mar 6 10:18:08 2024 +0100
(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).
---
module/system/base/target.scm | 14 +++++++++++---
1 file 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)))
- [Guile-commits] branch main updated (5bbc2d41d -> e15617dc0), Andy Wingo, 2024/03/17
- [Guile-commits] 03/06: Rework make-c-struct, parse-c-struct, Andy Wingo, 2024/03/17
- [Guile-commits] 01/06: (system base target) doesn't load (system foreign),
Andy Wingo <=
- [Guile-commits] 04/06: Remove vestigial code from srfi-9, Andy Wingo, 2024/03/17
- [Guile-commits] 02/06: (scheme foreign): API is less configuration-dependent, Andy Wingo, 2024/03/17
- [Guile-commits] 05/06: Rework read-fields, write-fields to not return offset, Andy Wingo, 2024/03/17
- [Guile-commits] 06/06: Expose read-c-struct, write-c-struct syntax, Andy Wingo, 2024/03/17