1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-26 21:20:30 +02:00

Support C99 complex types in (system foreign)

* libguile/foreign.h (SCM_FOREIGN_TYPE_COMPLEX_FLOAT,
  SCM_FOREIGN_TYPE_COMPLEX_DOUBLE): New enums.
* module/system/foreign.scm (complex-float, complex-double): Export new types.
  (make-c-struct, parse-c-struct): Support the new types.
* libguile/foreign.c (complex-float, complex-double): Define new types.
  (alignof, sizeof, pack, unpack): Support the new types.
* test-suite/tests/foreign.test: Test.
This commit is contained in:
Daniel Llorens 2021-11-11 15:47:42 +01:00
parent 24116be822
commit 496f69dba2
6 changed files with 110 additions and 2 deletions

View file

@ -465,8 +465,11 @@ C types.
@defvrx {Scheme Variable} int64
@defvrx {Scheme Variable} float
@defvrx {Scheme Variable} double
@defvrx {Scheme Variable} complex-double
@defvrx {Scheme Variable} complex-float
These values represent the C numeric types of the specified sizes and
signednesses.
signednesses. @code{complex-float} and @code{complex-double} stand for
C99 @code{float _Complex} and @code{double _Complex} respecively.
@end defvr
In addition there are some convenience bindings for indicating types of