projects/cffi/cffi.git
13 months agoRework library loading, add better error reporting wip-better-load-library-error
Stelian Ionescu [Sun, 24 Feb 2013 22:58:08 +0000] 
Rework library loading, add better error reporting

13 months agotests: fix name of 32bit FSBV test library
Stelian Ionescu [Sat, 23 Feb 2013 21:24:50 +0000] 
tests: fix name of 32bit FSBV test library

13 months agoMove all warning logic back to WARN-IF-KW-OR-BELONGS-TO-CL
Stelian Ionescu [Sat, 23 Feb 2013 20:48:03 +0000] 
Move all warning logic back to WARN-IF-KW-OR-BELONGS-TO-CL

13 months agoDon't warn if we name FFI types using symbols in package COMMON-LISP
Stelian Ionescu [Sat, 23 Feb 2013 20:19:05 +0000] 
Don't warn if we name FFI types using symbols in package COMMON-LISP

13 months agomanual: use explicit struct types
Stelian Ionescu [Sat, 23 Feb 2013 20:18:18 +0000] 
manual: use explicit struct types

13 months agoUse explicit struct types in tests
Stelian Ionescu [Sat, 23 Feb 2013 18:26:07 +0000] 
Use explicit struct types in tests

13 months agomanual: fix compilation errors and warnings
Luís Oliveira [Sat, 23 Feb 2013 18:08:38 +0000] 
manual: fix compilation errors and warnings

13 months agogrovel: cosmetic changes to c-write.
Akshay Srinivasan [Sat, 16 Feb 2013 19:42:40 +0000] 
grovel: cosmetic changes to c-write.

13 months agoFix BARE-STRUCT-TYPE-P & STRUCTURE-BY-VALUE-P
CrLF0710 [Mon, 21 Jan 2013 02:17:44 +0000] 
Fix BARE-STRUCT-TYPE-P & STRUCTURE-BY-VALUE-P

13 months agocffi-abcl: copy-in/copy-out implementation of with-pointer-to-vector-data
Stas Boukarev [Mon, 21 Jan 2013 07:48:19 +0000] 
cffi-abcl: copy-in/copy-out implementation of with-pointer-to-vector-data

13 months agocffi-abcl: move *loaded-libraries* definition before it's used
Stas Boukarev [Mon, 21 Jan 2013 06:58:22 +0000] 
cffi-abcl: move *loaded-libraries* definition before it's used

13 months agocffi-abcl: global lookups in find-foreign-function and %foreign-symbol-pointer
Stas Boukarev [Sat, 12 Jan 2013 16:50:24 +0000] 
cffi-abcl: global lookups in find-foreign-function and %foreign-symbol-pointer

Fixes issue with ABCL not finding things like "strcmp" when no libraries
are loaded.

14 months agogroveller: fix to work with new type syntax
Alejandro R Sedeño [Fri, 4 Jan 2013 01:19:10 +0000] 
groveller: fix to work with new type syntax

Use C-WRITE instead of C-PRINT-SYMBOL when emitting types to deal with
the fact that some types are more than just one symbol now.

e.g. 'foo vs '(:struct foo) and '(:pointer (:struct foo))

Fixes: Bug 1065432

15 months agoMerge pull request #21 from crlf0710/master
Liam Healy [Fri, 18 Jan 2013 15:32:43 +0000] 
Merge pull request #21 from crlf0710/master

More library names and fix :sizet typo for windows.  Expand affirmative return from structure-by-value-p to include typedefs, so that foreign function calls by value may use the typedefed names to declare variable.  Includes tests.

15 months agoModify STRUCTURE-BY-VALUE-P and include test cases
CrLF0710 [Fri, 18 Jan 2013 13:04:25 +0000] 
Modify STRUCTURE-BY-VALUE-P and include test cases

15 months agocffi-libffi: libffi-win32 fix
CrLF0710 [Fri, 18 Jan 2013 13:00:32 +0000] 
cffi-libffi: libffi-win32 fix

15 months agocffi-abcl: pointerp and null-pointer-p should work on non-pointers.
Stas Boukarev [Wed, 19 Dec 2012 10:27:43 +0000] 
cffi-abcl: pointerp and null-pointer-p should work on non-pointers.

15 months agoecl: si:find-foreign-symbol expects a base-string, coerce it.
Stas Boukarev [Tue, 18 Dec 2012 22:52:23 +0000] 
ecl: si:find-foreign-symbol expects a base-string, coerce it.

15 months agoExpose struct slot type and count via FOREIGN-SLOT-TYPE and FOREIGN-SLOT-COUNT.
Joshua Elsasser [Sat, 15 Dec 2012 16:09:05 +0000] 
Expose struct slot type and count via FOREIGN-SLOT-TYPE and FOREIGN-SLOT-COUNT.

This is especially useful when the type and count have been groveled.

15 months agoTeach the groveler to print cstruct types which are lists of symbols.
Joshua Elsasser [Sat, 24 Nov 2012 22:03:31 +0000] 
Teach the groveler to print cstruct types which are lists of symbols.

This means that forms such as the following are allowed:

(cstruct foo "struct foo"
  (mybar "mybar" :type (:struct bar)))

15 months agoDon't pass user-defined strings to printf().
Joshua Elsasser [Thu, 22 Nov 2012 19:55:56 +0000] 
Don't pass user-defined strings to printf().

This allows % to be safely used in lisp symbol names which pass
through the groveler, such as the following:

(cvar ("errno" %errno) :int)

15 months agoTeach the groveler's cstruct :type to guess type when :auto is given.
Joshua Elsasser [Thu, 22 Nov 2012 19:41:45 +0000] 
Teach the groveler's cstruct :type to guess type when :auto is given.

This means that integer size and signedness is determined by the
groveler in cases like this:

(cstruct autotype "struct mystruct"
 (myint "myint" :type :auto)
 (myarray "myarray" :type :auto :count :auto))

15 months agoTeach groveler cstruct :count :auto to work on arrays anywhere in the struct.
Joshua Elsasser [Thu, 22 Nov 2012 18:08:17 +0000] 
Teach groveler cstruct :count :auto to work on arrays anywhere in the struct.

The :count :auto logic assumed the struct member was an array which
filled the remainder of the struct, and would generate incorrect cffi
cstruct forms when any other struct members followed one declared
:count :auto.

The following C struct definition and groveler cstruct form
demonstrate this:

struct charbuf {
char three_chars[3];
int clobbered_int
};

(cstruct charbuf "struct charbuf"
  (three-chars "three_chars" :type :char :count :auto)
  (clobbered-int "clobbered_int" :type :int))

15 months agocffi-ecl: c-inline-function-pointer-call bugfix
Juan Jose Garcia Ripoll [Thu, 22 Nov 2012 20:40:40 +0000] 
cffi-ecl: c-inline-function-pointer-call bugfix

The previous fix did not work with functions that return no values.
Surround the code with braces, so that the C compiler does not
complain about the extern declaration.

15 months agocffi-ecl: support multiple FFI backends
Juanjo Garcia-Ripoll [Thu, 22 Nov 2012 14:13:05 +0000] 
cffi-ecl: support multiple FFI backends

Allow the ECL backend to support different combinations of FFI in
the same code by customizing a single special variable.

15 months agoCFFI-GROVEL now uses ASDF operations to compile and load processed grovel and wrapper...
Mark Cox [Sat, 8 Dec 2012 05:47:04 +0000] 
CFFI-GROVEL now uses ASDF operations to compile and load processed grovel and wrapper files.

16 months agoFOREIGN-STRING-ALLOC: don't call NULL-TERMINATOR-LEN twice
Stas Boukarev [Sat, 24 Nov 2012 00:33:08 +0000] 
FOREIGN-STRING-ALLOC: don't call NULL-TERMINATOR-LEN twice

16 months agoforeign-free, sbcl: add (optimize speed) declaration, which avoids
Stas Boukarev [Fri, 23 Nov 2012 14:24:15 +0000] 
foreign-free, sbcl: add (optimize speed) declaration, which avoids
consing aliens.

17 months agoRestore default type class name
Liam M. Healy [Mon, 12 Nov 2012 00:46:33 +0000] 
Restore default type class name

In defcstruct, there was a line, removed in be6267709f, that set a
default type class name by appending "-TCLASS".  Without this line,
the class will be directly FOREIGN-STRUCT-TYPE instead of a subclass.
This is acceptable if the translate methods are not going to be
redefined, but if they are, any change will apply to all instances
(including instances of subclasses of other structures, which may call
these with call-next-method).  In fact, there is a check in
define-translation-method to prevent redefinition with that macro, but
of course a defmethod would be just as bad.

While in principal one can specify the :class argument, this isn't
always possible, for example, if the structure was made by groveling.
Even so, it is a bad idea to make a default which has the potential
for this kind of harm.

This fix now permits GSLL to compile and load correctly.

17 months agoArguments to CONCATENATE need to be sequences.
easye [Mon, 29 Oct 2012 15:14:29 +0000] 
Arguments to CONCATENATE need to be sequences.

17 months agocffi-abcl-20121028a: changes to cffi_0.10.7.1 Quicklisp 2012-10-13 for ABCL.
easye [Mon, 29 Oct 2012 15:03:43 +0000] 
cffi-abcl-20121028a: changes to cffi_0.10.7.1 Quicklisp 2012-10-13 for ABCL.

The interactive restart when reloading callbacks is no longer needed.

A callable function pointer is now returned by CALLBACK and
GET-CALLBACK, which wasn't the case previously.

Now down to 25 failing tests!

Callbacks "automacro-ly" now get a translation layer to convert back
from native types to ones which ABCL expects.  This translation is
currently a work in progress, as not all cases are covered correctly.

(Stas Boukarev) MAKE-FUNCTION-POINTER typo.

Refactored to remove compile warnings about MAKE-IMMEDIATE-OBJECT.

CFFI-SYS::%LOAD-FOREIGN-LIBRARY tries harder to figure out which
library to load.

Docstrings added.

17 months agoFix Solaris compilation options.
easye [Mon, 29 Oct 2012 14:58:27 +0000] 
Fix Solaris compilation options.

The "-fPIC" flag will always be necessary when using GCC-derived compilers as I understand it.

Additionally, Solaris compilation options now unconditionally tries a
64bit build.  Contemporary Solaris (since Solaris 10), are hybrid
32/64 bit environments where "uname -m" reports "i86pc".  Whether one
wants the 32 or 64 bit version of the libraries depends on the type of
the Lisp implementation doing the loading, which is currently not
available in the environment in which make(1) is executing.

17 months agogrovel: include <inttypes.h>
Luís Oliveira [Sun, 4 Nov 2012 14:24:14 +0000] 
grovel: include <inttypes.h>

This header defines the PRI{fmt}{type} printf format specifiers used by
foreign-type-to-printf-specification.

17 months agogrovel: use the right printf specification for bitfields
Nicolas Martyanoff [Sun, 4 Nov 2012 13:43:55 +0000] 
grovel: use the right printf specification for bitfields

The BITFIELD grovel syntax always used %i to print the foreign values. But
when the base type is larger than an int, the resulting values will be
incorrect.

We introduce the FOREIGN-TYPE-TO-PRINTF-SPECIFICATION function which returns a
printf string containing a single format specification for a foreign type, and
use it in the BITFIELD grovel syntax.

17 months agodoc: generate an info directory file
Orivej Desh [Tue, 21 Aug 2012 14:19:50 +0000] 
doc: generate an info directory file

17 months agocffi-manual: fix foreign-string-to-lisp info entry
Luís Oliveira [Sun, 4 Nov 2012 13:19:34 +0000] 
cffi-manual: fix foreign-string-to-lisp info entry

17 months agoInitial port to MKCL
Jean-Claude Beaudoin [Mon, 20 Aug 2012 03:25:25 +0000] 
Initial port to MKCL

17 months agoSpecial-case arm architectures.
Josh Marchán [Sun, 16 Sep 2012 13:32:09 +0000] 
Special-case arm architectures.

17 months agodoc: Update gendocs.sh's URL.
Luís Oliveira [Sun, 3 Jun 2012 17:37:01 +0000] 
doc: Update gendocs.sh's URL.

17 months agogroveller: call the C compiler with -I /usr/local/include/ on FreeBSD
Nicolas Martyanoff [Sat, 19 May 2012 19:10:36 +0000] 
groveller: call the C compiler with -I /usr/local/include/ on FreeBSD

On FreeBSD, GCC only looks in directories of the base
system (/usr/include). We need to manually add /usr/local/include if we want
to be able to bind libraries installed by packages or ports.

22 months agoAdd method expand-to-foreign-dyn-indirect foreign-type-alias
Liam M. Healy [Thu, 7 Jun 2012 03:11:14 +0000] 
Add method expand-to-foreign-dyn-indirect foreign-type-alias

Add method expand-to-foreign-dyn-indirect for type foreign-type-alias so that foreign-string-type will be expanded correctly (as a pointer).

23 months agoLoad cffi-libffi and do FSBV tests in cffi-tests
Liam M. Healy [Mon, 14 May 2012 13:18:36 +0000] 
Load cffi-libffi and do FSBV tests in cffi-tests

23 months agoCreate a function named die, use it for error messages
Stelian Ionescu [Sun, 6 May 2012 14:54:34 +0000] 
Create a function named die, use it for error messages

23 months agoIgnore TYPE in default method of EXPAND-TO-FOREIGN-DYN-INDIRECT
Stelian Ionescu [Sun, 6 May 2012 09:33:08 +0000] 
Ignore TYPE in default method of EXPAND-TO-FOREIGN-DYN-INDIRECT

23 months agoDefine BARE-STRUCT-TYPE-P for FOREIGN-TYPEDEFs
Stelian Ionescu [Sun, 6 May 2012 09:32:46 +0000] 
Define BARE-STRUCT-TYPE-P for FOREIGN-TYPEDEFs

23 months agoTests for cffi-libffi working
Liam M. Healy [Sat, 5 May 2012 15:32:22 +0000] 
Tests for cffi-libffi working

Fix an error in the recursive call in libffi-type-pointer for
foreign-struct-type, now parse the slot-type, which is unparsed.  This
makes FSBV.3 and FSBV.4 succeed.  Removed quote from test FSBV.2; this
makes FSBV.2 succeed.

23 months agocffi-tests: make compilation of libtest2_32 and libfsbv_32 optional.
Luís Oliveira [Fri, 4 May 2012 13:37:57 +0000] 
cffi-tests: make compilation of libtest2_32 and libfsbv_32 optional.

23 months agoRemove *parse-bare-structs-as-pointers* binding in test
Liam M. Healy [Thu, 3 May 2012 16:15:33 +0000] 
Remove *parse-bare-structs-as-pointers* binding in test

23 months agoRewrite backwards-compatibility mode for bare struct types.
Luís Oliveira [Tue, 1 May 2012 03:14:30 +0000] 
Rewrite backwards-compatibility mode for bare struct types.

* Instead of a special variable, the parsed struct type instance is now
  annotated to let the type system know whether we're dealing with
  deprecated semantics (struct type canonicalizes to :pointer) or not.

  This approach should hopefully be much less error-prone.

* Disabled translations for bare structs.

* Fixed and commented out some bogus tests.

23 months agoRevert "Bind *PARSE-BARE-STRUCTS-AS-POINTERS* to T in #'MEM-AREF"
Stelian Ionescu [Mon, 30 Apr 2012 21:17:06 +0000] 
Revert "Bind *PARSE-BARE-STRUCTS-AS-POINTERS* to T in #'MEM-AREF"

This broke other stuff, so revert until we understand what's happening

This reverts commit 944d33183d7b4965d6ea86b37138c6691cd160ca.

23 months agoMerge branch 'bugfix-v0.10.7.1'
Luís Oliveira [Mon, 30 Apr 2012 21:17:33 +0000] 
Merge branch 'bugfix-v0.10.7.1'

23 months agoUse new struct spec in DEFINE-C-STRUCT-WRAPPER
Stelian Ionescu [Mon, 30 Apr 2012 18:39:41 +0000] 
Use new struct spec in DEFINE-C-STRUCT-WRAPPER

23 months agoBind *PARSE-BARE-STRUCTS-AS-POINTERS* to T in #'MEM-AREF
Stelian Ionescu [Mon, 30 Apr 2012 18:38:49 +0000] 
Bind *PARSE-BARE-STRUCTS-AS-POINTERS* to T in #'MEM-AREF

2 years agoImprove documentation of structure reference
Liam M. Healy [Fri, 20 Apr 2012 03:29:27 +0000] 
Improve documentation of structure reference

Improved the documentation for Foreign Structure Types to more clearly
describe the behavior of mem-aref under the new structure reference
syntax and the compatibility of the bare structure reference with the
old behavior.

2 years agoFix compiler macro for mem-aptr (Stas Boukarev)
Liam M. Healy [Thu, 19 Apr 2012 17:51:21 +0000] 
Fix compiler macro for mem-aptr (Stas Boukarev)

2 years agocffi-ecl: check for long-long support. bugfix-v0.10.7.1 v0.10.7.1
Luís Oliveira [Sat, 14 Apr 2012 19:27:40 +0000] 
cffi-ecl: check for long-long support.

2 years agocffi-tests: don't attempt to create threads when Lisp doesn't support them.
Luís Oliveira [Sat, 14 Apr 2012 19:27:22 +0000] 
cffi-tests: don't attempt to create threads when Lisp doesn't support them.

2 years agocffi-tests: exclude encodings requiring BOM in STRING.ENCODINGS.ALL.BASIC.
Luís Oliveira [Sat, 14 Apr 2012 18:39:29 +0000] 
cffi-tests: exclude encodings requiring BOM in STRING.ENCODINGS.ALL.BASIC.

2 years agocffi-tests: replace UTF-16 test with explicit UTF-16{BE,LE} versions.
Luís Oliveira [Sat, 14 Apr 2012 18:23:05 +0000] 
cffi-tests: replace UTF-16 test with explicit UTF-16{BE,LE} versions.

2 years agoFix expand-to-foreign-dyn-indirect
Liam M. Healy [Sat, 14 Apr 2012 17:58:52 +0000] 
Fix expand-to-foreign-dyn-indirect

Create a new function #'foreign-expand-runtime-translator-or-binding
which is what the methods
  expand-to-foreign-dyn (value var body (type enhanced-foreign-type))
  expand-to-foreign-dyn-indirect (value var body (type translatable-foreign-type))
both call.  Previously, the body of that function was the body of the
first method, and the second method called that generic function.
This did not work as intended however, the result being that libffi
calls were passed the actual object instead of the pointer.  This
change fixes that problem.

2 years agocffi-manual: fix TRANSLATE-NAME-FROM-FOREIGN example.
Luís Oliveira [Sat, 14 Apr 2012 17:28:11 +0000] 
cffi-manual: fix TRANSLATE-NAME-FROM-FOREIGN example.

2 years agoApply CANONICALIZE-SYMBOL-NAME-CASE to symbols created via DEFCVAR.
Luís Oliveira [Sat, 14 Apr 2012 17:25:34 +0000] 
Apply CANONICALIZE-SYMBOL-NAME-CASE to symbols created via DEFCVAR.

2 years agoFix typo: signed 64bit accessor is sb-sys:signed-sap-ref-64
Stelian Ionescu [Thu, 12 Apr 2012 13:31:34 +0000] 
Fix typo: signed 64bit accessor is sb-sys:signed-sap-ref-64

2 years agoFix typo: signed 64bit accessor is sb-sys:signed-sap-ref-64
Stelian Ionescu [Thu, 12 Apr 2012 13:31:34 +0000] 
Fix typo: signed 64bit accessor is sb-sys:signed-sap-ref-64

2 years agoNew function expand-to-foreign-dyn-indirect libffi
Liam M. Healy [Sun, 25 Mar 2012 19:16:01 +0000] 
New function expand-to-foreign-dyn-indirect

New function expand-to-foreign-dyn-indirect split out from
expand-to-foreign-dyn, and the latter function returned to its
definition as given in the tip of master, ab10be4fb8.  This function
is used if the optional argument 'indirect to translate-objects is T,
which in turn the case when functions are calling or return structures
by value.

2 years agoCompiler macro for mem-aptr
Liam M. Healy [Fri, 23 Mar 2012 02:09:35 +0000] 
Compiler macro for mem-aptr

Multi-level optimizations depending what arguments are constantp;
the constantp arguments need to be evaled.

2 years agoAdd libffi.so.6, libffi32.so.6 to unix load list
Liam M. Healy [Sun, 18 Mar 2012 02:56:38 +0000] 
Add libffi.so.6, libffi32.so.6 to unix load list

Ubuntu 11.10 ships with libffi6 and not libff5, so these libraries are
now added to the load list.

2 years agoChange comment to refer to "libffi"
Liam M. Healy [Fri, 16 Mar 2012 04:12:27 +0000] 
Change comment to refer to "libffi"

Comment referred to "FSBV" now corrected to "libffi".  Other uses (the
tests and foreign library for tests, the *feature* symbol, and the
variable 'fsbvp resulting from fn-call-by-value-p) genuinely refer to
FSBV and not specifically libffi.  Distinction: "FSBV" refers to all
calls of structures by value, whether accomplished with the help of
libffi or not (some compilers have FSBV built in), "libffi" refers to
the use of the libffi library whether or not for calling foreign
structures by value (there are other functions not yet made use of in
CFFI, but someday might).

2 years agoMerge branch 'master' into libffi
Liam M. Healy [Fri, 16 Mar 2012 04:02:54 +0000] 
Merge branch 'master' into libffi

Conflicts:
tests/GNUmakefile

2 years agoDefine a compiler macro for #'mem-aptr
Liam M. Healy [Fri, 16 Mar 2012 03:46:07 +0000] 
Define a compiler macro for #'mem-aptr

2 years agocffi-abcl: implement callbacks. v0.10.7
Luís Oliveira [Sun, 11 Mar 2012 21:11:42 +0000] 
cffi-abcl: implement callbacks.

Patch courtesy of Mark Evenson.

2 years agocffi-abcl: autoload JNA dependency.
Luís Oliveira [Sun, 11 Mar 2012 21:11:16 +0000] 
cffi-abcl: autoload JNA dependency.

Patch courtesy of Mark Evenson.

2 years agoAdd support for Digitool MCL.
Luís Oliveira [Sat, 10 Mar 2012 10:54:31 +0000] 
Add support for Digitool MCL.

Patch courtesy of James Anderson.

2 years agoUpdate manual to include mem-aptr
Liam M. Healy [Mon, 5 Mar 2012 04:32:44 +0000] 
Update manual to include mem-aptr

2 years agoDefine mem-aptr; untested
Liam M. Healy [Thu, 1 Mar 2012 04:44:36 +0000] 
Define mem-aptr; untested

New function mem-aptr will return the pointer to the requested element
of the array, and add documentation.  It is untested.

2 years agoFix alloc_pair test return type syntax
Liam M. Healy [Sun, 12 Feb 2012 16:09:28 +0000] 
Fix alloc_pair test return type syntax

2 years agoRename system to cffi-libffi, add restart to default *foreign-structures-by-value*
Liam M. Healy [Sun, 5 Feb 2012 22:02:08 +0000] 
Rename system to cffi-libffi, add restart to default *foreign-structures-by-value*

2 years agoUse hash table for libffi-type-pointer
Liam M. Healy [Sat, 4 Feb 2012 18:10:52 +0000] 
Use hash table for libffi-type-pointer

Use hash table for libffi-type-pointer instead of a class slot, and
simplify #'libffi-type-pointer methods.  Remove obsolete package
definition file.  Tests in cffi-tests not run due to error in load,
but GSLL tests pass.

2 years agoMoved slots-in-order after foreign-struct-type, clean up libffi-*.lisp
Liam M. Healy [Sun, 29 Jan 2012 02:10:26 +0000] 
Moved slots-in-order after foreign-struct-type, clean up libffi-*.lisp

2 years agocffi-abcl: fix bitrot. s/calling-convention/convention
Luís Oliveira [Thu, 26 Jan 2012 01:03:55 +0000] 
cffi-abcl: fix bitrot. s/calling-convention/convention

Bug reported by Anton Vodonosov.

2 years agoFix conditionalization syntax in cffi-fsbv.asd
Liam M. Healy [Mon, 23 Jan 2012 20:10:20 +0000] 
Fix conditionalization syntax in cffi-fsbv.asd

2 years agoAdd Windows grovel file
Liam M. Healy [Mon, 23 Jan 2012 14:54:06 +0000] 
Add Windows grovel file

Added a Windows grovel file from CRLF0710, modified from the
standalone FSBV unix file.  Minimally modified for CFFI with updated
header and package, not tested at all.

2 years agoEliminate package cffi-fsbv, put :sizet in keyword package
Liam M. Healy [Fri, 13 Jan 2012 04:34:18 +0000] 
Eliminate package cffi-fsbv, put :sizet in keyword package

2 years agocffi-allegro: signal clearer error when [u]llong is unsupported
Luís Oliveira [Fri, 13 Jan 2012 01:31:49 +0000] 
cffi-allegro: signal clearer error when [u]llong is unsupported

2 years agocffi-tests: fix bug in ullong(); mark expected failure.
Luís Oliveira [Tue, 10 Jan 2012 22:11:05 +0000] 
cffi-tests: fix bug in ullong(); mark expected failure.

DEFCFUN.UNSIGNED-LONG-LONG fails on Allegro: lp#914500.

2 years agominor fix for allegrocl's long-long support
Jianshi Huang [Fri, 6 Jan 2012 21:14:15 +0000] 
minor fix for allegrocl's long-long support

2 years agoNew tests: DEFCFUN.UNSIGNED-LONG-LONG and FUNCALL.UNSIGNED-LONG-LONG.
Luís Oliveira [Sat, 7 Jan 2012 01:02:07 +0000] 
New tests: DEFCFUN.UNSIGNED-LONG-LONG and FUNCALL.UNSIGNED-LONG-LONG.

2 years agocffi-tests: make compilation of 32-bit libtest optional.
Luís Oliveira [Fri, 6 Jan 2012 00:17:38 +0000] 
cffi-tests: make compilation of 32-bit libtest optional.

Fixes lp#911557. Reported by Elias Pipping. Solution courtesy of
Daniel Herring.

2 years agoUse soname with major version for libffi on unix
Liam M. Healy [Fri, 25 Nov 2011 20:03:44 +0000] 
Use soname with major version for libffi on unix

Use soname with major version for libffi on unix as advocated on
http://lispcaveats.tumblr.com/post/13259176455/ffi-linking-against-shared-libraries.

2 years agoArgument 'indirect to #'expand-to-foreign-dyn is key instead of optional
Liam M. Healy [Thu, 24 Nov 2011 22:44:13 +0000] 
Argument 'indirect to #'expand-to-foreign-dyn is key instead of optional

Argument 'indirect to #'expand-to-foreign-dyn is key instead of
optional, so that other systems that define a method can just have
&key, and they do not have to add this argument if they don't need to
use it.

2 years agoBind (*parse-bare-structs-as-pointers* t) when parsing function definitions
Liam M. Healy [Thu, 24 Nov 2011 22:28:53 +0000] 
Bind (*parse-bare-structs-as-pointers* t) when parsing function definitions

In parse-args-and-types, foreign-funcall-form,
foreign-funcall-varargs-form, bind
(*parse-bare-structs-as-pointers* t)
when parsing function definitions so that if a bare structure is
specified, the expanded form with have :pointer or (:pointer (:struct
foo)) and therefore the type will be correctly recognized.

2 years agoFix uffi-compat:octets-to-string.
Luís Oliveira [Mon, 21 Nov 2011 02:17:49 +0000] 
Fix uffi-compat:octets-to-string.

Initial patch courtesy of François-René Rideau.

2 years agoFixed incorrect use of sap-ref-word for longs on 64-bit Windows.
Anton Kovalenko [Wed, 16 Nov 2011 09:09:06 +0000] 
Fixed incorrect use of sap-ref-word for longs on 64-bit Windows.

Implemented automatic accessor lookup for integer types, based on
alien type size and CFFI keyword -> alien type mapping.

2 years agoAdditional methods for translate-into-foreign-memory and expand-to-foreign-dyn
Liam M. Healy [Sun, 13 Nov 2011 16:17:41 +0000] 
Additional methods for translate-into-foreign-memory and expand-to-foreign-dyn

In order that structures called by value work correctly (in
cffi-fsbv), add methods:
translate-into-foreign-memory
  foreign-built-in-type
  enhanced-typedef
expand-to-foreign-dyn
  foreign-built-in-type
  foreign-pointer-type

2 years agoIndirecting foreign objects for libffi
Liam M. Healy [Sun, 13 Nov 2011 06:17:42 +0000] 
Indirecting foreign objects for libffi

The generic function translate-into-foreign-memory has been slightly
repurposed and expanded to provide indirection of enums and pointers.
The function translate-objects and generic function
expand-to-foreign-dyn have a new argument, 'indirect, that when set,
expand to with-foreign-object and translate-into-foreign-memory
instead of translate-to-foreign, unwind-protect, and
free-translated-object.  This insures that all arguments to functions
passed to libffi are indirected one level, as is required.

2 years agoAdded stdcall callback support for SBCL back-end
Dmitry Ignatiev [Thu, 9 Dec 2010 15:11:54 +0000] 
Added stdcall callback support for SBCL back-end

2 years agogrovel: dispatch on size of :POINTER to initialize *CPU-WORD-SIZE-FLAGS*
Luís Oliveira [Thu, 10 Nov 2011 21:16:48 +0000] 
grovel: dispatch on size of :POINTER to initialize *CPU-WORD-SIZE-FLAGS*

We were previously using :LONG, but that does not match the machine word
size on some platforms, namely Windows.

Bug reported by Anton Kovalenko.

2 years agoUse structure specification (:struct foo) in defcstruct expansion
Liam M. Healy [Mon, 31 Oct 2011 04:09:22 +0000] 
Use structure specification (:struct foo) in defcstruct expansion

Modify #'generate-struct-accessors so that when generating accessors,
the structure is referred to with the (:struct foo) syntax, rather
than just 'foo.  While such a reference usually generates only a style
warning, if parse-deprecated-struct-type hasn't been called yet, as is
the case for slot defintions in the defcstruct expansion, it results
in an error.  This problem prevented shuffletron from compiling.

2 years agoCall-by-value with :void return, do not allocate return object
Liam M. Healy [Sun, 30 Oct 2011 03:12:40 +0000] 
Call-by-value with :void return, do not allocate return object

2 years agoRemove fsbv-standalone
Liam M. Healy [Sun, 30 Oct 2011 02:57:28 +0000] 
Remove fsbv-standalone