Name

Number C types — Numeric C types understood by ECL

Type names

cl_fixnumfixnum
cl_index(integer 0 most-positive-fixnum)
floatshort-float, single-float
doubledouble-float
long double (*)long-floatECL_LONG_FLOAT:long-float
uint8_t(unsigned-byte 8)
int8_t(signed-byte 8)
uint16_t(unsigned-byte 16)ecl_uint16_t:uint16-t
int16_t(signed-byte 16)ecl_int16_t:uint16-t
uint32_t(unsigned-byte 32)ecl_uint32_t:uint32-t
int32_t(signed-byte 32)ecl_int32_t:uint32-t
uint64_t(unsigned-byte 64)ecl_uint32_t:uint32-t
int64_t(signed-byte 64)ecl_int64_t:uint32-t
short(integer ffi:c-short-min ffi:c-short-max)ecl_uint64_t:uint32-t
unsigned short (integer 0 ffi:c-ushort-max)
int(integer ffi:c-int-min ffi:c-int-max)
unsigned int (integer 0 ffi:c-uint-max)
long(integer ffi:c-long-min ffi:c-long-max)
unsigned long (integer 0 ffi:c-long-max)
long long(integer ffi:c-long-long-min ffi:c-long-long-max)ecl_long_long_t:long-long
unsigned long long(integer 0 ffi:c-ulong-long-max)ecl_ulong_long_t:long-long

Description

The table above shows the relation between C types and the equivalent Common Lisp types. All types are standard C99 types, except for two. First, cl_fixnum is the smallest signed integer that can fit a fixnum. Second, cl_index is the smallest unsigned integer that fits a fixnum and is typically the unsigned counterpart of cl_fixnum.

(*) The long double does not exist on all platforms. When it exists, the macro ECL_LONG_DOUBLE will be defined, and long-double will be equivalent to it.

Many other types might also not exist on all platforms. This includes not only long long and unsigned long long, but also some of the C99 integer types. There are two ways to detect which integer types are available in your system

  • Check for the definition of C macros with a similar name, shown in the fourth column above.

  • In Lisp code, check for the presence of the associated features, shown in the fifth column above.