Always build in C++11 mode
refs: #1930
Change-Id: Iedad4a814e5c7e6a5486f2f7e16c45c356131792
diff --git a/src/adjacency-list.cpp b/src/adjacency-list.cpp
index 5c98ed8..3e535ee 100644
--- a/src/adjacency-list.cpp
+++ b/src/adjacency-list.cpp
@@ -22,8 +22,10 @@
**/
#include <algorithm>
#include <ndn-cxx/common.hpp>
+
#include "adjacency-list.hpp"
#include "adjacent.hpp"
+#include "common.hpp"
#include "nlsr.hpp"
#include "logger.hpp"
diff --git a/src/common.hpp b/src/common.hpp
new file mode 100644
index 0000000..d5da876
--- /dev/null
+++ b/src/common.hpp
@@ -0,0 +1,46 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014 University of Memphis,
+ * Regents of the University of California
+ *
+ * This file is part of NLSR (Named-data Link State Routing).
+ * See AUTHORS.md for complete list of NLSR authors and contributors.
+ *
+ * NLSR is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ *
+ **/
+
+#ifndef NLSR_COMMON_HPP
+#define NLSR_COMMON_HPP
+
+#include <ndn-cxx/common.hpp>
+
+namespace nlsr {
+
+using ndn::bind;
+using ndn::make_shared;
+using ndn::shared_ptr;
+using ndn::function;
+
+using ndn::_1;
+using ndn::_2;
+using ndn::_3;
+using ndn::_4;
+using ndn::_5;
+using ndn::_6;
+using ndn::_7;
+using ndn::_8;
+using ndn::_9;
+
+}
+
+#endif // NLSR_COMMON_HPP
diff --git a/src/communication/sync-logic-handler.cpp b/src/communication/sync-logic-handler.cpp
index 8e679ba..5e20795 100644
--- a/src/communication/sync-logic-handler.cpp
+++ b/src/communication/sync-logic-handler.cpp
@@ -22,6 +22,7 @@
**/
#include "sync-logic-handler.hpp"
+#include "common.hpp"
#include "conf-parameter.hpp"
#include "logger.hpp"
#include "lsa.hpp"
diff --git a/src/name-prefix-list.cpp b/src/name-prefix-list.cpp
index 0be579f..6afdb54 100644
--- a/src/name-prefix-list.cpp
+++ b/src/name-prefix-list.cpp
@@ -25,6 +25,7 @@
#include <ndn-cxx/common.hpp>
+#include "common.hpp"
#include "name-prefix-list.hpp"
#include "logger.hpp"
diff --git a/src/nlsr.hpp b/src/nlsr.hpp
index 866ad7c..de6f061 100644
--- a/src/nlsr.hpp
+++ b/src/nlsr.hpp
@@ -33,6 +33,7 @@
#include <ndn-cxx/management/nfd-face-event-notification.hpp>
#include <ndn-cxx/management/nfd-face-monitor.hpp>
+#include "common.hpp"
#include "conf-parameter.hpp"
#include "adjacency-list.hpp"
#include "name-prefix-list.hpp"
diff --git a/src/route/face-map.cpp b/src/route/face-map.cpp
index 7251fc5..398ed4f 100644
--- a/src/route/face-map.cpp
+++ b/src/route/face-map.cpp
@@ -23,6 +23,8 @@
#include <iostream>
#include <list>
#include <utility>
+
+#include "common.hpp"
#include "logger.hpp"
#include "face-map.hpp"
diff --git a/src/route/face-map.hpp b/src/route/face-map.hpp
index 4bc2b68..ccd801b 100644
--- a/src/route/face-map.hpp
+++ b/src/route/face-map.hpp
@@ -24,6 +24,7 @@
#define NLSR_FACE_MAP_HPP
#include <ndn-cxx/common.hpp>
+#include <algorithm>
namespace nlsr {
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index 16ed8a8..efc8a45 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -25,6 +25,7 @@
#include <ndn-cxx/common.hpp>
#include "adjacency-list.hpp"
+#include "common.hpp"
#include "conf-parameter.hpp"
#include "nexthop-list.hpp"
#include "face-map.hpp"
@@ -345,6 +346,11 @@
}
}
+typedef void(Fib::*RegisterPrefixCallback)(const ndn::nfd::ControlParameters&,
+ const ndn::nfd::ControlParameters&, uint8_t,
+ const CommandSucceedCallback&,
+ const CommandFailCallback&);
+
void
Fib::registerPrefix(const ndn::Name& namePrefix,
const std::string& faceUri,
@@ -364,9 +370,8 @@
.setExpirationPeriod(timeout)
.setOrigin(128);
createFace(faceUri,
- ndn::bind(&Fib::registerPrefixInNfd, this,_1,
- parameters,
- times, onSuccess, onFailure),
+ ndn::bind(static_cast<RegisterPrefixCallback>(&Fib::registerPrefixInNfd),
+ this, _1, parameters, times, onSuccess, onFailure),
onFailure);
}
diff --git a/src/route/name-prefix-table-entry.cpp b/src/route/name-prefix-table-entry.cpp
index 1d20319..383a00c 100644
--- a/src/route/name-prefix-table-entry.cpp
+++ b/src/route/name-prefix-table-entry.cpp
@@ -22,6 +22,8 @@
**/
#include <list>
#include <utility>
+
+#include "common.hpp"
#include "name-prefix-table-entry.hpp"
#include "routing-table-entry.hpp"
#include "nexthop.hpp"
diff --git a/src/route/nexthop-list.cpp b/src/route/nexthop-list.cpp
index 9ef6fd3..7002ad8 100644
--- a/src/route/nexthop-list.cpp
+++ b/src/route/nexthop-list.cpp
@@ -21,6 +21,8 @@
*
**/
#include <iostream>
+
+#include "common.hpp"
#include "nexthop-list.hpp"
#include "nexthop.hpp"
#include "logger.hpp"
diff --git a/src/utility/face-controller.cpp b/src/utility/face-controller.cpp
index a0c615f..0aa5a1e 100644
--- a/src/utility/face-controller.cpp
+++ b/src/utility/face-controller.cpp
@@ -20,6 +20,8 @@
**/
#include "face-controller.hpp"
+
+#include "common.hpp"
#include "logger.hpp"
namespace nlsr {