build+src: Updating common.hpp to import (std|boost)::(shared_ptr|function|...) into ndn namespace
Also fixing a small bug in wscript.
Change-Id: I8f20caa177cc015b7433d1ecd3db385f533437c6
diff --git a/src/common.hpp b/src/common.hpp
index 8903f22..d8290bf 100644
--- a/src/common.hpp
+++ b/src/common.hpp
@@ -14,6 +14,9 @@
#include <stddef.h>
#include <vector>
+#include <list>
+#include <set>
+#include <algorithm>
#if NDN_CPP_HAVE_CXX11
@@ -22,29 +25,52 @@
#endif
#include <memory>
-namespace ndn { namespace ptr_lib = std; }
-
-// #if NDN_CPP_HAVE_STD_FUNCTION
#include <functional>
-namespace ndn { namespace func_lib = std; }
+
+namespace ndn {
+
+namespace ptr_lib = std;
+namespace func_lib = std
+
+using std::shared_ptr;
+using std::make_shared;
+using std::enable_shared_from_this;
+
+using std::function;
+using std::bind;
+using std::placeholders; // _1, _2, ..
+
+} // namespace ndn
+
#else
-// #if NDN_CPP_HAVE_BOOST_SHARED_PTR
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <boost/make_shared.hpp>
-namespace ndn { namespace ptr_lib = boost; }
-// #if NDN_CPP_HAVE_BOOST_FUNCTION
#include <boost/function.hpp>
#include <boost/bind.hpp>
-namespace ndn { namespace func_lib = boost; }
+
+namespace ndn {
+
+namespace ptr_lib = boost;
+namespace func_lib = boost;
+
+using boost::shared_ptr;
+using boost::make_shared;
+using boost::enable_shared_from_this;
+
+using boost::function;
+using boost::bind;
+
+} // namespace ndn
#endif
namespace ndn {
+
/**
* A time interval represented as the number of milliseconds.
*/
diff --git a/src/encoding/block.hpp b/src/encoding/block.hpp
index 3ae5971..a764dd1 100644
--- a/src/encoding/block.hpp
+++ b/src/encoding/block.hpp
@@ -10,7 +10,7 @@
#ifndef NDN_BLOCK_HPP
#define NDN_BLOCK_HPP
-#include "common.hpp"
+#include "../common.hpp"
#include <list>
#include <exception>
diff --git a/src/encoding/buffer.hpp b/src/encoding/buffer.hpp
index f6b7a17..1dc8f7e 100644
--- a/src/encoding/buffer.hpp
+++ b/src/encoding/buffer.hpp
@@ -10,7 +10,7 @@
#ifndef NDN_BUFFER_HPP
#define NDN_BUFFER_HPP
-#include "common.hpp"
+#include "../common.hpp"
#include <boost/iostreams/detail/ios.hpp>
#include <boost/iostreams/categories.hpp>
diff --git a/src/encoding/cryptopp/asn_ext.cpp b/src/encoding/cryptopp/asn_ext.cpp
index 9a3816e..beea45d 100644
--- a/src/encoding/cryptopp/asn_ext.cpp
+++ b/src/encoding/cryptopp/asn_ext.cpp
@@ -6,7 +6,6 @@
* See COPYING for copyright and distribution information.
*/
-#include "ndn-cpp-config.h"
#include "asn_ext.hpp"
#include "../../util/time.hpp"
diff --git a/src/encoding/cryptopp/asn_ext.hpp b/src/encoding/cryptopp/asn_ext.hpp
index c53cb96..d344edc 100644
--- a/src/encoding/cryptopp/asn_ext.hpp
+++ b/src/encoding/cryptopp/asn_ext.hpp
@@ -23,7 +23,7 @@
#endif
#include <stdexcept>
-#include "common.hpp"
+#include "../../common.hpp"
#include <cryptopp/asn.h>
namespace ndn {
diff --git a/src/security/sec-public-info-sqlite3.cpp b/src/security/sec-public-info-sqlite3.cpp
index 4098b4a..b7f1f7e 100644
--- a/src/security/sec-public-info-sqlite3.cpp
+++ b/src/security/sec-public-info-sqlite3.cpp
@@ -6,10 +6,6 @@
* See COPYING for copyright and distribution information.
*/
-// Only compile if ndn-cpp-config.h defines NDN_CPP_HAVE_SQLITE3.
-#include "ndn-cpp-config.h"
-#ifdef NDN_CPP_HAVE_SQLITE3
-
#include <sqlite3.h>
#include <stdio.h>
#include <stdlib.h>
@@ -722,4 +718,3 @@
} // namespace ndn
-#endif // NDN_CPP_HAVE_SQLITE3
diff --git a/src/security/sec-public-info-sqlite3.hpp b/src/security/sec-public-info-sqlite3.hpp
index 30f28f8..f6e45c3 100644
--- a/src/security/sec-public-info-sqlite3.hpp
+++ b/src/security/sec-public-info-sqlite3.hpp
@@ -9,10 +9,6 @@
#ifndef NDN_SEC_PUBLIC_INFO_SQLITE3_HPP
#define NDN_SEC_PUBLIC_INFO_SQLITE3_HPP
-// Only compile if ndn-cpp-config.h defines NDN_CPP_HAVE_SQLITE3.
-#include "ndn-cpp-config.h"
-#ifdef NDN_CPP_HAVE_SQLITE3
-
#include "../common.hpp"
#include "sec-public-info.hpp"
@@ -219,6 +215,4 @@
}
-#endif // NDN_CPP_HAVE_SQLITE3
-
#endif
diff --git a/src/security/sec-tpm-osx.cpp b/src/security/sec-tpm-osx.cpp
index 8d5ab48..fed73e1 100644
--- a/src/security/sec-tpm-osx.cpp
+++ b/src/security/sec-tpm-osx.cpp
@@ -5,16 +5,14 @@
* See COPYING for copyright and distribution information.
*/
-#include "ndn-cpp-config.h"
+#include "sec-tpm-osx.hpp"
+
+#include "security/public-key.hpp"
+#include "util/logging.hpp"
#include <fstream>
#include <sstream>
-#include "../util/logging.hpp"
-
-#include "security/sec-tpm-osx.hpp"
-#include "security/public-key.hpp"
-
#include <CoreFoundation/CoreFoundation.h>
#include <Security/Security.h>
#include <CoreServices/CoreServices.h>
diff --git a/src/security/sec-tpm-osx.hpp b/src/security/sec-tpm-osx.hpp
index 9834822..c724ca7 100644
--- a/src/security/sec-tpm-osx.hpp
+++ b/src/security/sec-tpm-osx.hpp
@@ -8,10 +8,6 @@
#ifndef NDN_SEC_TPM_OSX_HPP
#define NDN_SEC_TPM_OSX_HPP
-// Only compile if ndn-cpp-config.h defines NDN_CPP_HAVE_OSX_SECURITY 1.
-#include "ndn-cpp-config.h"
-#if NDN_CPP_HAVE_OSX_SECURITY
-
#include "../common.hpp"
#include "sec-tpm.hpp"
@@ -117,8 +113,6 @@
std::auto_ptr<Impl> impl_;
};
-}
+} // namespace ndn
-#endif // NDN_CPP_HAVE_OSX_SECURITY
-
-#endif
+#endif // NDN_SEC_TPM_OSX_HPP
diff --git a/src/transport/transport.hpp b/src/transport/transport.hpp
index 3c82c87..41861b4 100644
--- a/src/transport/transport.hpp
+++ b/src/transport/transport.hpp
@@ -8,7 +8,7 @@
#ifndef NDN_TRANSPORT_HPP
#define NDN_TRANSPORT_HPP
-#include "common.hpp"
+#include "../common.hpp"
#include <vector>
#include <boost/asio.hpp>
diff --git a/src/util/crypto.hpp b/src/util/crypto.hpp
index 5fb5d35..8d4aa0b 100644
--- a/src/util/crypto.hpp
+++ b/src/util/crypto.hpp
@@ -7,7 +7,7 @@
#ifndef NDN_UTIL_CRYPTO_HPP
#define NDN_UTIL_CRYPTO_HPP
-#include "common.hpp"
+#include "../common.hpp"
#include <openssl/ssl.h>
#include <openssl/rsa.h>
diff --git a/src/util/logging.hpp b/src/util/logging.hpp
index 3f5848e..3fc1c0a 100644
--- a/src/util/logging.hpp
+++ b/src/util/logging.hpp
@@ -9,7 +9,7 @@
#ifndef NDN_LOGGING_HPP
#define NDN_LOGGING_HPP
-#include "common.hpp"
+#include "../common.hpp"
#ifdef NDN_CPP_HAVE_LOG4CXX
diff --git a/src/util/ndnd-id-fetcher.hpp b/src/util/ndnd-id-fetcher.hpp
index a44dbbc..4dc7b8d 100644
--- a/src/util/ndnd-id-fetcher.hpp
+++ b/src/util/ndnd-id-fetcher.hpp
@@ -8,7 +8,7 @@
#ifndef NDN_NDND_ID_FETCHER_HPP
#define NDN_NDND_ID_FETCHER_HPP
-#include "common.hpp"
+#include "../common.hpp"
#include "util/crypto.hpp"
namespace ndn {
diff --git a/src/util/time.hpp b/src/util/time.hpp
index 8f110a9..82d59e9 100644
--- a/src/util/time.hpp
+++ b/src/util/time.hpp
@@ -8,7 +8,7 @@
#ifndef NDN_TIME_HPP
#define NDN_TIME_HPP
-#include "common.hpp"
+#include "../common.hpp"
#include <boost/date_time/posix_time/posix_time.hpp>
namespace ndn {