From fe5dd5d55aed169f36c5a0f263cd1fda1318e730 Mon Sep 17 00:00:00 2001 From: mehrdadn Date: Sun, 3 Jul 2016 07:08:23 +0300 Subject: [PATCH] Boost.Interprocess hack for Windows (#202) --- src/ipc.cc | 13 +++++++++++++ src/ipc.h | 17 +++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/ipc.cc b/src/ipc.cc index 22f941aea..a6b262a43 100644 --- a/src/ipc.cc +++ b/src/ipc.cc @@ -215,3 +215,16 @@ MemorySegmentPool::~MemorySegmentPool() { bip::shared_memory_object::remove(segment_name.c_str()); } } + +#if defined(WIN32) || defined(_WIN32) +namespace boost { + namespace interprocess { + namespace ipcdetail { + windows_bootstamp windows_intermodule_singleton::get() { + // HACK: Only do this for Windows as there seems to be no better workaround. Possibly undefined behavior! + return reinterpret_cast(std::string("BOOTSTAMP")); + } + } + } +} +#endif diff --git a/src/ipc.h b/src/ipc.h index 877c6e27c..c0d135860 100644 --- a/src/ipc.h +++ b/src/ipc.h @@ -4,6 +4,23 @@ #include #include +#if defined(WIN32) || defined(_WIN32) +namespace boost { + namespace interprocess { + namespace ipcdetail { + template + class windows_intermodule_singleton; + struct windows_bootstamp; + template<> + class windows_intermodule_singleton { + public: + static windows_bootstamp get(); + }; + } + } +} +#endif + #include #include