From 1847ebec9e0c5b46e4f9841aa711a75c76c4c719 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sat, 18 Jul 2015 11:22:19 +0200 Subject: [PATCH] assume NTL has been compiled in ISO mode Older versions of NTL could be compiled with either NTL_STD_CXX=on or NTL_STD_CXX=off. NTL_STD_CXX=on became the default in NTL 5.4 and the choice was removed completely in NTL 7.0.0. This means that the NTL_STD_CXX define can no longer be used to check whether NTL is using namespaces. Instead, require that NTL has been compiled in ISO mode. Reported-by: Thomas Kahle Signed-off-by: Sven Verdoolaege --- README | 3 +++ barvinok.cc | 2 -- barvinok/NTL_QQ.h | 2 -- barvinok/genfun.h | 2 -- conversion.h | 2 -- decomposer.cc | 2 -- decomposer.h | 2 -- dpoly.h | 2 -- genfun_constructor.h | 2 -- lattice_point.h | 2 -- lexmin.cc | 2 -- m4/ax_check_ntl.m4 | 5 +++++ mat_util.h | 2 -- reducer.h | 2 -- vertex_cone.h | 2 -- 15 files changed, 8 insertions(+), 26 deletions(-) diff --git a/README b/README index 47257cc..c0678c7 100644 --- a/README +++ b/README @@ -24,6 +24,9 @@ Additionally, the following packages can optionally be used NTL needs to have been compiled with GMP support. That is, you have to specify NTL_GMP_LIP=on +NTL also needs to have been compiled in ISO mode. +For versions older than 5.4, this means you need an additional + NTL_STD_CXX=on Suppose you want to install everything in /opt, Then you configure/compile NTL using diff --git a/barvinok.cc b/barvinok.cc index 4231ca0..95265d6 100644 --- a/barvinok.cc +++ b/barvinok.cc @@ -31,9 +31,7 @@ #include "param_util.h" #include "summate.h" -#ifdef NTL_STD_CXX using namespace NTL; -#endif using std::cerr; using std::cout; using std::endl; diff --git a/barvinok/NTL_QQ.h b/barvinok/NTL_QQ.h index 0619c82..56ab1cf 100644 --- a/barvinok/NTL_QQ.h +++ b/barvinok/NTL_QQ.h @@ -3,9 +3,7 @@ #include -#ifdef NTL_STD_CXX using namespace NTL; -#endif struct QQ { ZZ n; diff --git a/barvinok/genfun.h b/barvinok/genfun.h index be7ab95..fdd1c0c 100644 --- a/barvinok/genfun.h +++ b/barvinok/genfun.h @@ -9,9 +9,7 @@ #include #include -#ifdef NTL_STD_CXX using namespace NTL; -#endif struct short_rat { struct __short_rat_n { diff --git a/conversion.h b/conversion.h index 87d1836..5d09fa5 100644 --- a/conversion.h +++ b/conversion.h @@ -2,9 +2,7 @@ #include #include -#ifdef NTL_STD_CXX using namespace NTL; -#endif void value2zz(Value v, ZZ& z); void zz2value(const ZZ& z, Value& v); diff --git a/decomposer.cc b/decomposer.cc index 6b9344a..05f5b0a 100644 --- a/decomposer.cc +++ b/decomposer.cc @@ -10,9 +10,7 @@ #include "param_util.h" #include "reduce_domain.h" -#ifdef NTL_STD_CXX using namespace NTL; -#endif using std::vector; using std::cerr; using std::endl; diff --git a/decomposer.h b/decomposer.h index 88d7e4a..b853afc 100644 --- a/decomposer.h +++ b/decomposer.h @@ -6,9 +6,7 @@ #include #include -#ifdef NTL_STD_CXX using namespace NTL; -#endif struct signed_cone { signed_cone(const mat_ZZ& rays, int sign, unsigned long det) : diff --git a/dpoly.h b/dpoly.h index b849ba7..e58bb85 100644 --- a/dpoly.h +++ b/dpoly.h @@ -8,9 +8,7 @@ #include #include "conversion.h" -#ifdef NTL_STD_CXX using namespace NTL; -#endif class dpoly { public: diff --git a/genfun_constructor.h b/genfun_constructor.h index ca8eb19..18f7c25 100644 --- a/genfun_constructor.h +++ b/genfun_constructor.h @@ -6,9 +6,7 @@ #include "reducer.h" #include "bfcounter.h" -#ifdef NTL_STD_CXX using namespace NTL; -#endif /* base for generating function counting */ struct gf_base { diff --git a/lattice_point.h b/lattice_point.h index 6f0dff5..3909223 100644 --- a/lattice_point.h +++ b/lattice_point.h @@ -21,9 +21,7 @@ Matrix *relative_coordinates(Param_Vertices *V, Matrix *basis); #include #include -#ifdef NTL_STD_CXX using namespace NTL; -#endif struct barvinok_options; diff --git a/lexmin.cc b/lexmin.cc index 529b97d..8334518 100644 --- a/lexmin.cc +++ b/lexmin.cc @@ -29,9 +29,7 @@ #undef CS /* for Solaris 10 */ -#ifdef NTL_STD_CXX using namespace NTL; -#endif using std::vector; using std::map; diff --git a/m4/ax_check_ntl.m4 b/m4/ax_check_ntl.m4 index 26be431..bec5169 100644 --- a/m4/ax_check_ntl.m4 +++ b/m4/ax_check_ntl.m4 @@ -12,6 +12,11 @@ AC_DEFUN([AX_CHECK_NTL], [ yes #endif ],:,AC_MSG_ERROR(ntl not compiled with gmp support)) + + AC_TRY_COMPILE([ + #include + using namespace NTL; + ], [], [], [AC_MSG_ERROR(Upgrade NTL or configure with NTL_STD_CXX=on)]) AC_LANG_POP AC_CHECK_LIB(ntl, main,[],[bv_no_ntl=true]) diff --git a/mat_util.h b/mat_util.h index 31a4ddf..dd864b0 100644 --- a/mat_util.h +++ b/mat_util.h @@ -1,9 +1,7 @@ #include #include -#ifdef NTL_STD_CXX using namespace NTL; -#endif int lex_cmp(const vec_ZZ& a, const vec_ZZ& b); void lex_order_rows(mat_ZZ& mat); diff --git a/reducer.h b/reducer.h index 30e2ef1..0ddf19d 100644 --- a/reducer.h +++ b/reducer.h @@ -8,9 +8,7 @@ #include "decomposer.h" #include "dpoly.h" -#ifdef NTL_STD_CXX using namespace NTL; -#endif struct gen_fun; diff --git a/vertex_cone.h b/vertex_cone.h index 387cb30..7fb7e4a 100644 --- a/vertex_cone.h +++ b/vertex_cone.h @@ -2,9 +2,7 @@ #include #include "power.h" -#ifdef NTL_STD_CXX using namespace NTL; -#endif /* Represents the vertex and the rays of a vertex cone */ struct vertex_cone { -- 2.11.4.GIT