-
Support for 'const' and 'volatile'
#780 -
Make
string
a view ofptr (const char)
, notptr char
#782 -
Add
CArray.iteri
#775
Thanks to Antoine Provot (@Ant1-Provot) and @prgbln for contributions to this release.
- Support for OCaml 5.2.0
#764
Thanks to Nick Roberts (@ncik-roberts) and Danny Willems (@dannywillems) for contributions to this release.
- Add missing version information to dune-project
- Switch to dune
#588
Thanks to Anil Madhavapeddy (@avsm) and Etienne Millon (@emillon) for contributing to this release.
-
Restore compilation of cmxs for 5.0
#727 -
Update build rules to make .o files a dependency of cmxs
#723 -
update CArray.of_string comment to accurately reflect the length
#716
Thanks to @houseofsuns, @ygrek, Alpha Diallo (@moyodiallo), François Bobot (@bobot) and Alfredo Tupone (@atupone) for contributions to this release.
- Fix warning 9 [missing-record-field-pattern] in generated OCaml code
#700
Thanks to Antonin Décimo (@MisterDA) for contributing to this release.
-
Remove naked pointers from the Dl library
#681 -
Avoid running a full GC cycle on every FFI closure allocation
#694 -
Check output of
brew ls --versions
when detecting homebrew
#697
Thanks to Martin Kletzander (@nertpinx) and Arseniy Alekseyev (@aalekseyev) for contributions to this release.
- Fix use of CAMLdrop in generated code
#680
- Drop compatibility with 4.02, and improve compatibility with Multicore OCaml
#673
Thanks to Kate Deplaix (@kit-ty-kate) for contributing to this release.
-
Remove the
Unix
dependency by usingbigarray-compat
#660 -
Remove the threaded/unthreaded split in ctypes-foreign
#651 -
Speed-up
CArray.make
with initial value
#644 -
Fix complex allocation size
#642 -
Report names of missing symbols also under windows
#641 -
Remove a level of boxing from struct and union values
#640 -
Fix a markup issue in the
funptr
docstring
#633 -
Move conf-pkg-config dependency to ctypes-foreign
#631
Thanks to Andreas Hauptmann (@fdopen), Anil Madhavapeddy (@avsm), Anton Bachin (@aantron), Calascibetta Romain (@dinosaure), Sora Morimoto (@smorimoto) and and Stéphane Glondu (@glondu) for contributions to this release.
- Hide the managed component in pointer values
#629
(This is an internal-only change that addresses a problem introduced in 0.17.0)
-
ocaml_bytes now corresponds to 'unsigned char *', not 'char *'
#625 -
Distinguish bytes and string in generated stub code
#622 -
Reflect "managed" status in the types of fat pointers
#619
(This is an internal-only change.)
-
Add
Foreign.dynamic_funptr
, a variant ofForeign.funptr
with explicit life cycle management.
#595 -
fix ctypes-foreign depexts to work with opam 2
#617 -
Build with -strict-sequence
#613
Thanks to Andreas Hauptmann (@fdopen), Andrew Ray (@andrewray), Anil Madhavapeddy (@avsm), Armaël Guéneau (@Armael) and Matthias Horn (@tiash) for contributions to this release.
- Fix <complex.h>-related compilation issues on FreeBSD
#608
-
Avoid unaligned stores/loads
#584 -
Fix LDouble.to_int bug resulting from upstream Val_long change
#583 -
use CMPLX[FL]? macros instead of I
#585 -
Various Windows fixes
#586 -
Drop OCaml 4.01 support
#577 -
Eliminate uses of <complex.h> on Android
#579
Thanks to Anton Bachin (@aantron), Andreas Hauptmann (@fdopen) and @ygrek for contributions to this release.
Thanks to Andreas Hauptmann (@fdopen), Rudi Grinberg (@rgrinberg) and Marcello Seri (@mseri) for contributions to this release.
- Add -no-keep-locs to the foreign-(un)?threaded build rules.
#553
-
Print typedefed enums correctly
#547 -
Move the TYPE and FOREIGN signatures from cstubs to ctypes
#544
#537
Thanks to Leo White (@lpw25) for contributing to this release.
- Preserve intermediate values from views across foreign calls.
#531
-
Support for Fortran-layout bigarrays
#523 -
Use the integers package for signed and unsigned integer support
#515 -
Add support for binding enums defined without tags
#510
Thanks to Bertrand Bonnefoy-Claudet (@bbc2) and Leo White (@lpw25) for contributions to this release.
- Fix function pointer support on no-exec platforms
#511
Thanks to Matthias Horn (@tiash) for contributing to this release.
-
Stub out some
long double
functions that are not supported on NetBSD and OpenBSD
#503 -
Fix the build when shared libraries are not available
#495
Thanks to Andreas Hauptmann (@fdopen) and Peter Zotov (@whitequark) for contributions to this release.
- Fix truncation in UInt64.of_int; remove other uses of
Val_int
/Int_val
#492
- Stub out some
long double complex
functions that are not supported on Android
#486
Thanks to Peter Zotov (@whitequark) and Jeremie Dimino (@diml) for contributions to this release.
-
Support for the
long double
andlong double complex
types
#475 -
Support for binding foreign arrays
#470 -
Improved printing for structs and unions without tags
#467 -
Added a function
is_null
#463
-
Custom operations (namely deserializing) for unsigned integers registered
#480 -
All objects kept live when the runtime lock is released
#473
Thanks to Andrew Ray (@andrewray) and Yunxing Dai (@yunxing) for contributions to this release.
- Fix generated code for Lwt jobs where the return type is
void
.
#460
Thanks to David Sheets (@dsheets) for contributions to this release.
- Always extend integers returned from closures to full word size
(Fixes incorrectly-promoted integers returned from callbacks on ARM and MIPS)
#456
Thanks to Andreas Hauptmann (@fdopen) for contributions to this release.
-
Windows support for registration of C threads from callbacks
#450 -
Auto-load custom printers in the OCaml toplevel
#448 -
Add some extra
CArray
functions:sub
,copy
,fold_right
,fold_left
,mapi
,map
,iter
#323
-
Build fix for OpenBSD
#454 -
Fix for platforms (e.g. NetBSD) where standard integer types are defined as macros
#453 -
Add missing bounds check in
CArray
#447
- Dl.dlsym now returns
nativeint
, notCtypes_ptr.voidp
#445
Thanks to Andreas Hauptmann (@fdopen) for contributions to this release.
- Revert a ctypes-foreign build regression in 0.9.1
#443
Thanks to Enguerrand Decorne (@engil) for contributing to this release.
-
NetBSD support
-
Support for releasing the runtime lock in generated stubs
#429 -
Support for Lwt_preemptive
#430
Thanks to Martin Lucina (@mato) for contributing to this release.
-
Use unboxed types for
uint8_t
anduint16_t
#413 -
Reset
errno
in Lwt jobs before invoking job function
#426 -
Add a
~thread_registration
argument tofunptr
to support registering C threads with the OCaml runtime.
#420
-
Use
-opaque
for module interfaces whosecmx
files are not installed.
#423 -
Install
cstubs
cmx
files.
#424
Thanks to David Sheets (@dsheets) and Demi Obenour (@DemiMarie) for contributions to this release.
-
Add support for bytecode-only architectures
#410 -
Add a new
sint
type corresponding to a full-range C integer and updateerrno
support to usesint
#411
-
Handle small integer return types correctly on big-endian platforms
#404 #405 -
Fix a bug with callbacks that return small types (less than a word)
#405
Thanks to Stephane Glondu (@glondu) for contributions to this release.
-
Fix for argument quoting in the Windows build after new cross compilation support
#399 -
Improve Lwt jobs support for functions with many or no arguments
#400
Thanks to Andreas Hauptmann (@fdopen) for contributing to this release.
- Fix constructor qualification in code generated for inverted stubs:
#397
-
The
Cstubs.FOREIGN
interface has been extended withreturning
and@->
, and some new types.
See the pull request for details:
#389NB: code that generates bindings using
Cstubs
may need to be updated to selectreturn
and@->
from the bindings functor argument rather than from theCtypes
module. Code that needs to be updated will fail to compile with the new interface. The pull request shows how to update your code, if necessary. -
The
Cstubs
module can now generate asynchronous bindings to C functions using the Lwt jobs framework.
See the pull request for details:
#391 -
The
Cstubs
module now supports optionally returningerrno
alongside the return value of bound C functions.
See the pull request for details:
#392 -
Cross-compilation support is improved: the configuration step no longer runs binaries on the host.
See the pull request for details:
#383 -
The
Unsigned.S
interface has newof_int64
andto_int64
functions.
-
The deprecated
*:*
and+:+
functions have been removed. UseCtypes.field
instead. -
OCaml 4.00.* is no longer supported. The earliest supported OCaml release is 4.01.0
Thanks to Spiros Eliopoulos (@seliopou), @orbitz, Leonid Rozenberg (@rleonid) and Peter Zotov (@whitequark) for contributions to this release.
- Use a C function, not
Pervasives.ignore
, to keep values alive.
Thanks to Andreas Hauptmann (@fdopen), David Sheets (@dsheets), Etienne Millon (@emillon), Goswin von Brederlow (@mrvn), Leonid Rozenberg (@rleonid), @orbitz, Max Mouratov (@cakeplus), and Peter Zotov (@whitequark) for contributions to this release.
-
Build and install
*.cmt
and*.cmti
files. -
Expose
time_t
as an unsigned value -
Expose larger interfaces for POSIX types known to be integer types.
-
Add support for 1- and 2-byte unsigned integer typedefs.
-
Add support for 1-byte and 2-byte integer typedefs.
-
Add a
Signed.Int
module. -
Expose more information in the
Uncoercible
exception. -
allocate_n
now defaults to zeroing its memory. -
Add public root management interface.
NB: the interface is experimental and subject to change.
-
Look through views to add fields to structs and unions.
-
Support signed arithmetic operations for
ssize_t
. -
Add support for
ptrdiff_t
as a typedef for a signed integer type. -
Support
intptr_t
anduintptr_t
as typedefs -
Support coercions between object and function pointers.
-
Add public
funptr_of_raw_address
function. -
Support
static_funptr
coercions -
Add function pointers to the core type language
(See the
Ctypes_static.static_funptr
type, on whichForeign.funptr
andForeign.foreign
are now based.) -
Better support for functions returning void with inverted stubs.
-
Add support for releasing runtime lock to Cstubs_inverted.
-
Fix: inconsistent use of
caml_stat_*
functions -
Fix: a memory leak in
ctypes_caml_roots_release
- Fix a bug involving access to local roots while the runtime lock was not held.
Thanks to Etienne Millon (@emillon) for contributing to this release.
- Fix placement of docstring titles
- Add funptr's optional arguments to funptr_opt
- Fix a typo in libffi detection code
- Synchronize foreign.mli files (documentation)
Thanks to A. Hauptmann (@fdopen), David Sheets (@dsheets), Maverick Woo (@maverickwoo), Peter Zotov (@whitequark), David Kaloper (@pqwy), Ramkumar Ramachandra (@artagnon), Thomas Braibant (@braibant), Hugo Heuzard (@hhugo) and Edwin Török (@edwintorok) for contributions to this release.
-
Support for the C99 bool type
-
Typedef support
-
Enum support
-
Support for accessing C globals with foreign_value in generated stubs
-
Support for retrieving #define and enum constants from C
-
Windows support
There is now support for Windows (32-bit and 64-bit, using MinGW) and automatic building and testing on Windows using Appveyor.
-
Support for releasing the runtime lock in C calls
The new
release_runtime_lock
argument toForeign.foreign
indicates whether the OCaml runtime lock should be released during the call to the bound C function, allowing other threads to run. -
Support for acquiring the runtime lock in callbacks
There is a new
runtime_lock
argument toForeign.funptr
. Settingruntime_lock
totrue
indicates that the OCaml runtime lock should be acquired during calls from C to OCaml and released during calls through function pointers from OCaml to C. -
Support for passing 'bytes' values directly to C
See the relevant section of the FAQ.
-
Add support for custom printers in views.
-
Optionally obtain struct and union layout from C
- string_opt wraps char *, not void *.
- Remove some poorly-supported POSIX types
- Use nativeint to represent pointers
- Support zero-argument callbacks
- findlib package naming: ctypes.foreign-base ~> ctypes.foreign.base &c.
- Make it possible to print a field name
- Better exception handling when using RTLD_NOLOAD
- RTLD_LOCAL support
- Changed the #include path to $(ocamlfind query ctypes)
- Renamed some internal modules to avoid name clashes
Thanks to Yakov Zaytsev (@ysz) for contributing to this release.
- fix printing for nullary function stubs
- respect
pbyte_offset
with cstubs
- Add bytes to the META "requires" field
- Support for 'bytes'
- Avoid invalidated pointer access
Thanks to Peter Zotov (@whitequark), David Sheets (@dsheets), Mike McClurg (@mcclurmc) and Anil Madhavapeddy (@avsm) for contributions to this release.
(Patch by Peter Zotov.)
The implications are discussed in the FAQ.
There are various examples available of packages which use stub support: see the fts example in the distribution (which uses a custom Makefile), this fork of async_ssl (which uses OCamlMakefile), and the cstubs branch of ocaml-lz4 (which uses oasis and ocamlbuild).
See the ocaml-ctypes-inverted-stubs-example repository for a sample project which exposes a part of Xmlm's API to C.
- Add a function
string_from_ptr
for creating a string from an address and length. - Generate codes for libffi ABI specifications.
- Support for passing complex numbers to C using the stub generation backend.
- Add
raw_address_of_ptr
, an inverse ofptr_of_raw_address
. - Add a function
typ_of_bigarray_kind
for convertingBigarray.kind
values toCtypes.typ
values. - Improved coercion support
Array
has been renamed toCArray
.
- Fix GC-related bug that shows up on OS X.
- Don't install ctypes-foreign cmx files.
- Bump META version
Thanks to Ivan Gotovchits, Greg Perkins, Daniel Bünzli, Rob Hoes and Anil Madhavapeddy for contributions to this release.
See Bigarray types and Bigarray values for details.
See the FAQ for details.
Loading the new findlib package ctypes.top
in the toplevel will install custom printers for C types and values.
- Basic coercion support
- Remove
returning_checking_errno
; pass a flag toforeign
instead. - Add an optional argument to
Foreign.foreign
that ignores absent symbols. (Patch by Daniel Bünzli.) - More precise tests for whether types are 'passable'
- Compulsory names for structure and union fields (
*:*
and+:+
are deprecated, but still supported for now.) UInt32.of_int32
,UInt32.to_int32
,UInt64.of_int64
, andUInt64.to_int64
functions.- Finalisers for ctypes-allocated memory.
- Add a
string_opt
view (Patch by Rob Hoes.) - Add the 'camlint' basic type.
- Complex number support
- Abstract types now have names.
- Remove hard-coded alloc size
initial release