mirror of
https://github.com/boostorg/interprocess.git
synced 2026-01-19 04:12:13 +00:00
Added support for wide characters when creating named resources in operating systems with wide-char APIs (at this time, Windows).
Fixes #93 and fixes #134.
This commit is contained in:
@@ -21,6 +21,9 @@ using namespace boost::interprocess;
|
||||
|
||||
static const std::size_t ShmSize = 1000;
|
||||
static const char * ShmName = test::get_process_id_name();
|
||||
#ifdef BOOST_INTERPROCESS_WCHAR_NAMED_RESOURCES
|
||||
static const wchar_t * ShmNameW = test::get_process_id_wname();
|
||||
#endif
|
||||
|
||||
struct eraser
|
||||
{
|
||||
@@ -53,12 +56,37 @@ class shared_memory_creation_test_wrapper
|
||||
{}
|
||||
};
|
||||
|
||||
#ifdef BOOST_INTERPROCESS_WCHAR_NAMED_RESOURCES
|
||||
|
||||
class shared_memory_creation_test_wrapper_w
|
||||
: public eraser
|
||||
, public shared_memory
|
||||
{
|
||||
|
||||
public:
|
||||
shared_memory_creation_test_wrapper_w(create_only_t)
|
||||
: shared_memory(create_only, ShmNameW, ShmSize, read_write, 0, permissions())
|
||||
{}
|
||||
|
||||
shared_memory_creation_test_wrapper_w(open_only_t)
|
||||
: shared_memory(open_only, ShmNameW, read_write, 0)
|
||||
{}
|
||||
|
||||
shared_memory_creation_test_wrapper_w(open_or_create_t)
|
||||
: shared_memory(open_or_create, ShmNameW, ShmSize, read_write, 0, permissions())
|
||||
{}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
int main ()
|
||||
{
|
||||
try{
|
||||
shared_memory_object::remove(ShmName);
|
||||
test::test_named_creation<shared_memory_creation_test_wrapper>();
|
||||
#ifdef BOOST_INTERPROCESS_WCHAR_NAMED_RESOURCES
|
||||
test::test_named_creation<shared_memory_creation_test_wrapper_w>();
|
||||
#endif
|
||||
|
||||
//Create and get name, size and address
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user