Commit 7e44016d authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

[buddy] improve C++ backward compatibility around bdd_allsat change

* src/bddx.h (bdd_allsat): Add a version with the old prototype.
parent 34cf0491
......@@ -269,6 +269,10 @@ typedef void (*bdd2inthandler)(int,int);
typedef int (*bddsizehandler)(void);
typedef void (*bddfilehandler)(FILE *, int);
typedef void (*bddallsathandler)(signed char*, int);
// The historical type of bddallsathandler is the following,
// unfortunately the signedness of char* is implementation defined.
// Now we have to support both for backward compatibility.
typedef void (*bddallsathandler_old)(char*, int);
BUDDY_API bddinthandler bdd_error_hook(bddinthandler);
BUDDY_API bddgbchandler bdd_gbc_hook(bddgbchandler);
......@@ -613,6 +617,7 @@ protected:
friend bdd bdd_fullsatone(const bdd &);
friend bdd bdd_satprefix(bdd &);
friend void bdd_allsat(const bdd &r, bddallsathandler handler);
friend void bdd_allsat(const bdd &r, bddallsathandler_old handler);
friend double bdd_satcount(const bdd &);
friend double bdd_satcountset(const bdd &, const bdd &);
friend double bdd_satcountln(const bdd &);
......@@ -829,6 +834,10 @@ inline bdd bdd_satprefix(bdd &r)
inline void bdd_allsat(const bdd &r, bddallsathandler handler)
{ bdd_allsat(r.root, handler); }
// backward compatibility for C++ users
inline void bdd_allsat(const bdd &r, bddallsathandler_old handler)
{ bdd_allsat(r.root, (bddallsathandler)handler); }
inline double bdd_satcount(const bdd &r)
{ return bdd_satcount(r.root); }
......
Supports Markdown
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