MS link.exe can pick the right crt libraries according to the compiler flags,
such as /MD, /MDd etc.
So we remove them to keep the command line tidy and clean.
It can happen for example in
(subtypep t '(CONS (AND STANDARD-CHAR (MEMBER #\@)) REAL))
that in subtypep and type= the second call to safe-canonical-type
fails and returns the error from +canonical-type-failure+ instead of a
valid tag. This leads to type-errors in logandc2 or = which expect an
integer.
Fixes#519.
The pipe from which we read the output of the C compiler could fill up
when a large number of warnings were printed leading to a deadlock
because we waited for the C compiler to finish before reading the
output.
This reverts commit 2a9084b105.
It turned out that #347 was caused by the Maxima computer algebra
system enabling floating point exceptions via si:trap-fpe (see
https://trac.sagemath.org/ticket/22191). Hence we can revert to the
less intrusive behaviour of not changing the floating point
environment if ECL_OPT_TRAP_SIGFPE is false.
External format decoders now operatore on characters buffers instead
of reading input byte by byte from the streams. This allows us to
provide efficient read_vector implementations.
Previously, we were simply returning the number of hours West of
Greenwich, which had the effect that si::get-local-time-zone could
return different values for a user in the same location depending on
the time of the year. However, the functions calling
si::get-local-time-zone later do the necessary fixup for Daylight
Saving Time on their own, which lead to wrong values returned in
decode-universal-time and encode-universal-time.
Fixes#495.
Previously we mishandled weak values when there was no such key. Also
gethash returned a weak pointer instead of the value (same goes for
maphash). These things are fixed now.
At least one library (adt) redefines structures with slot names being
uninterned symbols. That means that we lose slot offset if we
reference it by name what leads to load errors if
make-load-form-saving-slots was called. We fix that by handling
structure-object's separately.
allocate-instance is another oddball in the spec when taken with
structure-classes (and it is used in make-load-form-saving-slots). If
there are *some* slots saved then rest must be initialized so object
could be used - we put there NIL without checking for a type. SBCL
tries to find a constructor for a structure (custom protocol) or
errors while CCL initializes slots to NIL. We follow the latter.
As explained in the comment: structure may be a result of code
generation which will likely use gensym. In this case name eql casues
compilation/load problems. I.e adt library dos that.
Many parts of the source code were bent backward to support builds
without long floats which are always present given we depend expect
c99 compiler.
The corresponding C macros (ECL_LONG_FLOAT) and the *feature*
entry (:long-float) are marked as deprecated in the documentation.
- extract functions for handling different kind of results
- add specialised code for floats and complex floats in integer case
- improve comments a little
- fix the regression where (expt -1.0 2) results in complex result
For functions without returned value we did return cl_object value0
which was not initialized. That could lead to segmentation faults if
we have used result of calling a function defined as such location.
SFFI definition like this:
(ffi:def-function ("my_test_function3" sffi-test-3)
((x :float) (y :double))
:returning :void)
was previously compiled to
/* function definition for SFFI-TEST-3 */
/* optimize speed 3, debug 0, space 0, safety 2 */
static cl_object L6sffi_test_3(cl_object v1x, cl_object v2y)
{
cl_object env0 = ECL_NIL;
const cl_env_ptr cl_env_copy = ecl_process_env();
cl_object value0;
ecl_cs_check(cl_env_copy,value0);
{
TTL:
my_test_function3(ecl_to_float(v1x),ecl_to_double(v2y));
cl_env_copy->nvalues = 0;
return value0;
}
}
and now it is compiled to
/* function definition for SFFI-TEST-3 */
/* optimize speed 3, debug 0, space 0, safety 2 */
static cl_object L6sffi_test_3(cl_object v1x, cl_object v2y)
{
cl_object env0 = ECL_NIL;
const cl_env_ptr cl_env_copy = ecl_process_env();
cl_object value0;
ecl_cs_check(cl_env_copy,value0);
{
TTL:
my_test_function3(ecl_to_float(v1x),ecl_to_double(v2y));
value0 = ECL_NIL;
cl_env_copy->nvalues = 0;
return value0;
}
}
void functions are treated the same as when *destionation* is 'RETURN
in cmpmulti.lsp.
libffi is incapable of properly handling complex float argument types
yet. Commit disables complex types and adds a comment explaining
what's going on.
SFFI types which doesn't have counterpart in DFFI conversion table are
NULL and function ecl_type_to_libffi_type will signal a condition when
they are used.