Skip to content

Commit

Permalink
Avoid using cond-expand in a precompiled file
Browse files Browse the repository at this point in the history
Related to #1089
  • Loading branch information
shirok committed Dec 4, 2024

Verified

This commit was signed with the committer’s verified signature.
cdesiniotis Christopher Desiniotis
1 parent 14572f5 commit e2c2e87
Showing 2 changed files with 12 additions and 9 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2024-12-04 Shiro Kawai <[email protected]>

* src/libeval.scm (%invoke-other-version): Avoid using cond-expand.
This file may be precompiled on different platforms.

2024-12-02 Shiro Kawai <[email protected]>

* lib/gauche/interactive.scm (read-eval-print-loop): Adapt to
16 changes: 7 additions & 9 deletions src/libeval.scm
Original file line number Diff line number Diff line change
@@ -498,12 +498,14 @@
(let* ([prefix (sys-normalize-pathname
(string-append (gauche-architecture-directory) "/../../..")
:canonicalize #t)]
[windows? (or (assq 'gauche.os.windows (cond-features))
(assq 'gauche.os.cygwin (cond-features)))]
[globpath (string-append prefix "/gauche-*/" version "/"
(gauche-architecture) "/"
(cond-expand
(if windows?
;; glob requires a file extension on Windows
[gauche.os.windows "gosh.exe"]
[else "gosh"]))]
"gosh.exe"
"gosh"))]
[goshes (glob globpath)]
;; Remove -v option from args
[args (let loop ([args (cdr args)]
@@ -513,8 +515,7 @@
[(#/^-v/ (car args)) (loop (cdr args) r)]
[else (loop (cdr args) (cons (car args) r))]))])
(if (pair? goshes)
(cond-expand
[gauche.os.windows
(if windows?
;; On windows, sys-exec (execvp) doesn't work like unix.
;; Notably, exit status of the exec'ed process is lost.
;; So we use sys-fork-and-exec (CreateProcess) and wait for the
@@ -527,10 +528,7 @@
[(sys-wait-signaled? status)
(sys-kill (sys-getpid) (sis-wait-termsig status))]
[else (exit 70)]))) ;EX_SOFTWARE
]
[else
(sys-exec (car goshes) (cons (car goshes) args)) ;never return
])
(sys-exec (car goshes) (cons (car goshes) args))) ;never return
prefix)))

;;;

0 comments on commit e2c2e87

Please sign in to comment.