Prefer 'if-guile-version-below' to 'cond-expand'.
* gash/compat.scm: Use 'if-guile-version-below' over 'cond-expand'. * gash/compat/textual-ports.scm: Ditto.
This commit is contained in:
parent
2d46b8b43e
commit
669c414116
|
@ -57,13 +57,13 @@
|
|||
(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))
|
||||
(if-guile-version-below (2 2 0)
|
||||
(begin
|
||||
(define* (setvbuf port mode #:optional size)
|
||||
(let ((mode (match mode
|
||||
('none _IONBF)
|
||||
('line _IOLBF)
|
||||
('block _IOFBF))))
|
||||
((@ (guile) setvbuf) port mode size)))
|
||||
(export! setvbuf))
|
||||
#f)
|
||||
|
|
|
@ -16,7 +16,8 @@
|
|||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with Gash. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define-module (gash compat textual-ports))
|
||||
(define-module (gash compat textual-ports)
|
||||
#:use-module (gash compat))
|
||||
|
||||
;;; Commentary:
|
||||
;;;
|
||||
|
@ -25,20 +26,19 @@
|
|||
;;;
|
||||
;;; Code:
|
||||
|
||||
(cond-expand
|
||||
((and guile-2 (not guile-2.2))
|
||||
(use-modules (rnrs io ports))
|
||||
(define (unget-char port char)
|
||||
(unread-char char port))
|
||||
(re-export get-char
|
||||
get-line
|
||||
get-string-all
|
||||
lookahead-char)
|
||||
(export unget-char))
|
||||
(else
|
||||
(use-modules (ice-9 textual-ports))
|
||||
(re-export get-char
|
||||
get-line
|
||||
get-string-all
|
||||
lookahead-char
|
||||
unget-char)))
|
||||
(if-guile-version-below (2 2 0)
|
||||
(begin
|
||||
(use-modules (rnrs io ports))
|
||||
(re-export get-char
|
||||
get-line
|
||||
get-string-all
|
||||
lookahead-char)
|
||||
(define-public (unget-char port char)
|
||||
(unread-char char port)))
|
||||
(begin
|
||||
(use-modules (ice-9 textual-ports))
|
||||
(re-export get-char
|
||||
get-line
|
||||
get-string-all
|
||||
lookahead-char
|
||||
unget-char)))
|
||||
|
|
Loading…
Reference in New Issue