Commit 1efd1c06 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Unify inclusion of tr1 headers based on libstdc++ version

This enables the inclusion of the non-boost tr1 headers if a recent
enough version of libstdc++ is detected. This als fixes a bug with
clang when sparsehash pulls unwanted tr1 headers.
parent a7f57fbd
......@@ -55,7 +55,8 @@ libgraph_tool_core_la_include_HEADERS = \
numpy_bind.hh \
random.hh \
str_repr.hh \
shared_map.hh
shared_map.hh \
tr1_include.hh
libgraph_tool_core_la_workarounddir = $(MOD_DIR)/include/boost-workaround/boost/graph/
libgraph_tool_core_la_workaround_HEADERS = \
......
......@@ -18,11 +18,8 @@
#ifndef GRAPH_CLUSTERING_HH
#define GRAPH_CLUSTERING_HH
#if (GCC_VERSION >= 40400)
# include <tr1/unordered_set>
#else
# include <boost/tr1/unordered_set.hpp>
#endif
#include "tr1_include.hh"
#include TR1_HEADER(unordered_set)
#include <boost/mpl/if.hpp>
#include <ext/numeric>
......
......@@ -20,11 +20,9 @@
#ifndef GRAPH_EXTENDED_CLUSTERING_HH
#define GRAPH_EXTENDED_CLUSTERING_HH
#if (GCC_VERSION >= 40400)
# include <tr1/unordered_set>
#else
# include <boost/tr1/unordered_set.hpp>
#endif
#include "tr1_include.hh"
#include TR1_HEADER(unordered_set)
#include <boost/graph/breadth_first_search.hpp>
namespace graph_tool
......
......@@ -19,13 +19,8 @@
#define GRAPH_MOTIFS_HH
#include <boost/graph/isomorphism.hpp>
#if (GCC_VERSION >= 40400)
# include <tr1/unordered_set>
# include <tr1/random>
#else
# include <boost/tr1/unordered_set.hpp>
# include <boost/tr1/random.hpp>
#endif
#include "tr1_include.hh"
#include TR1_HEADER(unordered_set)
#include <boost/functional/hash.hpp>
#include <algorithm>
......
......@@ -24,13 +24,9 @@
#include <ext/numeric>
using __gnu_cxx::power;
# ifndef __clang__
# include <tr1/unordered_set>
# include <tr1/tuple>
# else
# include <boost/tr1/unordered_set.hpp>
# include <boost/tr1/tuple.hpp>
# endif
#include "tr1_include.hh"
#include TR1_HEADER(unordered_set)
#include TR1_HEADER(tuple)
#include <dense_hash_set>
#include <dense_hash_map>
......
......@@ -18,13 +18,9 @@
#ifndef GRAPH_COMMUNITY_HH
#define GRAPH_COMMUNITY_HH
#if (GCC_VERSION >= 40400)
# include <tr1/unordered_set>
# include <tr1/tuple>
#else
# include <boost/tr1/unordered_set.hpp>
# include <boost/tr1/tuple.hpp>
#endif
#include "tr1_include.hh"
#include TR1_HEADER(unordered_set)
#include TR1_HEADER(tuple)
#include <iostream>
#include <fstream>
#include <iomanip>
......
......@@ -18,11 +18,9 @@
#ifndef GRAPH_COMMUNITY_NETWORK_HH
#define GRAPH_COMMUNITY_NETWORK_HH
#if (GCC_VERSION >= 40400)
# include <tr1/unordered_map>
#else
# include <boost/tr1/unordered_map.hpp>
#endif
#include "tr1_include.hh"
#include TR1_HEADER(unordered_map)
#include <iostream>
#include <iomanip>
......
......@@ -18,12 +18,9 @@
#ifndef GRAPH_ASSORTATIVITY_HH
#define GRAPH_ASSORTATIVITY_HH
#include "tr1_include.hh"
#include TR1_HEADER(unordered_map)
#if (GCC_VERSION >= 40400)
# include <tr1/unordered_map>
#else
# include <boost/tr1/unordered_map.hpp>
#endif
#include "shared_map.hh"
#include "graph_util.hh"
......
......@@ -29,11 +29,8 @@
#include <iostream>
#if (GCC_VERSION >= 40400)
# include <tr1/unordered_map>
#else
# include <boost/tr1/unordered_map.hpp>
#endif
#include "tr1_include.hh"
#include TR1_HEADER(unordered_map)
#include <cairommconfig.h>
#include <cairomm/context.h>
......
......@@ -18,13 +18,9 @@
#ifndef GRAPH_GENERATION_HH
#define GRAPH_GENERATION_HH
#if (GCC_VERSION >= 40400)
# include <tr1/unordered_map>
# include <tr1/tuple>
#else
# include <boost/tr1/unordered_map.hpp>
# include <boost/tr1/tuple.hpp>
#endif
#include "tr1_include.hh"
#include TR1_HEADER(unordered_map)
#include TR1_HEADER(tuple)
#include <boost/functional/hash.hpp>
#include <map>
#include <set>
......
......@@ -19,11 +19,8 @@
#define GRAPH_GEOMETRIC_HH
#include <iostream>
#if (GCC_VERSION >= 40400)
# include <tr1/unordered_map>
#else
# include <boost/tr1/unordered_map.hpp>
#endif
#include "tr1_include.hh"
#include TR1_HEADER(unordered_map)
#include <boost/functional/hash.hpp>
#include "graph_util.hh"
......
......@@ -23,11 +23,8 @@
#include "graph_util.hh"
#include "random.hh"
#if (GCC_VERSION >= 40400)
# include <tr1/unordered_set>
#else
# include <boost/tr1/unordered_set.hpp>
#endif
#include "tr1_include.hh"
#include TR1_HEADER(unordered_set)
#include <map>
#include <iostream>
......
......@@ -18,11 +18,8 @@
#ifndef GRAPH_REWIRING_HH
#define GRAPH_REWIRING_HH
#if (GCC_VERSION >= 40400)
# include <tr1/unordered_set>
#else
# include <boost/tr1/unordered_set.hpp>
#endif
#include "tr1_include.hh"
#include TR1_HEADER(unordered_set)
#include <boost/functional/hash.hpp>
#include <iostream>
......
......@@ -23,13 +23,10 @@
#ifndef GRAPH_TRIANGULATION_HH
#define GRAPH_TRIANGULATION_HH
#if (GCC_VERSION >= 40400)
# include <tr1/unordered_set>
# include <tr1/tuple>
#else
# include <boost/tr1/unordered_set.hpp>
# include <boost/tr1/tuple.hpp>
#endif
#include "tr1_include.hh"
#include TR1_HEADER(unordered_set)
#include TR1_HEADER(tuple)
#include <boost/functional/hash.hpp>
#include "graph_util.hh"
......
......@@ -36,11 +36,8 @@
#include <string>
#include <vector>
#if (GCC_VERSION >= 40400)
# include <tr1/unordered_map>
#else
# include <boost/tr1/unordered_map.hpp>
#endif
#include "tr1_include.hh"
#include TR1_HEADER(unordered_map)
namespace graph_tool{
......
......@@ -22,11 +22,8 @@
#include "graph_selectors.hh"
#include "graph_util.hh"
#if (GCC_VERSION >= 40400)
# include <tr1/unordered_set>
#else
# include <boost/tr1/unordered_set.hpp>
#endif
#include "tr1_include.hh"
#include TR1_HEADER(unordered_set)
#include <boost/mpl/for_each.hpp>
......
......@@ -21,17 +21,11 @@
#include <typeinfo>
#include <string>
#include <vector>
#if (GCC_VERSION >= 40400)
# include <tr1/unordered_set>
# include <tr1/unordered_map>
# include <tr1/random>
# include <tr1/memory>
#else
# include <boost/tr1/unordered_set.hpp>
# include <boost/tr1/unordered_map.hpp>
# include <boost/tr1/random.hpp>
# include <boost/tr1/memory.hpp>
#endif
#include "tr1_include.hh"
#include TR1_HEADER(unordered_set)
#include TR1_HEADER(unordered_map)
#include TR1_HEADER(memory)
#include TR1_HEADER(random)
#include <boost/functional/hash.hpp>
#include <boost/python/object.hpp>
#include <boost/python/extract.hpp>
......
......@@ -34,11 +34,8 @@
#include <boost/type_traits/is_convertible.hpp>
#include <string>
#if (GCC_VERSION >= 40400)
# include <tr1/random>
#else
# include <boost/tr1/random.hpp>
#endif
#include "tr1_include.hh"
#include TR1_HEADER(random)
namespace graph_tool
{
......
......@@ -24,12 +24,8 @@
#include <boost/graph/filtered_graph.hpp>
#if (GCC_VERSION >= 40400)
# include <tr1/unordered_map>
#else
# include <boost/tr1/unordered_map.hpp>
#endif
#include "tr1_include.hh"
#include TR1_HEADER(unordered_map)
// Graph wrapper which takes care of edge index housekeeping
......
......@@ -18,11 +18,6 @@
#ifndef GRAPH_ARF_HH
#define GRAPH_ARF_HH
#if (GCC_VERSION >= 40400)
# include <tr1/random>
#else
# include <boost/tr1/random.hpp>
#endif
#include <limits>
#include <iostream>
......
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