diff --git a/src/ltlvisit/simplify.hh b/src/ltlvisit/simplify.hh index 22ba9c393..e63389dfa 100644 --- a/src/ltlvisit/simplify.hh +++ b/src/ltlvisit/simplify.hh @@ -175,8 +175,8 @@ namespace spot private: ltl_simplifier_cache* cache_; // Copy disallowed. - ltl_simplifier(const ltl_simplifier&) = delete; - void operator=(const ltl_simplifier&) = delete; + ltl_simplifier(const ltl_simplifier&) SPOT_DELETED; + void operator=(const ltl_simplifier&) SPOT_DELETED; bool owndict; }; diff --git a/src/misc/common.hh b/src/misc/common.hh index 989e9962c..5a8f22c52 100644 --- a/src/misc/common.hh +++ b/src/misc/common.hh @@ -64,4 +64,13 @@ #endif #define SPOT_API_VAR extern SPOT_API + +// Swig 2.0 does not understand '= delete'. This already +// works with the development version of Swig 3. +#ifdef SWIG + #define SPOT_DELETED +#else + #define SPOT_DELETED = delete +#endif + #endif // SPOT_MISC_COMMON_HH diff --git a/src/ta/taexplicit.hh b/src/ta/taexplicit.hh index 46e7a6712..1be001caf 100644 --- a/src/ta/taexplicit.hh +++ b/src/ta/taexplicit.hh @@ -132,8 +132,8 @@ namespace spot private: // Disallow copy. - ta_explicit(const ta_explicit& other) = delete; - ta_explicit& operator=(const ta_explicit& other) = delete; + ta_explicit(const ta_explicit& other) SPOT_DELETED; + ta_explicit& operator=(const ta_explicit& other) SPOT_DELETED; const tgba* tgba_; bdd all_acceptance_conditions_; diff --git a/src/ta/taproduct.hh b/src/ta/taproduct.hh index 64c01f26a..aabf9a90e 100644 --- a/src/ta/taproduct.hh +++ b/src/ta/taproduct.hh @@ -202,8 +202,8 @@ namespace spot const kripke* kripke_; // Disallow copy. - ta_product(const ta_product&) = delete; - ta_product& operator=(const ta_product&) = delete; + ta_product(const ta_product&) SPOT_DELETED; + ta_product& operator=(const ta_product&) SPOT_DELETED; }; diff --git a/src/tgba/bdddict.hh b/src/tgba/bdddict.hh index 1e6cfbb5a..1745261b2 100644 --- a/src/tgba/bdddict.hh +++ b/src/tgba/bdddict.hh @@ -239,8 +239,8 @@ namespace spot private: // Disallow copy. - bdd_dict(const bdd_dict& other) = delete; - bdd_dict& operator=(const bdd_dict& other) = delete; + bdd_dict(const bdd_dict& other) SPOT_DELETED; + bdd_dict& operator=(const bdd_dict& other) SPOT_DELETED; }; diff --git a/src/tgba/taatgba.hh b/src/tgba/taatgba.hh index 0fad01e9a..cea12ab05 100644 --- a/src/tgba/taatgba.hh +++ b/src/tgba/taatgba.hh @@ -78,8 +78,8 @@ namespace spot private: // Disallow copy. - taa_tgba(const taa_tgba& other) = delete; - taa_tgba& operator=(const taa_tgba& other) = delete; + taa_tgba(const taa_tgba& other) SPOT_DELETED; + taa_tgba& operator=(const taa_tgba& other) SPOT_DELETED; }; /// Set of states deriving from spot::state. @@ -255,7 +255,7 @@ namespace spot typedef std::unordered_map ns_map; typedef std::unordered_map> sn_map; + ptr_hash > sn_map; ns_map name_state_map_; sn_map state_name_map_; diff --git a/src/tgba/tgbabddconcrete.hh b/src/tgba/tgbabddconcrete.hh index f295045de..4f9334e85 100644 --- a/src/tgba/tgbabddconcrete.hh +++ b/src/tgba/tgbabddconcrete.hh @@ -91,8 +91,8 @@ namespace spot bdd init_; ///< Initial state. private: // Disallow copy. - tgba_bdd_concrete(const tgba_bdd_concrete&) = delete; - tgba_bdd_concrete& operator=(const tgba_bdd_concrete&) = delete; + tgba_bdd_concrete(const tgba_bdd_concrete&) SPOT_DELETED; + tgba_bdd_concrete& operator=(const tgba_bdd_concrete&) SPOT_DELETED; }; } diff --git a/src/tgba/tgbaexplicit.hh b/src/tgba/tgbaexplicit.hh index 5ea3dada4..d15e59b06 100644 --- a/src/tgba/tgbaexplicit.hh +++ b/src/tgba/tgbaexplicit.hh @@ -709,8 +709,8 @@ namespace spot private: // Disallow copy. - tgba_explicit(const tgba_explicit& other) = delete; - tgba_explicit& operator=(const tgba_explicit& other) = delete; + tgba_explicit(const tgba_explicit& other) SPOT_DELETED; + tgba_explicit& operator=(const tgba_explicit& other) SPOT_DELETED; }; template @@ -739,8 +739,8 @@ namespace spot private: // Disallow copy. - sba_explicit(const sba_explicit& other) = delete; - sba_explicit& operator=(const sba_explicit& other) = delete; + sba_explicit(const sba_explicit& other) SPOT_DELETED; + sba_explicit& operator=(const sba_explicit& other) SPOT_DELETED; }; diff --git a/src/tgba/tgbaproduct.hh b/src/tgba/tgbaproduct.hh index b0254e15e..d14749ce8 100644 --- a/src/tgba/tgbaproduct.hh +++ b/src/tgba/tgbaproduct.hh @@ -126,8 +126,8 @@ namespace spot private: // Disallow copy. - tgba_product(const tgba_product&) = delete; - tgba_product& operator=(const tgba_product&) = delete; + tgba_product(const tgba_product&) SPOT_DELETED; + tgba_product& operator=(const tgba_product&) SPOT_DELETED; }; /// \brief A lazy product with different initial states. diff --git a/src/tgba/tgbasgba.hh b/src/tgba/tgbasgba.hh index 7de9c1ed0..665a401c1 100644 --- a/src/tgba/tgbasgba.hh +++ b/src/tgba/tgbasgba.hh @@ -66,8 +66,8 @@ namespace spot bool emulate_acc_cond_; bdd acceptance_condition_; // Disallow copy. - tgba_sgba_proxy(const tgba_sgba_proxy&) = delete; - tgba_sgba_proxy& operator=(const tgba_sgba_proxy&) = delete; + tgba_sgba_proxy(const tgba_sgba_proxy&) SPOT_DELETED; + tgba_sgba_proxy& operator=(const tgba_sgba_proxy&) SPOT_DELETED; }; } diff --git a/src/tgba/tgbatba.hh b/src/tgba/tgbatba.hh index c4d99643b..f21cde793 100644 --- a/src/tgba/tgbatba.hh +++ b/src/tgba/tgbatba.hh @@ -120,8 +120,8 @@ namespace spot mutable void* uniq_map_; // Disallow copy. - tgba_tba_proxy(const tgba_tba_proxy&) = delete; - tgba_tba_proxy& operator=(const tgba_tba_proxy&) = delete; + tgba_tba_proxy(const tgba_tba_proxy&) SPOT_DELETED; + tgba_tba_proxy& operator=(const tgba_tba_proxy&) SPOT_DELETED; }; /// \ingroup tgba_on_the_fly_algorithms diff --git a/src/tgba/tgbaunion.hh b/src/tgba/tgbaunion.hh index e35e835af..cf7ca5fee 100644 --- a/src/tgba/tgbaunion.hh +++ b/src/tgba/tgbaunion.hh @@ -151,8 +151,8 @@ namespace spot bdd all_acceptance_conditions_; bdd neg_acceptance_conditions_; // Disallow copy. - tgba_union(const tgba_union&) = delete; - tgba_union& operator=(const tgba_union&) = delete; + tgba_union(const tgba_union&) SPOT_DELETED; + tgba_union& operator=(const tgba_union&) SPOT_DELETED; }; diff --git a/src/tgba/wdbacomp.cc b/src/tgba/wdbacomp.cc index ff65efb4b..3d0e72c65 100644 --- a/src/tgba/wdbacomp.cc +++ b/src/tgba/wdbacomp.cc @@ -271,8 +271,8 @@ namespace spot bdd the_acceptance_cond_; // Disallow copy. - tgba_wdba_comp_proxy(const tgba_wdba_comp_proxy&) = delete; - tgba_wdba_comp_proxy& operator=(const tgba_wdba_comp_proxy&) = delete; + tgba_wdba_comp_proxy(const tgba_wdba_comp_proxy&) SPOT_DELETED; + tgba_wdba_comp_proxy& operator=(const tgba_wdba_comp_proxy&) SPOT_DELETED; }; } diff --git a/wrap/python/Makefile.am b/wrap/python/Makefile.am index fe13622e8..572a1c142 100644 --- a/wrap/python/Makefile.am +++ b/wrap/python/Makefile.am @@ -40,8 +40,7 @@ _spot_la_LDFLAGS = -avoid-version -module _spot_la_LIBADD = $(top_builddir)/src/libspot.la $(srcdir)/spot_wrap.cxx: $(srcdir)/spot.i - $(SWIG) -c++ -python -DSPOT_API= -I$(srcdir) \ - -I$(top_srcdir)/src $(srcdir)/spot.i + $(SWIG) -c++ -python -I$(srcdir) -I$(top_srcdir)/src $(srcdir)/spot.i $(srcdir)/spot.py: $(srcdir)/spot.i $(MAKE) $(AM_MAKEFLAGS) spot_wrap.cxx @@ -53,7 +52,7 @@ _buddy_la_SOURCES = $(srcdir)/buddy_wrap.cxx _buddy_la_LDFLAGS = -avoid-version -module $(BUDDY_LDFLAGS) $(srcdir)/buddy_wrap.cxx: $(srcdir)/buddy.i - $(SWIG) -c++ -python -DBUDDY_API= $(BUDDY_CPPFLAGS) $(srcdir)/buddy.i + $(SWIG) -c++ -python $(BUDDY_CPPFLAGS) $(srcdir)/buddy.i $(srcdir)/buddy.py: $(srcdir)/buddy.i $(MAKE) $(AM_MAKEFLAGS) buddy_wrap.cxx diff --git a/wrap/python/spot.i b/wrap/python/spot.i index ac11bcf1c..e963d6696 100644 --- a/wrap/python/spot.i +++ b/wrap/python/spot.i @@ -155,6 +155,7 @@ using namespace spot; %rename(FalseVal) False; %rename(TrueVal) True; +%include "misc/common.hh" %include "misc/version.hh" %include "misc/minato.hh" %include "misc/optionmap.hh"