[Commits] 3321f1a: MDEV-5944: Compile fix for OQGRAPH with LLVM

Vicentiu Ciorbaru vicentiu at mariadb.org
Tue Oct 25 16:01:03 EEST 2016


revision-id: 3321f1adc74b54e7534000c06eeca166730ccc4a (mariadb-10.0.27-13-g3321f1a)
parent(s): 0c925aa9356ee9d31283510c2420d1b5f21f5c9c
author: Don Lewis
committer: Vicențiu Ciorbaru
timestamp: 2016-10-25 13:46:28 +0300
message:

MDEV-5944: Compile fix for OQGRAPH with LLVM

Clang/LLVM has more strict schemantics than gcc.

This patch quantifies the namesspace such that it will
compile using clang.

---
 storage/oqgraph/graphcore.cc   |  2 +-
 storage/oqgraph/oqgraph_shim.h | 48 ++++++++++++++++++++++++------------------
 2 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/storage/oqgraph/graphcore.cc b/storage/oqgraph/graphcore.cc
index 4346b94..7c8ca53 100644
--- a/storage/oqgraph/graphcore.cc
+++ b/storage/oqgraph/graphcore.cc
@@ -485,7 +485,7 @@ namespace open_query
   optional<Vertex>
   oqgraph_share::find_vertex(VertexID id) const
   {
-    return ::boost::find_vertex(id, g);
+    return oqgraph3::find_vertex(id, g);
   }
 
 #if 0
diff --git a/storage/oqgraph/oqgraph_shim.h b/storage/oqgraph/oqgraph_shim.h
index af240b8..004d7f0 100644
--- a/storage/oqgraph/oqgraph_shim.h
+++ b/storage/oqgraph/oqgraph_shim.h
@@ -274,6 +274,33 @@ namespace boost
   };
 #endif
 
+  template<>
+  struct property_map<oqgraph3::graph, edge_weight_t>
+  {
+    typedef void type;
+    typedef oqgraph3::edge_weight_property_map const_type;
+  };
+
+  template<>
+  struct property_map<oqgraph3::graph, vertex_index_t>
+  {
+    typedef void type;
+    typedef oqgraph3::vertex_index_property_map const_type;
+  };
+
+  template<>
+  struct property_map<oqgraph3::graph, edge_index_t>
+  {
+    typedef void type;
+    typedef oqgraph3::edge_index_property_map const_type;
+  };
+
+}
+
+namespace oqgraph3
+{
+  using namespace boost;
+
   inline graph_traits<oqgraph3::graph>::vertex_descriptor
   source(
       const graph_traits<oqgraph3::graph>::edge_descriptor& e,
@@ -401,27 +428,6 @@ namespace boost
     return count;
   }
 
-  template<>
-  struct property_map<oqgraph3::graph, edge_weight_t>
-  {
-    typedef void type;
-    typedef oqgraph3::edge_weight_property_map const_type;
-  };
-
-  template<>
-  struct property_map<oqgraph3::graph, vertex_index_t>
-  {
-    typedef void type;
-    typedef oqgraph3::vertex_index_property_map const_type;
-  };
-
-  template<>
-  struct property_map<oqgraph3::graph, edge_index_t>
-  {
-    typedef void type;
-    typedef oqgraph3::edge_index_property_map const_type;
-  };
-
   inline property_map<
       oqgraph3::graph,
       edge_weight_t>::const_type::reference


More information about the commits mailing list