Boost.Interprocess hack for Windows (#202)

This commit is contained in:
mehrdadn
2016-07-03 07:08:23 +03:00
committed by Philipp Moritz
parent 84321d3f75
commit fe5dd5d55a
2 changed files with 30 additions and 0 deletions
+13
View File
@@ -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<windows_bootstamp>::get() {
// HACK: Only do this for Windows as there seems to be no better workaround. Possibly undefined behavior!
return reinterpret_cast<windows_bootstamp const &>(std::string("BOOTSTAMP"));
}
}
}
}
#endif
+17
View File
@@ -4,6 +4,23 @@
#include <iostream>
#include <limits>
#if defined(WIN32) || defined(_WIN32)
namespace boost {
namespace interprocess {
namespace ipcdetail {
template<typename C, bool LazyInit = true, bool Phoenix = false>
class windows_intermodule_singleton;
struct windows_bootstamp;
template<>
class windows_intermodule_singleton<windows_bootstamp> {
public:
static windows_bootstamp get();
};
}
}
}
#endif
#include <boost/interprocess/managed_shared_memory.hpp>
#include <arrow/api.h>