Add libc-name
This commit is contained in:
parent
afc2d6cce9
commit
b8a491e8c6
43
README.md
43
README.md
|
|
@ -85,15 +85,21 @@ to being portable by conforming to some specification.
|
|||
|
||||
Required versions:
|
||||
|
||||
- Chibi > 0.11
|
||||
- At the only 0.11 is out so build from git
|
||||
- Chicken >= 5.4.0 < 6
|
||||
- Guile >= 3
|
||||
- Has include bug, might not work on all situations
|
||||
- Kawa >= 3.11 and Java >= 22
|
||||
- Needs arguments
|
||||
- -J--add-exports=java.base/jdk.internal.foreign.abi=ALL-UNNAMED
|
||||
- -J--add-exports=java.base/jdk.internal.foreign.layout=ALL-UNNAMED
|
||||
- -J--add-exports=java.base/jdk.internal.foreign=ALL-UNNAMED
|
||||
- -J--enable-native-access=ALL-UNNAMED
|
||||
- -J--enable-preview
|
||||
- Needs arguments
|
||||
- -J--add-exports=java.base/jdk.internal.foreign.abi=ALL-UNNAMED
|
||||
- -J--add-exports=java.base/jdk.internal.foreign.layout=ALL-UNNAMED
|
||||
- -J--add-exports=java.base/jdk.internal.foreign=ALL-UNNAMED
|
||||
- -J--enable-native-access=ALL-UNNAMED
|
||||
- -J--enable-preview
|
||||
- STklos > 2.10
|
||||
- At the time only 2.10 is out so build from git
|
||||
|
||||
|
||||
### Primitives 1 table
|
||||
|
||||
|
|
@ -233,12 +239,10 @@ Example:
|
|||
|
||||
(define-c-library libc
|
||||
(list "stdlib.h")
|
||||
"c"
|
||||
libc-name
|
||||
'((additional-versions ("" "0" "6"))
|
||||
(additional-paths ("."))))
|
||||
|
||||
Note that libc is exported by this library so you might not need to load it.
|
||||
|
||||
#### Notes
|
||||
|
||||
- Do not cond-expand inside the arguments, that might lead to problems on some
|
||||
|
|
@ -261,9 +265,7 @@ Defines a new foreign function to be used from Scheme code.
|
|||
|
||||
Example:
|
||||
|
||||
(cond-expand
|
||||
(windows (define-c-library libc '("stdlib.h") "ucrtbase" '()))
|
||||
(else (define-c-library libc '("stdlib.h") "c" '("6"))))
|
||||
(define-c-library libc '("stdlib.h") libc-name '("6"))
|
||||
(define-c-procedure c-puts libc 'puts 'int '(pointer))
|
||||
(c-puts "Message brought to you by foreign-c!")
|
||||
|
||||
|
|
@ -311,9 +313,7 @@ Defines a new Sceme function to be used as callback to C code.
|
|||
Example:
|
||||
|
||||
; Load the shared library
|
||||
(cond-expand
|
||||
(windows (define-c-library libc-stdlib '("stdlib.h") "ucrtbase" '()))
|
||||
(else (define-c-library '("stdlib.h") "c" '("" "6"))))
|
||||
(define-c-library libc-stdlib '("stdlib.h") libc-name '("" "6"))
|
||||
|
||||
; Define C function that takes a callback
|
||||
(define-c-procedure qsort libc-stdlib 'qsort 'void '(pointer int int callback))
|
||||
|
|
@ -610,19 +610,20 @@ encoded by the given c-bytevector.
|
|||
|
||||
### Utilities
|
||||
|
||||
**libc**
|
||||
**libc-name**
|
||||
|
||||
Since the library uses C standard internally, and that is most likely library
|
||||
to have different name on different operating systems. For example libc.so on
|
||||
Linux, ucrtbase.dll on windows and libroot.so on Haiku. It makes sense to
|
||||
export it, saving the users the trouble of figuring out which named shared
|
||||
library they should load.
|
||||
Name of the C standard library on the current operating system. Supported OS:
|
||||
|
||||
- Windows
|
||||
- Linux
|
||||
- Haiku
|
||||
|
||||
See foreign/c/libc.scm to see which headers are included and what shared
|
||||
libraries are loaded.
|
||||
|
||||
Example:
|
||||
|
||||
(define-c-library libc '("stdlib.h") libc-name '("" "6"))
|
||||
(define-c-procedure c-puts libc 'puts 'int '(pointer))
|
||||
(c-puts "Message brought to you by foreign-c!")
|
||||
|
||||
|
|
|
|||
|
|
@ -102,8 +102,15 @@ Schemes - 0.10.0</title>
|
|||
tables</h2>
|
||||
<p>Required versions:</p>
|
||||
<ul>
|
||||
<li>Gambit >= 4.9.5</li>
|
||||
<li>Guile >= 3</li>
|
||||
<li>Chibi > 0.11
|
||||
<ul>
|
||||
<li>At the only 0.11 is out so build from git</li>
|
||||
</ul></li>
|
||||
<li>Chicken >= 5.4.0 < 6</li>
|
||||
<li>Guile >= 3
|
||||
<ul>
|
||||
<li>Has include bug, might not work on all situations</li>
|
||||
</ul></li>
|
||||
<li>Kawa >= 3.11 and Java >= 22
|
||||
<ul>
|
||||
<li>Needs arguments
|
||||
|
|
@ -115,7 +122,10 @@ Schemes - 0.10.0</title>
|
|||
<li>-J–enable-preview</li>
|
||||
</ul></li>
|
||||
</ul></li>
|
||||
<li>STklos > 2.10</li>
|
||||
<li>STklos > 2.10
|
||||
<ul>
|
||||
<li>At the time only 2.10 is out so build from git</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h3 id="primitives-1-table">Primitives 1 table</h3>
|
||||
<table>
|
||||
|
|
@ -159,15 +169,6 @@ Schemes - 0.10.0</title>
|
|||
<td style="text-align: center;">X</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>Gambit</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td><strong>Gauche</strong></td>
|
||||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
|
|
@ -176,7 +177,7 @@ Schemes - 0.10.0</title>
|
|||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<tr class="even">
|
||||
<td><strong>Guile</strong></td>
|
||||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
|
|
@ -185,7 +186,7 @@ Schemes - 0.10.0</title>
|
|||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<tr class="odd">
|
||||
<td><strong>Kawa</strong></td>
|
||||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
|
|
@ -194,7 +195,7 @@ Schemes - 0.10.0</title>
|
|||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<tr class="even">
|
||||
<td><strong>Mosh</strong></td>
|
||||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
|
|
@ -203,7 +204,7 @@ Schemes - 0.10.0</title>
|
|||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<tr class="odd">
|
||||
<td><strong>Racket</strong></td>
|
||||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
|
|
@ -212,7 +213,7 @@ Schemes - 0.10.0</title>
|
|||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<tr class="even">
|
||||
<td><strong>Sagittarius</strong></td>
|
||||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
|
|
@ -221,7 +222,7 @@ Schemes - 0.10.0</title>
|
|||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<tr class="odd">
|
||||
<td><strong>STklos</strong></td>
|
||||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
|
|
@ -230,7 +231,7 @@ Schemes - 0.10.0</title>
|
|||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<tr class="even">
|
||||
<td><strong>Ypsilon</strong></td>
|
||||
<td style="text-align: center;">X</td>
|
||||
<td style="text-align: center;">X</td>
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -5,10 +5,8 @@
|
|||
(scheme process-context)
|
||||
(foreign c))
|
||||
|
||||
|
||||
(display "libc-name:" )
|
||||
(display "libc-name: ")
|
||||
(display libc-name)
|
||||
(newline)
|
||||
|
||||
(define-c-library libc
|
||||
'("stdlib.h" "stdio.h" "string.h")
|
||||
|
|
|
|||
Loading…
Reference in New Issue