Skip to content

Commit

Permalink
Fix bugs on macOS.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkskeller committed May 23, 2022
1 parent f349f76 commit de12e08
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions Math/Z2k.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class Z2 : public ValueInterface
Z2(__m128i x) : Z2() { avx_memcpy(a, &x, min(N_BYTES, 16)); }
Z2(int x) : Z2(long(x)) { a[N_WORDS - 1] &= UPPER_MASK; }
Z2(long x) : Z2(mp_limb_t(x)) { if (K > 64 and x < 0) memset(&a[1], -1, N_BYTES - 8); }
Z2(long long x) : Z2(long(x)) {}
template<class T>
Z2(const IntBase<T>& x);
/**
Expand Down
1 change: 1 addition & 0 deletions Math/gf2n.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class gf2n_ : public ValueInterface
gf2n_(U a) : a(a & mask) {}
gf2n_(long a) : gf2n_(U(a)) {}
gf2n_(int a) : gf2n_(U(unsigned(a))) {}
gf2n_(long long a) : gf2n_(U(a)) {}
template<class T>
gf2n_(IntBase<T> a) : a(a.get()) {}

Expand Down
1 change: 1 addition & 0 deletions Math/gfp.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ class gfp_ : public ValueInterface
gfp_(const mpz_class& x) { to_modp(a, x, ZpD); }
gfp_(int x) : gfp_(long(x)) {}
gfp_(long x);
gfp_(long long x) : gfp_(long(x)) {}
gfp_(word x) : gfp_(bigint::tmp = x) {}
template<class T>
gfp_(IntBase<T> x) : gfp_(x.get()) {}
Expand Down
1 change: 1 addition & 0 deletions Tools/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using namespace std;
#ifdef __APPLE__
# include <libkern/OSByteOrder.h>
#define be32toh(x) OSSwapBigToHostInt32(x)
#define be64toh(x) OSSwapBigToHostInt64(x)
#endif

// Read a 4-byte integer
Expand Down

0 comments on commit de12e08

Please sign in to comment.