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)
`(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 ()
(c-parser (c-lexer errorp) errorp))))
(display "program: " 2)
(display (mescc) 2)
(newline 2)
(display "program: " (current-error-port))
(display (mescc) (current-error-port))
(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))
(map write-char elf-header)
;;(map write-char elf-header)
(map write-int elf-header)
(newline)