diff options
-rw-r--r-- | ffi.c | 2 | ||||
-rw-r--r-- | txr.1 | 9 |
2 files changed, 6 insertions, 5 deletions
@@ -2341,7 +2341,7 @@ val ffi_type_compile(val syntax) ffi_carray_put, ffi_carray_get, 0, 0, 0, eltype); } else if (sym == sbit_s || sym == ubit_s) { - val nbits = cadr(syntax); + val nbits = ffi_eval_expr(cadr(syntax), nil, nil); cnum nb = c_num(nbits); val type = make_ffi_type_builtin(syntax, integer_s, 0, 0, &ffi_type_void, @@ -53541,9 +53541,9 @@ be extended. Some constituents of compound type syntax are expressions which evaluate to integer values: the dimension value for array types, the size for buffers, -and the value expressions for enumeration constants are such expressions. -These expressions allow full use of \*(TL. They are evaluated without -visibility into any apparent surrounding lexical scope. +the width for bitfields and the value expressions for enumeration constants are +such expressions. These expressions allow full use of \*(TL. They are +evaluated without visibility into any apparent surrounding lexical scope. Some predefined types which are provided are in fact typedef names. For instance, the @@ -54453,7 +54453,8 @@ Bitfields of any other type are not supported. The .meta width -parameter of the type indicates the number of bits. It may range from +parameter of is an expression evaluated in the top-level environment, +indicates the number of bits. It may range from zero to the number of bits in the .code uint type. |