Restore Gambit code to what it was

This commit is contained in:
retropikzel 2025-06-28 09:59:40 +03:00
parent f2cf940aa6
commit 150309833a
3 changed files with 36 additions and 16 deletions

View File

@ -118,7 +118,7 @@ Schemes - 0.10.0</title>
</ul></li> </ul></li>
<li>Kawa &gt;= 3.11 and Java &gt;= 22 <li>Kawa &gt;= 3.11 and Java &gt;= 22
<ul> <ul>
<li>Needs arguments <li>Needs arguments to enable FFI
<ul> <ul>
<li>-Jadd-exports=java.base/jdk.internal.foreign.abi=ALL-UNNAMED</li> <li>-Jadd-exports=java.base/jdk.internal.foreign.abi=ALL-UNNAMED</li>
<li>-Jadd-exports=java.base/jdk.internal.foreign.layout=ALL-UNNAMED</li> <li>-Jadd-exports=java.base/jdk.internal.foreign.layout=ALL-UNNAMED</li>
@ -126,10 +126,15 @@ Schemes - 0.10.0</title>
<li>-Jenable-native-access=ALL-UNNAMED</li> <li>-Jenable-native-access=ALL-UNNAMED</li>
<li>-Jenable-preview</li> <li>-Jenable-preview</li>
</ul></li> </ul></li>
<li>So that snow-chibi installed library is found
<ul>
<li>-Dkawa.import.path=/usr/local/share/kawa</li>
<li>-Dkawa.import.path=/usr/local/share/kawa/lib</li>
</ul></li>
</ul></li> </ul></li>
<li>Mosh &gt;= 0.2.9-rc1</li> <li>Mosh &gt;= 0.2.9-rc1</li>
<li>Racket</li> <li>Racket &gt;= 8.16 [cs]</li>
<li>Sagittarius</li> <li>Sagittarius &gt;= 0.9.13</li>
<li>STklos &gt; 2.10 <li>STklos &gt; 2.10
<ul> <ul>
<li>At the time only 2.10 is out so build from git</li> <li>At the time only 2.10 is out so build from git</li>
@ -378,14 +383,13 @@ Schemes - 0.10.0</title>
<h3 id="snow-fort">Snow-fort</h3> <h3 id="snow-fort">Snow-fort</h3>
<p><a <p><a
href="https://snow-fort.org/">https://snow-fort.org/</a></p> href="https://snow-fort.org/">https://snow-fort.org/</a></p>
<p>Installable with snow-chibi for following <p>snow-chibi impls=IMPLEMENTATION install “(foreign c)”</p>
implementations.</p> <p>You can test that library is found by your implementation
<ul> like this:</p>
<li>Chibi</li> <pre><code>cp tests/hello.scm /tmp/hello.scm
<li>Kawa</li> cd /tmp
<li>STklos</li> IMPLEMENTATION hello.scm</code></pre>
</ul> <h3 id="manual">Manual</h3>
<h3 id="manul">Manul</h3>
<p>Either download the latest release from <a <p>Either download the latest release from <a
href="https://git.sr.ht/~retropikzel/foreign-c/refs">https://git.sr.ht/~retropikzel/foreign-c/refs</a> href="https://git.sr.ht/~retropikzel/foreign-c/refs">https://git.sr.ht/~retropikzel/foreign-c/refs</a>
or git clone, tag, and copy the <em>foreign</em> directory to or git clone, tag, and copy the <em>foreign</em> directory to

Binary file not shown.

View File

@ -46,12 +46,28 @@
((eq? type 'void) (size-of-void*)) ((eq? type 'void) (size-of-void*))
(else (error "Can not get size of unknown type" type))))) (else (error "Can not get size of unknown type" type)))))
(define-macro #;(define-macro
(define-c-library name headers object-name options) (define-c-library name headers object-name options)
(append (list `(define ,name #t) (display "HERE: ")
(map (lambda (header) (write (cons `(define ,name #t)
`(c-declare ,(string-append "#include <" header ">"))) (map (lambda (header)
(car (cdr headers)))))) `(c-declare ,(string-append "#include <" header ">")))
(car (cdr headers)))))
(newline)
(cons `(define ,name #t)
(map (lambda (header)
`(c-declare ,(string-append "#include <" header ">")))
(car (cdr headers)))))
(define-macro
(define-c-library name headers object-name . options)
(begin
(let ((c-code (apply string-append
(map
(lambda (header)
(string-append "#include <" header ">" (string #\newline)))
(car (cdr headers))))))
`(begin (define ,name #t) (c-declare ,c-code)))))
(define pointer? (c-lambda ((pointer void)) bool "___return(1);")) (define pointer? (c-lambda ((pointer void)) bool "___return(1);"))