diff --git a/gash/compat.scm b/gash/compat.scm index fcd2a6b..60c3545 100644 --- a/gash/compat.scm +++ b/gash/compat.scm @@ -56,3 +56,14 @@ (define-public (exact-integer? x) (and (integer? x) (exact? x)))) #f) + +(cond-expand + ((and guile-2 (not guile-2.2)) + (define* (setvbuf port mode #:optional size) + (let ((mode (match mode + ('none _IONBF) + ('line _IOLBF) + ('block _IOFBF)))) + ((@ (guile) setvbuf) port mode size))) + (export! setvbuf)) + (else #f)) diff --git a/tests/unit/shell.scm b/tests/unit/shell.scm index c885a89..7dedfb4 100644 --- a/tests/unit/shell.scm +++ b/tests/unit/shell.scm @@ -17,6 +17,7 @@ ;;; along with Gash. If not, see . (define-module (test-shell) + #:use-module (gash compat) #:use-module (gash compat textual-ports) #:use-module (gash environment) #:use-module (gash shell) @@ -64,16 +65,6 @@ (delete-recursively directory) result)) -(cond-expand - ((and guile-2 (not guile-2.2)) - (define* (setvbuf port mode #:optional size) - (let ((mode (match mode - ('none _IONBF) - ('line _IOLBF) - ('block _IOFBF)))) - ((@ (guile) setvbuf) port mode size)))) - (else #f)) - (define (%make-script object . forms) (define (write-script port) (chmod port #o755)