mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 06:41:13 +02:00
* __scm.h (SCM_C_INLINE_KEYWORD): New.
* numbers.c: Use it in place of SCM_C_INLINE so that the code compiles when SCM_C_INLINE is undefined.
This commit is contained in:
parent
59c4bb82e3
commit
570b6821e3
2 changed files with 17 additions and 6 deletions
|
@ -609,6 +609,17 @@ SCM_API SCM scm_apply_generic (SCM gf, SCM args);
|
||||||
#endif /* def vms */
|
#endif /* def vms */
|
||||||
#endif /* ndef SCM_EXIT_FAILURE */
|
#endif /* ndef SCM_EXIT_FAILURE */
|
||||||
|
|
||||||
|
/* Define SCM_C_INLINE_KEYWORD so that it can be used as a replacement
|
||||||
|
for the "inline" keyword, expanding to nothing when "inline" is not
|
||||||
|
available.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef SCM_C_INLINE
|
||||||
|
#define SCM_C_INLINE_KEYWORD SCM_C_INLINE
|
||||||
|
#else
|
||||||
|
#define SCM_C_INLINE_KEYWORD
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* SCM___SCM_H */
|
#endif /* SCM___SCM_H */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -128,7 +128,7 @@ static mpz_t z_negative_one;
|
||||||
|
|
||||||
static const char s_bignum[] = "bignum";
|
static const char s_bignum[] = "bignum";
|
||||||
|
|
||||||
SCM_C_INLINE SCM
|
SCM_C_INLINE_KEYWORD SCM
|
||||||
scm_i_mkbig ()
|
scm_i_mkbig ()
|
||||||
{
|
{
|
||||||
/* Return a newly created bignum. */
|
/* Return a newly created bignum. */
|
||||||
|
@ -137,7 +137,7 @@ scm_i_mkbig ()
|
||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM_C_INLINE static SCM
|
SCM_C_INLINE_KEYWORD static SCM
|
||||||
scm_i_clonebig (SCM src_big, int same_sign_p)
|
scm_i_clonebig (SCM src_big, int same_sign_p)
|
||||||
{
|
{
|
||||||
/* Copy src_big's value, negate it if same_sign_p is false, and return. */
|
/* Copy src_big's value, negate it if same_sign_p is false, and return. */
|
||||||
|
@ -148,7 +148,7 @@ scm_i_clonebig (SCM src_big, int same_sign_p)
|
||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM_C_INLINE int
|
SCM_C_INLINE_KEYWORD int
|
||||||
scm_i_bigcmp (SCM x, SCM y)
|
scm_i_bigcmp (SCM x, SCM y)
|
||||||
{
|
{
|
||||||
/* Return neg if x < y, pos if x > y, and 0 if x == y */
|
/* Return neg if x < y, pos if x > y, and 0 if x == y */
|
||||||
|
@ -158,7 +158,7 @@ scm_i_bigcmp (SCM x, SCM y)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM_C_INLINE SCM
|
SCM_C_INLINE_KEYWORD SCM
|
||||||
scm_i_dbl2big (double d)
|
scm_i_dbl2big (double d)
|
||||||
{
|
{
|
||||||
/* results are only defined if d is an integer */
|
/* results are only defined if d is an integer */
|
||||||
|
@ -167,7 +167,7 @@ scm_i_dbl2big (double d)
|
||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM_C_INLINE double
|
SCM_C_INLINE_KEYWORD double
|
||||||
scm_i_big2dbl (SCM b)
|
scm_i_big2dbl (SCM b)
|
||||||
{
|
{
|
||||||
double result = mpz_get_d (SCM_I_BIG_MPZ (b));
|
double result = mpz_get_d (SCM_I_BIG_MPZ (b));
|
||||||
|
@ -175,7 +175,7 @@ scm_i_big2dbl (SCM b)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM_C_INLINE SCM
|
SCM_C_INLINE_KEYWORD SCM
|
||||||
scm_i_normbig (SCM b)
|
scm_i_normbig (SCM b)
|
||||||
{
|
{
|
||||||
/* convert a big back to a fixnum if it'll fit */
|
/* convert a big back to a fixnum if it'll fit */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue