If ECL is too small, long long can be used for cl_fixnum

parent 5d76e2e3
......@@ -586,6 +586,22 @@ int main() {
l++;
fprintf(f,"CL_FIXNUM_MIN='%ld';",l);
fprintf(f,"CL_FIXNUM_MAX='%ld';",-l);
#endif
#ifdef ECL_LONG_LONG_BITS
} else if (sizeof(long long) >= sizeof(void*)) {
unsigned long long int t = 1;
signed long long int l = 0;
int_type="long long";
for (bits=1; ((t << 1) >> 1) == t; bits++, t <<= 1);
l = (~l) << (bits - 3);
# if 1
fprintf(f,"CL_FIXNUM_MIN='%ld';",l);
fprintf(f,"CL_FIXNUM_MAX='%ld';",-(l+1));
# else
l++;
fprintf(f,"CL_FIXNUM_MIN='%ld';",l);
fprintf(f,"CL_FIXNUM_MAX='%ld';",-l);
# endif
#endif
} else {
exit(1);
......
......@@ -8674,6 +8674,22 @@ int main() {
l++;
fprintf(f,"CL_FIXNUM_MIN='%ld';",l);
fprintf(f,"CL_FIXNUM_MAX='%ld';",-l);
#endif
#ifdef ECL_LONG_LONG_BITS
} else if (sizeof(long long) >= sizeof(void*)) {
unsigned long long int t = 1;
signed long long int l = 0;
int_type="long long";
for (bits=1; ((t << 1) >> 1) == t; bits++, t <<= 1);
l = (~l) << (bits - 3);
# if 1
fprintf(f,"CL_FIXNUM_MIN='%ld';",l);
fprintf(f,"CL_FIXNUM_MAX='%ld';",-(l+1));
# else
l++;
fprintf(f,"CL_FIXNUM_MIN='%ld';",l);
fprintf(f,"CL_FIXNUM_MAX='%ld';",-l);
# endif
#endif
} else {
exit(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment