mirror of
https://github.com/boostorg/interprocess.git
synced 2026-01-19 04:12:13 +00:00
Replace BOOST_TRY/CATCH family macros with BOOST_INTERPROCESS_TRY/CATCH
This commit is contained in:
@@ -43,7 +43,7 @@ int main ()
|
||||
const std::size_t FileSize = 1000;
|
||||
file_mapping::remove(FileName);
|
||||
|
||||
BOOST_TRY{
|
||||
BOOST_INTERPROCESS_TRY{
|
||||
MyList::size_type old_size = 0;
|
||||
managed_mapped_file::handle_t list_handle;
|
||||
{
|
||||
@@ -55,14 +55,14 @@ int main ()
|
||||
list_handle = mfile_memory.get_handle_from_address(mylist);
|
||||
|
||||
//Fill list until there is no more room in the file
|
||||
BOOST_TRY{
|
||||
BOOST_INTERPROCESS_TRY{
|
||||
while(1) {
|
||||
mylist->insert(mylist->begin(), 0);
|
||||
}
|
||||
}
|
||||
BOOST_CATCH(const bad_alloc &){
|
||||
BOOST_INTERPROCESS_CATCH(const bad_alloc &){
|
||||
//mapped file is full
|
||||
} BOOST_CATCH_END
|
||||
} BOOST_INTERPROCESS_CATCH_END
|
||||
//Let's obtain the size of the list
|
||||
old_size = mylist->size();
|
||||
}
|
||||
@@ -80,14 +80,14 @@ int main ()
|
||||
(mfile_memory.get_address_from_handle(list_handle));
|
||||
|
||||
//Fill list until there is no more room in the file
|
||||
BOOST_TRY{
|
||||
BOOST_INTERPROCESS_TRY{
|
||||
while(1) {
|
||||
mylist->insert(mylist->begin(), 0);
|
||||
}
|
||||
}
|
||||
BOOST_CATCH(const bad_alloc &){
|
||||
BOOST_INTERPROCESS_CATCH(const bad_alloc &){
|
||||
//mapped file is full
|
||||
} BOOST_CATCH_END
|
||||
} BOOST_INTERPROCESS_CATCH_END
|
||||
|
||||
//Let's obtain the new size of the list
|
||||
MyList::size_type new_size = mylist->size();
|
||||
@@ -98,10 +98,10 @@ int main ()
|
||||
return (new_size > old_size) ? 0 : 1;
|
||||
}
|
||||
}
|
||||
BOOST_CATCH(...){
|
||||
BOOST_INTERPROCESS_CATCH(...){
|
||||
file_mapping::remove(FileName);
|
||||
BOOST_RETHROW
|
||||
} BOOST_CATCH_END
|
||||
BOOST_INTERPROCESS_RETHROW
|
||||
} BOOST_INTERPROCESS_CATCH_END
|
||||
file_mapping::remove(FileName);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user