Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ecl
ecl
Commits
a58106e2
Commit
a58106e2
authored
Jun 10, 2021
by
Dima Pasechnik
Browse files
more details added, and examples adjusted
parent
5e99481b
Changes
3
Hide whitespace changes
Inline
Side-by-side
examples/ffi/cffi.lsp
View file @
a58106e2
...
...
@@ -4,11 +4,10 @@ Build and load this module with (compile-file "cffi.lsp" :load t)
;;
;; This toplevel statement notifies the compiler that we will
;; need this shared library at runtime. We do not need this
;; statement in windows.
;; statement in windows
or macOS
.
;;
#-(or ming32 windows)
(cffi:load-foreign-library #+darwin "/usr/lib/libm.dylib"
#-darwin "/usr/lib/libm.so")
#-(or ming32 windows darwin)
(cffi:load-foreign-library "/usr/lib/libm.so")
;;
;; With this other statement, we import the C function sin(),
;; which operates on IEEE doubles.
...
...
examples/ffi/uffi.lsp
View file @
a58106e2
...
...
@@ -5,11 +5,10 @@ Load it with (load "uffi.fas")
;;
;; This toplevel statement notifies the compiler that we will
;; need this shared library at runtime. We do not need this
;; statement in windows.
;; statement in windows
and macOS
.
;;
#-windows
(uffi:load-foreign-library #+darwin "/usr/lib/libm.dylib"
#-darwin "/usr/lib/libm.so")
#-(or windows darwin)
(uffi:load-foreign-library "/lib64/libm.so.6") ;; adjust the library path/name as needed
;;
;; With this other statement, we import the C function sin(),
;; which operates on IEEE doubles.
...
...
src/doc/manual/extensions/ffi.txi
View file @
a58106e2
...
...
@@ -212,6 +212,9 @@ that the compiler may include them at link time.
@item
Every function you will use has to be declared using
@coderef{ffi:def-function}.
@item
In the cases of headers not used by ECL, a header to include might need
to be specified using @coderef{ffi:clines}.
@end itemize
@lisp
...
...
@@ -257,11 +260,10 @@ Build and load this module with (compile-file "cffi.lsp" :load t)
;;
;; This toplevel statement notifies the compiler that we will
;; need this shared library at runtime. We do not need this
;; statement in windows.
;; statement in windows
or macOS
.
;;
#-(or ming32 windows)
(cffi:load-foreign-library #+darwin "/usr/lib/libm.dylib"
#-darwin "/usr/lib/libm.so")
#-(or ming32 windows darwin)
(cffi:load-foreign-library "/usr/lib/libm.so")
;;
;; With this other statement, we import the C function sin(),
;; which operates on IEEE doubles.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment