{
MODULE_FUNCTION_BEGIN (0);
Lisp_Object l = value_to_lisp (n);
- CHECK_FIXNUM (l);
+ CHECK_INTEGER (l);
+ if (BIGNUMP (l))
+ {
+ if (!mpz_fits_slong_p (XBIGNUM (l)->value))
+ xsignal1 (Qoverflow_error, l);
+ return mpz_get_si (XBIGNUM (l)->value);
+ }
return XINT (l);
}
static emacs_value
module_make_integer (emacs_env *env, intmax_t n)
{
+ Lisp_Object obj;
MODULE_FUNCTION_BEGIN (module_nil);
if (FIXNUM_OVERFLOW_P (n))
- xsignal0 (Qoverflow_error);
- return lisp_to_value (env, make_fixnum (n));
+ {
+ mpz_t val;
+ mpz_init_set_si (val, n);
+ obj = make_number (val);
+ mpz_clear (val);
+ }
+ else
+ obj = make_fixnum (n);
+ return lisp_to_value (env, obj);
}
static double