build: Fix build when std::to_string is not available
This commit also adds a missing header include
Change-Id: I60857a488031f447c63308600052b1d2e9e3958b
Refs: #4393
diff --git a/src/util/random.cpp b/src/util/random.cpp
index 41775e4..f6722b9 100644
--- a/src/util/random.cpp
+++ b/src/util/random.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2017 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -48,7 +48,7 @@
{
if (RAND_bytes(bytes, size) != 1) {
BOOST_THROW_EXCEPTION(std::runtime_error("Failed to generate random bytes (error code " +
- std::to_string(ERR_get_error()) + ")"));
+ to_string(ERR_get_error()) + ")"));
}
}