aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/util/time_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/util/time_util.cc')
-rw-r--r--src/google/protobuf/util/time_util.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/google/protobuf/util/time_util.cc b/src/google/protobuf/util/time_util.cc
index d4912837..a7cba004 100644
--- a/src/google/protobuf/util/time_util.cc
+++ b/src/google/protobuf/util/time_util.cc
@@ -38,6 +38,8 @@
#include <google/protobuf/timestamp.pb.h>
+#include <google/protobuf/port_def.inc>
+
namespace google {
namespace protobuf {
namespace util {
@@ -368,12 +370,13 @@ timeval TimeUtil::DurationToTimeval(const Duration& value) {
} // namespace util
} // namespace protobuf
+} // namespace google
-
+namespace google {
namespace protobuf {
namespace {
-using google::protobuf::util::kNanosPerSecond;
-using google::protobuf::util::CreateNormalized;
+using ::PROTOBUF_NAMESPACE_ID::util::CreateNormalized;
+using ::PROTOBUF_NAMESPACE_ID::util::kNanosPerSecond;
// Convert a Duration to uint128.
void ToUint128(const Duration& value, uint128* result, bool* negative) {
@@ -389,7 +392,8 @@ void ToUint128(const Duration& value, uint128* result, bool* negative) {
}
void ToDuration(const uint128& value, bool negative, Duration* duration) {
- int64 seconds = static_cast<int64>(Uint128Low64(value / kNanosPerSecond));
+ int64 seconds =
+ static_cast<int64>(Uint128Low64(value / kNanosPerSecond));
int32 nanos = static_cast<int32>(Uint128Low64(value % kNanosPerSecond));
if (negative) {
seconds = -seconds;
@@ -501,5 +505,4 @@ Duration operator-(const Timestamp& t1, const Timestamp& t2) {
t1.nanos() - t2.nanos());
}
} // namespace protobuf
-
} // namespace google