mirror of
https://github.com/edwinb/Idris2-boot.git
synced 2024-11-23 20:22:34 +03:00
Calculate OS from scheme code
This way if you distribute scheme it won't have an OS hard coded based on the machine it was generated on
This commit is contained in:
parent
0ef2885548
commit
8c9eec15a8
@ -425,7 +425,7 @@ parameters (schExtPrim : Int -> ExtPrim -> List NamedCExp -> Core String,
|
||||
schExtCommon i VoidElim [_, _]
|
||||
= pure "(display \"Error: Executed 'void'\")"
|
||||
schExtCommon i SysOS []
|
||||
= pure $ show os
|
||||
= pure $ "(blodwen-os)"
|
||||
schExtCommon i (Unknown n) args
|
||||
= throw (InternalError ("Can't compile unknown external primitive " ++ show n))
|
||||
schExtCommon i prim args
|
||||
|
@ -1,3 +1,10 @@
|
||||
(define (blodwen-os)
|
||||
(case (machine-type)
|
||||
[(i3le ti3le a6le ta6le) "unix"]
|
||||
[(i3osx ti3osx a6osx ta6osx) "darwin"]
|
||||
[(i3nt ti3nt a6nt ta6nt) "windows"]
|
||||
[else "unknown"]))
|
||||
|
||||
(define blodwen-read-args (lambda (desc)
|
||||
(case (vector-ref desc 0)
|
||||
((0) '())
|
||||
|
Loading…
Reference in New Issue
Block a user