From 3394f84354e8dc18156c5a1a8f8f4979cb6c9ed6 Mon Sep 17 00:00:00 2001
From: Markus Frank <markus.frank@cern.ch>
Date: Thu, 1 Sep 2016 19:23:39 +0000
Subject: [PATCH] Remove boost warning.

---
 DDCore/src/parsers/GrammarsV2.h |  3 ++-
 DDDB/src/DDDBAlignmentTest.cpp  |  8 +++++---
 DDG4/include/DDG4/IoStreams.h   | 17 +++++++++--------
 3 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/DDCore/src/parsers/GrammarsV2.h b/DDCore/src/parsers/GrammarsV2.h
index d0b85de92..5342418e0 100644
--- a/DDCore/src/parsers/GrammarsV2.h
+++ b/DDCore/src/parsers/GrammarsV2.h
@@ -31,10 +31,11 @@
 // Boost:
 //==============================================================================
 #ifdef __GNUC__
+#define __DD4HEP_LOCAL_GNUC__ __GNUC__
 #undef __GNUC__
 // Boost spits out an error if __GNUC__ is defined!
 #include <boost/spirit/include/qi.hpp>
-#define __GNUC__
+#define __GNUC__ __DD4HEP_LOCAL_GNUC__
 #else
 #include <boost/spirit/include/qi.hpp>
 #endif
diff --git a/DDDB/src/DDDBAlignmentTest.cpp b/DDDB/src/DDDBAlignmentTest.cpp
index ed27c9214..4bc23ffa6 100644
--- a/DDDB/src/DDDBAlignmentTest.cpp
+++ b/DDDB/src/DDDBAlignmentTest.cpp
@@ -68,7 +68,9 @@ namespace  {
     int det_key, par_key, top;
   };
   struct UserData {
-    typedef std::map<std::string,size_t>       DetectorMap;
+    static bool det_lexical_ordering(DetElement a, DetElement b)
+    {    return std::less(a.path(), b.path());                }
+    typedef std::map<DetElement,size_t,det_lexical_ordering>       DetectorMap;
     typedef std::map<unsigned int,size_t>      DetectorKeys;
     typedef std::vector<Entry>                 Entries;
     DetectorMap  detectors;
@@ -89,7 +91,7 @@ namespace  {
         entry.par  = det.parent().ptr();
         entry.det_key = key;
         entry.par_key = det.parent().key();
-        data.detectors.insert(make_pair(det.path(),data.entries.size()));
+        data.detectors.insert(make_pair(det,data.entries.size()));
         data.keys.insert(make_pair(key,data.entries.size()));
         data.entries.insert(data.entries.end(),entry);
       }
@@ -271,7 +273,7 @@ namespace  {
         Entry& e = data.entries[(*i).second];
         DetElement    det = e.det;
         unsigned int  key = det.key();
-        const string& p   = (*i).first;
+        const string& p   = det.path();
         size_t idx = p.find(prev);
         if ( idx == 0 )  {
           //printout(INFO,"Conditions","***** %d %p %08X: %s ",
diff --git a/DDG4/include/DDG4/IoStreams.h b/DDG4/include/DDG4/IoStreams.h
index 2d1ce26be..1c779ca5b 100644
--- a/DDG4/include/DDG4/IoStreams.h
+++ b/DDG4/include/DDG4/IoStreams.h
@@ -22,21 +22,22 @@
 #pragma GCC diagnostic ignored "-Wshadow" // Code that causes warning goes here
 #endif
 
+// booost iostreams include files
+#include <boost/iostreams/categories.hpp>
+#include <boost/iostreams/detail/ios.hpp>
+#include <boost/iostreams/detail/path.hpp>
+#include <boost/iostreams/positioning.hpp>
+
 #ifdef __GNUC__
-#undef __GNUC__
 // Boost spits out an error if __GNUC__ is defined!
+#define __DD4HEP_LOCAL_GNUC__ __GNUC__
+#undef __GNUC__
 #include <boost/iostreams/stream.hpp>
-#define __GNUC__
+#define __GNUC__ __DD4HEP_LOCAL_GNUC__
 #else
 #include <boost/iostreams/stream.hpp>
 #endif
 
-// booost iostreams include files
-#include <boost/iostreams/categories.hpp>
-#include <boost/iostreams/detail/ios.hpp>
-#include <boost/iostreams/detail/path.hpp>
-#include <boost/iostreams/positioning.hpp>
-
 // Forward declarations
 class TFile;
 
-- 
GitLab