resurrect guile-mescc, use write-int and (current-error-port) iso `2'.

This commit is contained in:
Jan Nieuwenhuizen 2016-08-13 01:07:26 +02:00
parent 697858f670
commit 038f4c71be
2 changed files with 11 additions and 5 deletions

View file

@ -20,3 +20,7 @@
(define-macro (defined? x) (define-macro (defined? x)
`(assq ,x (cddr (current-module)))) `(assq ,x (cddr (current-module))))
(define (current-input-port) 0)
(define (current-output-port) 1)
(define (current-error-port) 2)

View file

@ -405,12 +405,14 @@
(lambda () (lambda ()
(c-parser (c-lexer errorp) errorp)))) (c-parser (c-lexer errorp) errorp))))
(display "program: " 2) (display "program: " (current-error-port))
(display (mescc) 2) (display (mescc) (current-error-port))
(newline 2) (newline (current-error-port))
(define elf-header '(#x7f #E #L #F #x01)) (define (write-int x) (write-char (integer->char x)))
(define elf-header '(#x7f #\E #\L #\F #x01))
(define elf-header '(#x7f #x45 #x4c #x46 #x01)) (define elf-header '(#x7f #x45 #x4c #x46 #x01))
(map write-char elf-header) ;;(map write-char elf-header)
(map write-int elf-header)
(newline) (newline)