diff --git a/src/CHANGELOG b/src/CHANGELOG index 715371c38..08695f227 100755 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -95,6 +95,9 @@ and important fixes to let ECL work better with Slime. - ECL now implements EXT:*INVOKE-DEBUGGER-HOOK*, which works like *DEBUGGER-HOOK* but is also observed by BREAK. (SBCL extension adopted by ECL) + + - The UFFI interface now supports C99 types, such as :int8-t, :uint32-t, etc, + but only when the corresponding types do exist in the underlying C environment. ;;; Local Variables: *** ;;; mode:text *** diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 7afea8939..568887fab 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -424,9 +424,11 @@ dnl have the right size; dnl AC_DEFUN(ECL_INTEGER_TYPES,[ ECL_STDINT_HEADER="" +ECL_UINT8_T="" ECL_UINT16_T="" ECL_UINT32_T="" ECL_UINT64_T="" +ECL_INT8_T="" ECL_INT16_T="" ECL_INT32_T="" ECL_INT64_T="" diff --git a/src/c/ffi.d b/src/c/ffi.d index 29143b0f8..0e47fdc84 100644 --- a/src/c/ffi.d +++ b/src/c/ffi.d @@ -31,6 +31,10 @@ static const cl_object ecl_foreign_type_table[] = { @':unsigned-int', @':long', @':unsigned-long', +#ifdef ecl_uint8_t + @':int8-t', + @':uint8-t', +#endif #ifdef ecl_uint16_t @':int16-t', @':uint16-t', @@ -73,6 +77,10 @@ static unsigned int ecl_foreign_type_size[] = { sizeof(unsigned int), sizeof(long), sizeof(unsigned long), +#ifdef ecl_uint8_t + sizeof(ecl_int8_t), + sizeof(ecl_uint8_t), +#endif #ifdef ecl_uint16_t sizeof(ecl_int16_t), sizeof(ecl_uint16_t), @@ -126,13 +134,17 @@ static ffi_type *ecl_type_to_libffi_type[] = { &ffi_type_uint, /*@':unsigned-int',*/ &ffi_type_slong, /*@':long',*/ &ffi_type_ulong, /*@':unsigned-long',*/ +#ifdef ecl_uint8_t + &ffi_type_sint8, /*@':int8-t',*/ + &ffi_type_uint8, /*@':uint8-t',*/ +#endif #ifdef ecl_uint16_t &ffi_type_sint16, /*@':int16-t',*/ &ffi_type_uint16, /*@':uint16-t',*/ #endif #ifdef ecl_uint32_t - &ffi_type_sint32, /*@':int64-t',*/ - &ffi_type_uint32, /*@':uint64-t',*/ + &ffi_type_sint32, /*@':int32-t',*/ + &ffi_type_uint32, /*@':uint32-t',*/ #endif #ifdef ecl_uint64_t &ffi_type_sint64, /*@':int64-t',*/ diff --git a/src/configure b/src/configure index deec25658..7f396262a 100755 --- a/src/configure +++ b/src/configure @@ -2360,7 +2360,7 @@ fi if test "${enable_precisegc+set}" = set; then enableval=$enable_precisegc; enable_precisegc=${enableval} else - enable_precisegc=no + enable_precisegc=yes fi @@ -8700,9 +8700,11 @@ fi $as_echo "${CL_FIXNUM_TYPE}" >&6; } ECL_STDINT_HEADER="" +ECL_UINT8_T="" ECL_UINT16_T="" ECL_UINT32_T="" ECL_UINT64_T="" +ECL_INT8_T="" ECL_INT16_T="" ECL_INT32_T="" ECL_INT64_T="" diff --git a/src/configure.in b/src/configure.in index 956dbbb0b..c298a17dd 100644 --- a/src/configure.in +++ b/src/configure.in @@ -244,7 +244,7 @@ AC_ARG_ENABLE(precisegc, AS_HELP_STRING( [--enable-precisegc], [use type information during garbage collection. Requires Boehm-Weiser gc.] [(no|yes, default=NO)]), - [enable_precisegc=${enableval}], [enable_precisegc=no] ) + [enable_precisegc=${enableval}], [enable_precisegc=yes] ) dnl AC_ARG_ENABLE(debug, dnl AS_HELP_STRING( [--enable-debug], diff --git a/src/lsp/ffi.lsp b/src/lsp/ffi.lsp index 5c5f1e58d..c1c1dae26 100644 --- a/src/lsp/ffi.lsp +++ b/src/lsp/ffi.lsp @@ -63,7 +63,11 @@ (member name '(:byte :unsigned-byte :short :unsigned-short :int :unsigned-int :char :unsigned-char :long :unsigned-long :pointer-void :object - :float :double :cstring) + :float :double :cstring + :int8-t #+uint16-t :int16-t + #+uint32-t :int32-t #+uint64-t :int64-t + :uint8-t #+uint16-t :uint16-t + #+uint32-t :uint32-t #+uint64-t :uint64-t) :test 'eq))) (defmacro def-foreign-type (name definition)