mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-25 20:50:31 +02:00
* libguile/Makefile.am (AM_CPPFLAGS): Move LIBFFI_CFLAGS here (from AM_CFLAGS), allowing snarfing to work. * libguile/foreign.h (scm_make_foreign_function): New public function. * libguile/foreign.c: Flesh out an implementation of foreign functions. (scm_take_foreign_pointer): Bugfix for the case in which we have a finalizer. * module/system/foreign.scm: Export `make-foreign-function'.
31 lines
1.2 KiB
Scheme
31 lines
1.2 KiB
Scheme
;;;; Copyright (C) 2010 Free Software Foundation, Inc.
|
||
;;;;
|
||
;;;; This library is free software; you can redistribute it and/or
|
||
;;;; modify it under the terms of the GNU Lesser General Public
|
||
;;;; License as published by the Free Software Foundation; either
|
||
;;;; version 2.1 of the License, or (at your option) any later version.
|
||
;;;;
|
||
;;;; This library is distributed in the hope that it will be useful,
|
||
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
;;;; Lesser General Public License for more details.
|
||
;;;;
|
||
;;;; You should have received a copy of the GNU Lesser General Public
|
||
;;;; License along with this library; if not, write to the Free Software
|
||
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||
;;;;
|
||
|
||
|
||
(define-module (system foreign)
|
||
#:export (void
|
||
float double
|
||
int8 uint8
|
||
uint16 int16
|
||
uint32 int32
|
||
uint64 int64
|
||
|
||
foreign-ref foreign-set!
|
||
foreign->bytevector bytevector->foreign
|
||
make-foreign-function))
|
||
|
||
(load-extension "libguile" "scm_init_foreign")
|