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

c++11: work around Swig 2.0

* src/misc/common.hh: Conditionally define SPOT_DELETED to = delete.
* src/ltlvisit/simplify.hh, src/ta/taexplicit.hh, src/ta/taproduct.hh,
src/tgba/bdddict.hh, src/tgba/taatgba.hh, src/tgba/tgbabddconcrete.hh,
src/tgba/tgbaexplicit.hh, src/tgba/tgbaproduct.hh, src/tgba/tgbasgba.hh,
src/tgba/tgbatba.hh, src/tgba/tgbaunion.hh, src/tgba/wdbacomp.cc: Use
SPOT_DELETED.
* wrap/python/spot.i: Include common.hh.
* wrap/python/Makefile.am: Remove useless definition of SPOT_API
and BUDDY_API.
parent 9cfc9f0f
......@@ -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;
};
......
......@@ -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
......@@ -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_;
......
......@@ -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;
};
......
......@@ -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;
};
......
......@@ -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<const label, taa_tgba::state*,
label_hash> ns_map;
typedef std::unordered_map<const taa_tgba::state*, label,
ptr_hash<taa_tgba::state>> sn_map;
ptr_hash<taa_tgba::state> > sn_map;
ns_map name_state_map_;
sn_map state_name_map_;
......
......@@ -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;
};
}
......
......@@ -709,8 +709,8 @@ namespace spot
private:
// Disallow copy.
tgba_explicit(const tgba_explicit<State>& other) = delete;
tgba_explicit& operator=(const tgba_explicit& other) = delete;
tgba_explicit(const tgba_explicit<State>& other) SPOT_DELETED;
tgba_explicit& operator=(const tgba_explicit& other) SPOT_DELETED;
};
template <typename State>
......@@ -739,8 +739,8 @@ namespace spot
private:
// Disallow copy.
sba_explicit(const sba_explicit<State>& other) = delete;
sba_explicit& operator=(const sba_explicit& other) = delete;
sba_explicit(const sba_explicit<State>& other) SPOT_DELETED;
sba_explicit& operator=(const sba_explicit& other) SPOT_DELETED;
};
......
......@@ -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.
......
......@@ -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;
};
}
......
......@@ -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
......
......@@ -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;
};
......
......@@ -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;
};
}
......
......@@ -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
......@@ -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"
......
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