From 2d3948b98bb9e8c7bad60f1acd99ff0b42b3ae30 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Sun, 10 Nov 2013 00:58:44 -0500 Subject: guard against direct includes of tr1 --- mteval/mbr_kbest.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'mteval/mbr_kbest.cc') diff --git a/mteval/mbr_kbest.cc b/mteval/mbr_kbest.cc index 2519bc01..787c03bd 100644 --- a/mteval/mbr_kbest.cc +++ b/mteval/mbr_kbest.cc @@ -1,9 +1,14 @@ #include #include -#include #include #include +#ifdef HAVE_CXX11 +# include +#else +# include +namespace std { using std::tr1::unordered_map; } +#endif #include "prob.h" #include "tdict.h" @@ -12,7 +17,6 @@ #include "stringlib.h" using namespace std; -using namespace std::tr1; namespace po = boost::program_options; -- cgit v1.2.3 From 4bdb3451dc6c005a5356844435c098bb14dae6a8 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Sun, 10 Nov 2013 01:22:11 -0500 Subject: fixes --- configure.ac | 7 ++++++- mteval/mbr_kbest.cc | 2 +- mteval/ns_ter.cc | 2 +- mteval/ter.cc | 2 +- utils/hash.h | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) (limited to 'mteval/mbr_kbest.cc') diff --git a/configure.ac b/configure.ac index c3b749e3..e4183c15 100644 --- a/configure.ac +++ b/configure.ac @@ -185,7 +185,12 @@ AC_CHECK_HEADER(google/dense_hash_map, AC_PROG_INSTALL -CPPFLAGS="-DPIC -fPIC $CPPFLAGS -DHAVE_CONFIG_H -DKENLM_MAX_ORDER=6" +CPPFLAGS="-DPIC -fPIC $CXX11_SWITCH $CPPFLAGS -DHAVE_CONFIG_H -DKENLM_MAX_ORDER=6" + +if test "x$HAVE_CXX11" = "x0"; then + CPPFLAGS="$CPPFLAGS -DHAVE_OLD_CPP" +fi + # core cdec stuff AC_CONFIG_FILES([Makefile]) diff --git a/mteval/mbr_kbest.cc b/mteval/mbr_kbest.cc index 787c03bd..76d2c7fc 100644 --- a/mteval/mbr_kbest.cc +++ b/mteval/mbr_kbest.cc @@ -3,7 +3,7 @@ #include #include -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include #else # include diff --git a/mteval/ns_ter.cc b/mteval/ns_ter.cc index f0d84098..680fb7b4 100644 --- a/mteval/ns_ter.cc +++ b/mteval/ns_ter.cc @@ -4,7 +4,7 @@ #include #include #include -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include #else # include diff --git a/mteval/ter.cc b/mteval/ter.cc index 9da54306..19b90bbc 100644 --- a/mteval/ter.cc +++ b/mteval/ter.cc @@ -5,7 +5,7 @@ #include #include #include -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include #else # include diff --git a/utils/hash.h b/utils/hash.h index e56fca06..e1426ffb 100644 --- a/utils/hash.h +++ b/utils/hash.h @@ -20,7 +20,7 @@ # define HASH_MAP_RESERVED(h,empty,deleted) do { (h).set_empty_key(empty); (h).set_deleted_key(deleted); } while(0) # define HASH_MAP_EMPTY(h,empty) do { (h).set_empty_key(empty); } while(0) #else -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP # include # include #else -- cgit v1.2.3