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:
@@ -20,14 +20,6 @@
|
||||
|
||||
using namespace boost::interprocess;
|
||||
|
||||
inline std::string get_filename()
|
||||
{
|
||||
std::string ret (ipcdetail::get_temporary_path());
|
||||
ret += "/";
|
||||
ret += test::get_process_id_name();
|
||||
return ret;
|
||||
}
|
||||
|
||||
file_mapping get_file_mapping()
|
||||
{
|
||||
file_mapping f;
|
||||
@@ -141,6 +133,27 @@ int main ()
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef BOOST_INTERPROCESS_WCHAR_NAMED_RESOURCES
|
||||
{
|
||||
//Create a file mapping
|
||||
file_mapping mapping(get_wfilename().c_str(), read_only);
|
||||
|
||||
//Create a single regions, mapping all the file
|
||||
mapped_region region (mapping
|
||||
,read_only
|
||||
);
|
||||
|
||||
//Check pattern
|
||||
unsigned char *pattern = static_cast<unsigned char*>(region.get_address());
|
||||
for(std::size_t i = 0
|
||||
;i < FileSize
|
||||
;++i, ++pattern){
|
||||
if(*pattern != static_cast<unsigned char>(i)){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif //BOOST_INTERPROCESS_WCHAR_NAMED_RESOURCES
|
||||
{
|
||||
//Now test move semantics
|
||||
file_mapping mapping(get_filename().c_str(), read_only);
|
||||
|
||||
Reference in New Issue
Block a user