[buddy] improve C++ backward compatibility around bdd_allsat change
* src/bddx.h (bdd_allsat): Add a version with the old prototype.
This commit is contained in:
parent
34cf0491eb
commit
7e44016d38
1 changed files with 9 additions and 0 deletions
|
|
@ -269,6 +269,10 @@ typedef void (*bdd2inthandler)(int,int);
|
||||||
typedef int (*bddsizehandler)(void);
|
typedef int (*bddsizehandler)(void);
|
||||||
typedef void (*bddfilehandler)(FILE *, int);
|
typedef void (*bddfilehandler)(FILE *, int);
|
||||||
typedef void (*bddallsathandler)(signed char*, 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 bddinthandler bdd_error_hook(bddinthandler);
|
||||||
BUDDY_API bddgbchandler bdd_gbc_hook(bddgbchandler);
|
BUDDY_API bddgbchandler bdd_gbc_hook(bddgbchandler);
|
||||||
|
|
@ -613,6 +617,7 @@ protected:
|
||||||
friend bdd bdd_fullsatone(const bdd &);
|
friend bdd bdd_fullsatone(const bdd &);
|
||||||
friend bdd bdd_satprefix(bdd &);
|
friend bdd bdd_satprefix(bdd &);
|
||||||
friend void bdd_allsat(const bdd &r, bddallsathandler handler);
|
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_satcount(const bdd &);
|
||||||
friend double bdd_satcountset(const bdd &, const bdd &);
|
friend double bdd_satcountset(const bdd &, const bdd &);
|
||||||
friend double bdd_satcountln(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)
|
inline void bdd_allsat(const bdd &r, bddallsathandler handler)
|
||||||
{ bdd_allsat(r.root, 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)
|
inline double bdd_satcount(const bdd &r)
|
||||||
{ return bdd_satcount(r.root); }
|
{ return bdd_satcount(r.root); }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue