Skip to content
  1. Feb 03, 2022
  2. Dec 13, 2021
    • Stelian Ionescu's avatar
      Switch to lispci/cl-travis · 384d96bd
      Stelian Ionescu authored
       * build all branches
       * test more implementations (but only SBCL and CCL are mandatory)
       * libffi-dev is now installed by cl-travis
       * disable TEST-STATIC-PROGRAM because it fails due to sbcl.o not being
      build with -fPIE
       * print unexpected failures at the end of the test run
      384d96bd
  3. Aug 19, 2021
    • stacksmith's avatar
      Allow local names in WITH-FOREIGN-SLOTS · 743a9025
      stacksmith authored
      It remains compatible with existing code, but accepts additional formats for bindings:
      1) (name slot-name) - just like WITH-SLOTS;
      2) (name :pointer slot-name) - a pointer version.
      743a9025
  4. Apr 03, 2021
  5. Mar 29, 2021
  6. Oct 15, 2020
  7. May 13, 2020
  8. May 12, 2020
  9. May 11, 2020
  10. May 04, 2020
    • Shinmera's avatar
      Implement an enum flag that elides an error when translating an enum value that was not declared. · 2e945ea7
      Shinmera authored
      This is useful for very large enumerations of which we're only interested in a subset, or enumerations that allow for arbitrary client or vendor extensions that we cannot be aware of. Erroring on a value that we ostensibly do not care about in such a situation is not desirable, and instead simply passing through the integer allows handling the interesting cases easily in a CASE or something similar.
      2e945ea7
  11. Feb 26, 2020
    • Madhu's avatar
      fix translation of struct-typedefs · c5d140fe
      Madhu authored
      CFFI now always translates aggregate struct values to lisp property
      lists.  Earlier struct values which were defined by types introduced
      by defctype were translated as foreign pointers.
      
      One consequence of this change is that defcvar to a foreign struct
      will always produce an immutable lisp list.  To modify the struct the
      user first has to get at the pointer to the struct via
      FORIEGN-SYMBOL-VALUE or GET-VAR-POINTER.  To modify nested structs the
      user has to get at the pointer to the field via FORIEGN-SLOT-POINTER,
      - or use the the (:POINTER VAR) syntax of WITH-FOREIGN-SLOTS.
      
      * src/early-types.lisp: (defctype): use translatable-foreign-type
      instead of enhanced-foreign-type.
      
      * tests/structs.lisp: New tests: (misnamed) STRUCT-VALUES.FSBV.1
      STRUCT-VALUES.FSBV.1 Updated tests: STRUCT.ALIGNMENT.1
      STRUCT.ALIGNMENT.2 STRUCT.ALIGNMENT.3 STRUCT.ALIGNMENT.4
      STRUCT.ALIGNMENT.5 STRUCT.ALIGNMENT.6 STRUCT.ALIGNMENT.7
      STRUCT.NESTED-SETF STRUCT.ALIGNMENT.8
      c5d140fe
  12. Jan 24, 2020
  13. Oct 20, 2018
  14. Jan 03, 2018
    • Michał Herda's avatar
      Add &REST MAKE-ARRAY-ARGS to FOREIGN-ARRAY-TO-LISP (#128) · 8a2bd255
      Michał Herda authored
      Rename test ARRAY.ROUND-TRIP to ARRAY.FOREIGN-TO-LISP.BASIC
      Add test ARRAY.FOREIGN-TO-LISP.ADJUSTABLE
      Add test ARRAY.FOREIGN-TO-LISP.DISPLACED
      Add test ARRAY.FOREIGN-TO-LISP.SPECIALIZED
      
      Implementation detail for test ARRAY.FOREIGN-TO-LISP.SPECIALIZED:
      
      15.1.2.2 of the Holy Standard states that the only truly portable array
      specializations are for bits (bit-vectors) and characters (strings). Since
      char-codes are implementation-dependent, it would be tricky to write a
      portable test for them without generating characters at runtime. So, for a
      truly portable test, we are only left with bits, which are luckily numeric,
      and equal to (UNSIGNED-BYTE 1).
      
      This is why this test is so terribly wasteful, spending a whole byte for a
      single bit - CFFI has no capabilities for dealing with single bits, and this
      test is only meant to check correctness of the :ELEMENT-TYPE argument to
      MAKE-ARRAY. In actual use cases of specialized FOREIGN-ARRAY-TO-LISP, capable
      implementations will be able to make specialized arrays of types that are
      commonly optimized for and/or representable in hardware, such as
      (UNSIGNED-BYTE 8) on x86 architectures.
      
      Implements lp bug #1740800.
      8a2bd255
  15. Oct 05, 2017
    • Daniel Kochmański's avatar
      tests: various fixes and additions · e5da2d75
      Daniel Kochmański authored and Luís Oliveira's avatar Luís Oliveira committed
      enum: even if it's just a cosmetic difference between :int and :uint
      in ECL for inline calls it does matter - and another-boolean enum is
      of type :uint (no negative values).
      
      foreign-alloc.10: foreign-free may return no values, wrap result
      in (values #0).
      
      unlock callback.bff.* tests for ECL which doesn't choke on them as was
      suggested in the comments.
      
      add defcfun.varargs.nostdlib and funcall.varargs.nostdlib tests. They
      use variadic function defined in libtest.c (hence - not declared
      anywhere) `sum_double_arbitrary'.
      
      `sprintf' is a good vararg function example, but if
      implementation (like ECL) has it the declaration already included, it
      may lead some tests to pass which wouldn't otherwise (and vice-versa)
      for static ffi.
      e5da2d75
    • Daniel Kochmański's avatar
      tests: funcall: call sprintf with foreign-funcall-varargs · 0d2b3c00
      Daniel Kochmański authored and Luís Oliveira's avatar Luís Oliveira committed
      This function takes variable number of arguments and we have
      abstraction for that.
      0d2b3c00
  16. Oct 03, 2017
  17. Jan 29, 2017
    • Francois-Rene Rideau's avatar
      Improve c-toolchain · 1c28a961
      Francois-Rene Rideau authored and Attila Lendvai's avatar Attila Lendvai committed
      Add support for getting parameters from new SBCL sbcl.mk.
      Add support for getting parameters from CLISP makevars.
      Add support for getting parameters for ECL and MKCL.
      
      Refactor static linking to use the above.
      On SBCL, this relies on the new feature :sb-linkable-runtime
      (from 1.3.14-20-g402a8fab6).
      On ECL and MKCL, have static-{image,program}-op be pass-through synonyms
      for the usual variants.
      Remove deceitful incomplete support for static linking on CMUCL.
      
      Add shell test for static linking, to better work with SBCL (uses cl-launch).
      
      Add class c-file for C files to compile, and o-file for precompiled objects.
      They can be either dynamically loaded into the current process,
      or statically linked into a new runtime.
      
      Upgrade backward compatibility bundle from asdf 3.1.6 to 3.2.0.
      Stop manually curating a minimal set of changes,
      just adopt a new bundle.lisp wholesale.
      1c28a961
  18. Feb 24, 2016
  19. Feb 02, 2016
  20. Jan 29, 2016
  21. Jan 28, 2016
  22. Jan 07, 2016
    • Liam M. Healy's avatar
      cffi-libffi: Fix translate-objects-ret · 7d0200cf
      Liam M. Healy authored
      In translate-objects-ret for cffi-libffi, dereference the pointer
      returned from the foreign function first, then call
      translate-objects. This fixes an error reported by Attila Lendvai in
      e54b7abb when typedef is used. Test he contributed (now called
      fsbv.return-value-typedef) now passes.
      7d0200cf
  23. Jan 06, 2016
  24. Dec 26, 2015
  25. Dec 23, 2015
  26. Dec 19, 2015
    • Liam M. Healy's avatar
      Fix libffi with enum argument · 215ea91b
      Liam M. Healy authored
      The function #'expand-to-foreign-dyn-indirect, used by cffi-libffi, did
      not create the correct expansion when there was an enumerated argument,
      because two translations are required, one from the symbol to an
      integer, and the second to make the integer indirect, passing a pointer
      to libffi. This remedies that problem by defining a method for
      expand-to-foreign-dyn-indirect specific to foreign-enum that recursively
      calls expand-to-foreign-dyn-indirect twice. A test, fsbv.8, has been
      created.
      215ea91b
  27. Dec 02, 2015