# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
cmake_minimum_required(VERSION 2.6)
-set(BOOST_MIN_VERSION "1.41.0")
+set(BOOST_MIN_VERSION "1.48.0")
project(icinga2)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/replace.hpp>
+#include <boost/uuid/uuid_io.hpp>
#include <ios>
#include <fstream>
#include <iostream>
*/
String Utility::NewUniqueID(void)
{
- static boost::mutex mutex;
- static int next_id = 0;
-
- /* I'd much rather use UUIDs but RHEL is way too cool to have
- * a semi-recent version of boost. Yay. */
-
- String id;
-
- char buf[128];
- if (gethostname(buf, sizeof(buf)) == 0)
- id = String(buf) + "-";
-
- id += Convert::ToString((long)Utility::GetTime()) + "-";
-
- {
- boost::mutex::scoped_lock lock(mutex);
- id += Convert::ToString(next_id);
- next_id++;
- }
-
- return id;
+ boost::uuids::uuid u;
+ return boost::lexical_cast<std::string>(u);
}
#ifdef _WIN32