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>
<li>Kawa &gt;= 3.11 and Java &gt;= 22
<ul>
<li>Needs arguments
<li>Needs arguments to enable FFI
<ul>
<li>-Jadd-exports=java.base/jdk.internal.foreign.abi=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-preview</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>
<li>Mosh &gt;= 0.2.9-rc1</li>
<li>Racket</li>
<li>Sagittarius</li>
<li>Racket &gt;= 8.16 [cs]</li>
<li>Sagittarius &gt;= 0.9.13</li>
<li>STklos &gt; 2.10
<ul>
<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>
<p><a
href="https://snow-fort.org/">https://snow-fort.org/</a></p>
<p>Installable with snow-chibi for following
implementations.</p>
<ul>
<li>Chibi</li>
<li>Kawa</li>
<li>STklos</li>
</ul>
<h3 id="manul">Manul</h3>
<p>snow-chibi impls=IMPLEMENTATION install “(foreign c)”</p>
<p>You can test that library is found by your implementation
like this:</p>
<pre><code>cp tests/hello.scm /tmp/hello.scm
cd /tmp
IMPLEMENTATION hello.scm</code></pre>
<h3 id="manual">Manual</h3>
<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>
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*))
(else (error "Can not get size of unknown type" type)))))
(define-macro
#;(define-macro
(define-c-library name headers object-name options)
(append (list `(define ,name #t)
(map (lambda (header)
`(c-declare ,(string-append "#include <" header ">")))
(car (cdr headers))))))
(display "HERE: ")
(write (cons `(define ,name #t)
(map (lambda (header)
`(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);"))