diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-06-04 13:15:01 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-06-04 13:15:01 -0700 |
commit | 730d6f7ea7f09c977084395bf88a14d9a815fad2 (patch) | |
tree | 3505d7c4d3d4b0aca2ea62992961bece89f25d59 /ffi.h | |
parent | e87581b27ea4635ffda306e9711bd1a63323c5f6 (diff) | |
download | txr-730d6f7ea7f09c977084395bf88a14d9a815fad2.tar.gz txr-730d6f7ea7f09c977084395bf88a14d9a815fad2.tar.bz2 txr-730d6f7ea7f09c977084395bf88a14d9a815fad2.zip |
ffi: new type operator align for customizing alignment.
* ffi.c (align_s): New symbol variable.
(struct txr_ffi_type): New function pointer member, clone.
(ffi_simple_clone): New static function.
(make_ffi_type_builtin, make_ffi_type_pointer,
make_ffi_type_enum): Wire in ffi_simple_clone as the clone
function.
(ffi_struct_clone): New static function.
(make_ffi_type_struct): Wire in ffi_struct_clone as the clone
function for struct types.
(ffi_array_clone): New static function.
(make_ffi_type_array): Wire in ffi_array_clone as the clone
function for array types.
(ffi_type_copy): New static function.
(ffi_type_compile): Recognize new (align <num> <type>) syntax.
This works by cloning <type>, and then punching in the
specified alignment. The align syntax then denotes this
modified type.
(ffi_init): Initialize align_s.
* ffi.h (align_s): Declared.
Diffstat (limited to 'ffi.h')
-rw-r--r-- | ffi.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -55,6 +55,8 @@ extern val sbit_s, ubit_s; extern val enum_s; +extern val align_s; + extern val ffi_type_s, ffi_call_desc_s, ffi_closure_s; val ffi_type_compile(val syntax); |