mirror of https://github.com/CGAL/cgal
Work around Boost changing the name of their macros every other release.
Work around Microsoft defining min/max as macros.
This commit is contained in:
parent
dcaff8048e
commit
b53de35ff6
|
|
@ -125,6 +125,12 @@
|
||||||
#define CGAL_CFG_NO_CPP0X_COPY_N 1
|
#define CGAL_CFG_NO_CPP0X_COPY_N 1
|
||||||
#define CGAL_CFG_NO_CPP0X_NEXT_PREV 1
|
#define CGAL_CFG_NO_CPP0X_NEXT_PREV 1
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATIONS) \
|
||||||
|
|| defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS) \
|
||||||
|
|| defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) \
|
||||||
|
|| (BOOST_VERSION < 103600)
|
||||||
|
#define CGAL_CFG_NO_CPP0X_EXPLICIT_CONVERSION_OPERATORS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------//
|
//----------------------------------------------------------------------//
|
||||||
|
|
|
||||||
|
|
@ -477,7 +477,7 @@ struct mpzf {
|
||||||
int ah=asize+a.exp;
|
int ah=asize+a.exp;
|
||||||
int bh=bsize+b.exp;
|
int bh=bsize+b.exp;
|
||||||
if(ah!=bh) return ah-bh;
|
if(ah!=bh) return ah-bh;
|
||||||
int minsize=std::min(asize,bsize);
|
int minsize=(std::min)(asize,bsize);
|
||||||
const mp_limb_t* adata=a.data()+(asize-1);
|
const mp_limb_t* adata=a.data()+(asize-1);
|
||||||
const mp_limb_t* bdata=b.data()+(bsize-1);
|
const mp_limb_t* bdata=b.data()+(bsize-1);
|
||||||
for(int i=0;i<minsize;++i,--adata,--bdata){
|
for(int i=0;i<minsize;++i,--adata,--bdata){
|
||||||
|
|
@ -543,7 +543,7 @@ struct mpzf {
|
||||||
int bexp=b.exp;
|
int bexp=b.exp;
|
||||||
if(aexp<bexp){ res.exp=a.exp; aexp=0; bexp=b.exp-a.exp; }
|
if(aexp<bexp){ res.exp=a.exp; aexp=0; bexp=b.exp-a.exp; }
|
||||||
else { res.exp=b.exp; aexp=a.exp-b.exp; bexp=0; }
|
else { res.exp=b.exp; aexp=a.exp-b.exp; bexp=0; }
|
||||||
res.init(std::max(absasize+aexp,absbsize+bexp)+1);
|
res.init((std::max)(absasize+aexp,absbsize+bexp)+1);
|
||||||
mp_limb_t* rdata=res.data();
|
mp_limb_t* rdata=res.data();
|
||||||
res.size=0;
|
res.size=0;
|
||||||
// TODO: if aexp>0, swap a and b so we don't repeat the code.
|
// TODO: if aexp>0, swap a and b so we don't repeat the code.
|
||||||
|
|
@ -616,7 +616,7 @@ struct mpzf {
|
||||||
int yexp=y->exp;
|
int yexp=y->exp;
|
||||||
if(xexp<yexp){ res.exp=xexp; yexp-=xexp; xexp=0; }
|
if(xexp<yexp){ res.exp=xexp; yexp-=xexp; xexp=0; }
|
||||||
else { res.exp=yexp; xexp-=yexp; yexp=0; }
|
else { res.exp=yexp; xexp-=yexp; yexp=0; }
|
||||||
res.init(std::max(absxsize+xexp,absysize+yexp)+1);
|
res.init((std::max)(absxsize+xexp,absysize+yexp)+1);
|
||||||
mp_limb_t* rdata=res.data();
|
mp_limb_t* rdata=res.data();
|
||||||
res.size=0;
|
res.size=0;
|
||||||
bool carry1=false;
|
bool carry1=false;
|
||||||
|
|
@ -646,7 +646,7 @@ struct mpzf {
|
||||||
carry1=true; // assumes no trailing zeros
|
carry1=true; // assumes no trailing zeros
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int carry=mpn_sub(rdata, xdata, absxsize, ydata, absysize);
|
mp_limb_t carry=mpn_sub(rdata, xdata, absxsize, ydata, absysize);
|
||||||
if(carry1) carry+=mpn_sub_1(rdata, rdata, absxsize, 1);
|
if(carry1) carry+=mpn_sub_1(rdata, rdata, absxsize, 1);
|
||||||
assert(carry==0);
|
assert(carry==0);
|
||||||
res.size+=absxsize;
|
res.size+=absxsize;
|
||||||
|
|
@ -756,7 +756,7 @@ struct mpzf {
|
||||||
int bsize=std::abs(b.size);
|
int bsize=std::abs(b.size);
|
||||||
int atz=mpzf_impl::ctz(a.data()[0]);
|
int atz=mpzf_impl::ctz(a.data()[0]);
|
||||||
int btz=mpzf_impl::ctz(b.data()[0]);
|
int btz=mpzf_impl::ctz(b.data()[0]);
|
||||||
int rtz=std::min(atz,btz);
|
int rtz=(std::min)(atz,btz);
|
||||||
mpzf tmp(allocate(), asize);
|
mpzf tmp(allocate(), asize);
|
||||||
mpzf res(allocate(), bsize);
|
mpzf res(allocate(), bsize);
|
||||||
if (atz != 0) {
|
if (atz != 0) {
|
||||||
|
|
@ -902,7 +902,7 @@ struct mpzf {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CGAL_USE_GMPXX
|
#ifdef CGAL_USE_GMPXX
|
||||||
#ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
|
#ifndef CGAL_CFG_NO_CPP0X_EXPLICIT_CONVERSION_OPERATORS
|
||||||
explicit
|
explicit
|
||||||
#endif
|
#endif
|
||||||
operator mpq_class () const {
|
operator mpq_class () const {
|
||||||
|
|
@ -912,7 +912,7 @@ struct mpzf {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
|
#ifndef CGAL_CFG_NO_CPP0X_EXPLICIT_CONVERSION_OPERATORS
|
||||||
explicit
|
explicit
|
||||||
#endif
|
#endif
|
||||||
operator Gmpq () const {
|
operator Gmpq () const {
|
||||||
|
|
@ -941,7 +941,7 @@ struct mpzf {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
#ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
|
#ifndef CGAL_CFG_NO_CPP0X_EXPLICIT_CONVERSION_OPERATORS
|
||||||
explicit
|
explicit
|
||||||
#endif
|
#endif
|
||||||
// This makes mpzf==int ambiguous
|
// This makes mpzf==int ambiguous
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue