Commit 50bed57c by Alan Mishchenko

Changes and fixed suggested by Clifford Wolf.

parent 4c0b78cf
...@@ -122,6 +122,10 @@ ifneq ($(findstring Darwin, $(shell uname)), Darwin) ...@@ -122,6 +122,10 @@ ifneq ($(findstring Darwin, $(shell uname)), Darwin)
LIBS += -lrt LIBS += -lrt
endif endif
ifdef ABC_USE_LIBSTDCXX
LIBS += -lstdc++
$(info $(MSG_PREFIX)Using explicit -lstdc++)
endif
$(info $(MSG_PREFIX)Using CFLAGS=$(CFLAGS)) $(info $(MSG_PREFIX)Using CFLAGS=$(CFLAGS))
CXXFLAGS += $(CFLAGS) CXXFLAGS += $(CFLAGS)
......
...@@ -47,7 +47,7 @@ struct Lit { ...@@ -47,7 +47,7 @@ struct Lit {
int x; int x;
// Use this as a constructor: // Use this as a constructor:
friend Lit mkLit(Var var, bool sign = false); friend Lit mkLit(Var var, bool sign);
bool operator == (Lit p) const { return x == p.x; } bool operator == (Lit p) const { return x == p.x; }
bool operator != (Lit p) const { return x != p.x; } bool operator != (Lit p) const { return x != p.x; }
...@@ -55,7 +55,7 @@ struct Lit { ...@@ -55,7 +55,7 @@ struct Lit {
}; };
inline Lit mkLit (Var var, bool sign) { Lit p; p.x = var + var + (int)sign; return p; } inline Lit mkLit (Var var, bool sign = false) { Lit p; p.x = var + var + (int)sign; return p; }
inline Lit operator ~(Lit p) { Lit q; q.x = p.x ^ 1; return q; } inline Lit operator ~(Lit p) { Lit q; q.x = p.x ^ 1; return q; }
inline Lit operator ^(Lit p, bool b) { Lit q; q.x = p.x ^ (unsigned int)b; return q; } inline Lit operator ^(Lit p, bool b) { Lit q; q.x = p.x ^ (unsigned int)b; return q; }
inline bool sign (Lit p) { return p.x & 1; } inline bool sign (Lit p) { return p.x & 1; }
......
...@@ -55,14 +55,14 @@ struct Lit { ...@@ -55,14 +55,14 @@ struct Lit {
int x; int x;
// Use this as a constructor: // Use this as a constructor:
friend Lit mkLit(Var var, bool sign = false); friend Lit mkLit(Var var, bool sign);
bool operator == (Lit p) const { return x == p.x; } bool operator == (Lit p) const { return x == p.x; }
bool operator != (Lit p) const { return x != p.x; } bool operator != (Lit p) const { return x != p.x; }
bool operator < (Lit p) const { return x < p.x; } // '<' makes p, ~p adjacent in the ordering. bool operator < (Lit p) const { return x < p.x; } // '<' makes p, ~p adjacent in the ordering.
}; };
inline Lit mkLit (Var var, bool sign) { Lit p; p.x = var + var + (int)sign; return p; } inline Lit mkLit (Var var, bool sign = false) { Lit p; p.x = var + var + (int)sign; return p; }
inline Lit operator ~(Lit p) { Lit q; q.x = p.x ^ 1; return q; } inline Lit operator ~(Lit p) { Lit q; q.x = p.x ^ 1; return q; }
inline Lit operator ^(Lit p, bool b) { Lit q; q.x = p.x ^ (unsigned int)b; return q; } inline Lit operator ^(Lit p, bool b) { Lit q; q.x = p.x ^ (unsigned int)b; return q; }
inline bool sign (Lit p) { return p.x & 1; } inline bool sign (Lit p) { return p.x & 1; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment