mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 14:00:21 +02:00
(scm_bit_extract): Use min instead of MIN.
(MIN): Remove, this conflicts with similar macro defined by limits.h on HP-UX. Reported by Andreas Vögele.
This commit is contained in:
parent
924532c8fd
commit
857ae6afd3
1 changed files with 2 additions and 4 deletions
|
@ -1794,8 +1794,6 @@ SCM_DEFINE (scm_ash, "ash", 2, 0, 0,
|
|||
#undef FUNC_NAME
|
||||
|
||||
|
||||
#define MIN(x,y) ((x) < (y) ? (x) : (y))
|
||||
|
||||
SCM_DEFINE (scm_bit_extract, "bit-extract", 3, 0, 0,
|
||||
(SCM n, SCM start, SCM end),
|
||||
"Return the integer composed of the @var{start} (inclusive)\n"
|
||||
|
@ -1824,7 +1822,7 @@ SCM_DEFINE (scm_bit_extract, "bit-extract", 3, 0, 0,
|
|||
|
||||
/* When istart>=SCM_I_FIXNUM_BIT we can just limit the shift to
|
||||
SCM_I_FIXNUM_BIT-1 to get either 0 or -1 per the sign of "in". */
|
||||
in = SCM_SRS (in, MIN (istart, SCM_I_FIXNUM_BIT-1));
|
||||
in = SCM_SRS (in, min (istart, SCM_I_FIXNUM_BIT-1));
|
||||
|
||||
if (in < 0 && bits >= SCM_I_FIXNUM_BIT)
|
||||
{
|
||||
|
@ -1839,7 +1837,7 @@ SCM_DEFINE (scm_bit_extract, "bit-extract", 3, 0, 0,
|
|||
}
|
||||
|
||||
/* mask down to requisite bits */
|
||||
bits = MIN (bits, SCM_I_FIXNUM_BIT);
|
||||
bits = min (bits, SCM_I_FIXNUM_BIT);
|
||||
return SCM_MAKINUM (in & ((1L << bits) - 1));
|
||||
}
|
||||
else if (SCM_BIGP (n))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue