build: Fixing build and unit tests
Use only C++ and boost methods (memory copying, comparison, time
operations), which are guaranteed to be present on all platforms
with C++ and boost libraries.
Change-Id: Ia2883555c55909a4f7a877cf6d5fbd49b12c73c8
diff --git a/src/common.cpp b/src/common.cpp
index 31569e3..53df6e1 100644
--- a/src/common.cpp
+++ b/src/common.cpp
@@ -7,13 +7,7 @@
#include <sstream>
#include <ndn-cpp-dev/common.hpp>
-
-#if NDN_CPP_HAVE_TIME_H
-#include <time.h>
-#endif
-#if NDN_CPP_HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
+#include "util/time.hpp"
using namespace std;
@@ -40,10 +34,7 @@
MillisecondsSince1970
getNow()
{
- struct timeval t;
- // Note: configure.ac requires gettimeofday.
- gettimeofday(&t, 0);
- return t.tv_sec * 1000.0 + t.tv_usec / 1000.0;
+ return getNowMilliseconds();
}