diff --git a/example/comp_doc_anonymous_conditionA.cpp b/example/comp_doc_anonymous_conditionA.cpp index 464c933..4fb56a3 100644 --- a/example/comp_doc_anonymous_conditionA.cpp +++ b/example/comp_doc_anonymous_conditionA.cpp @@ -37,7 +37,7 @@ int main () ,"MySharedMemory" //name ,read_write //read-write mode ); - BOOST_TRY{ + BOOST_INTERPROCESS_TRY{ //Set size shm.truncate(sizeof(trace_queue)); @@ -72,10 +72,11 @@ int main () data->message_in = true; } } - BOOST_CATCH(interprocess_exception &ex){ + BOOST_INTERPROCESS_CATCH(interprocess_exception &ex){ std::cout << ex.what() << std::endl; return 1; - } BOOST_CATCH_END + } + BOOST_INTERPROCESS_CATCH_END return 0; } diff --git a/example/comp_doc_anonymous_conditionB.cpp b/example/comp_doc_anonymous_conditionB.cpp index 9f93861..b061d2b 100644 --- a/example/comp_doc_anonymous_conditionB.cpp +++ b/example/comp_doc_anonymous_conditionB.cpp @@ -27,7 +27,7 @@ int main () ,read_write //read-write mode ); - BOOST_TRY{ + BOOST_INTERPROCESS_TRY{ //Map the whole shared memory in this process mapped_region region (shm //What to map @@ -60,10 +60,10 @@ int main () } while(!end_loop); } - BOOST_CATCH(interprocess_exception &ex){ + BOOST_INTERPROCESS_CATCH(interprocess_exception &ex){ std::cout << ex.what() << std::endl; return 1; - } BOOST_CATCH_END + } BOOST_INTERPROCESS_CATCH_END return 0; } diff --git a/example/comp_doc_anonymous_mutexA.cpp b/example/comp_doc_anonymous_mutexA.cpp index 7afb215..3518b4e 100644 --- a/example/comp_doc_anonymous_mutexA.cpp +++ b/example/comp_doc_anonymous_mutexA.cpp @@ -20,7 +20,7 @@ using namespace boost::interprocess; int main () { - BOOST_TRY{ + BOOST_INTERPROCESS_TRY{ //Remove shared memory on construction and destruction struct shm_remove { @@ -71,10 +71,10 @@ int main () break; } } - BOOST_CATCH(interprocess_exception &ex){ + BOOST_INTERPROCESS_CATCH(interprocess_exception &ex){ std::cout << ex.what() << std::endl; return 1; - } BOOST_CATCH_END + } BOOST_INTERPROCESS_CATCH_END return 0; } //] diff --git a/example/comp_doc_message_queueA.cpp b/example/comp_doc_message_queueA.cpp index 5cc2396..ec8ae43 100644 --- a/example/comp_doc_message_queueA.cpp +++ b/example/comp_doc_message_queueA.cpp @@ -17,7 +17,7 @@ using namespace boost::interprocess; int main () { - BOOST_TRY{ + BOOST_INTERPROCESS_TRY{ //Erase previous message queue message_queue::remove("message_queue"); @@ -34,10 +34,10 @@ int main () mq.send(&i, sizeof(i), 0); } } - BOOST_CATCH(interprocess_exception &ex){ + BOOST_INTERPROCESS_CATCH(interprocess_exception &ex){ std::cout << ex.what() << std::endl; return 1; - } BOOST_CATCH_END + } BOOST_INTERPROCESS_CATCH_END return 0; } diff --git a/example/comp_doc_message_queueB.cpp b/example/comp_doc_message_queueB.cpp index d893842..d3e6ebe 100644 --- a/example/comp_doc_message_queueB.cpp +++ b/example/comp_doc_message_queueB.cpp @@ -17,7 +17,7 @@ using namespace boost::interprocess; int main () { - BOOST_TRY{ + BOOST_INTERPROCESS_TRY{ //Open a message queue. message_queue mq (open_only //only open @@ -35,11 +35,11 @@ int main () return 1; } } - BOOST_CATCH(interprocess_exception &ex){ + BOOST_INTERPROCESS_CATCH(interprocess_exception &ex){ message_queue::remove("message_queue"); std::cout << ex.what() << std::endl; return 1; - } BOOST_CATCH_END + } BOOST_INTERPROCESS_CATCH_END message_queue::remove("message_queue"); return 0; } diff --git a/example/doc_anonymous_shared_memory.cpp b/example/doc_anonymous_shared_memory.cpp index 178a9be..ce4c97d 100644 --- a/example/doc_anonymous_shared_memory.cpp +++ b/example/doc_anonymous_shared_memory.cpp @@ -17,7 +17,7 @@ int main () { using namespace boost::interprocess; - BOOST_TRY{ + BOOST_INTERPROCESS_TRY{ //Create an anonymous shared memory segment with size 1000 mapped_region region(anonymous_shared_memory(1000)); @@ -26,10 +26,10 @@ int main () //The segment is unmapped when "region" goes out of scope } - BOOST_CATCH(interprocess_exception &ex){ + BOOST_INTERPROCESS_CATCH(interprocess_exception &ex){ std::cout << ex.what() << std::endl; return 1; - } BOOST_CATCH_END + } BOOST_INTERPROCESS_CATCH_END return 0; } //] diff --git a/example/doc_managed_heap_memory.cpp b/example/doc_managed_heap_memory.cpp index a0c090e..30c2f65 100644 --- a/example/doc_managed_heap_memory.cpp +++ b/example/doc_managed_heap_memory.cpp @@ -31,14 +31,14 @@ int main () managed_heap_memory::handle_t list_handle = heap_memory.get_handle_from_address(mylist); //Fill list until there is no more memory in the buffer - BOOST_TRY{ + BOOST_INTERPROCESS_TRY{ while(1) { mylist->insert(mylist->begin(), 0); } } - BOOST_CATCH(const bad_alloc &){ + BOOST_INTERPROCESS_CATCH(const bad_alloc &){ //memory is full - } BOOST_CATCH_END + } BOOST_INTERPROCESS_CATCH_END //Let's obtain the size of the list MyList::size_type old_size = mylist->size(); //<- @@ -55,14 +55,14 @@ int main () (heap_memory.get_address_from_handle(list_handle)); //Fill list until there is no more memory in the buffer - BOOST_TRY{ + BOOST_INTERPROCESS_TRY{ while(1) { mylist->insert(mylist->begin(), 0); } } - BOOST_CATCH(const bad_alloc &){ + BOOST_INTERPROCESS_CATCH(const bad_alloc &){ //memory 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(); diff --git a/example/doc_managed_mapped_file.cpp b/example/doc_managed_mapped_file.cpp index b3f68a1..963b7ae 100644 --- a/example/doc_managed_mapped_file.cpp +++ b/example/doc_managed_mapped_file.cpp @@ -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; } diff --git a/example/doc_named_mutex.cpp b/example/doc_named_mutex.cpp index dd98b2c..c118c25 100644 --- a/example/doc_named_mutex.cpp +++ b/example/doc_named_mutex.cpp @@ -22,7 +22,7 @@ int main () { using namespace boost::interprocess; - BOOST_TRY{ + BOOST_INTERPROCESS_TRY{ struct file_remove { //<- @@ -87,10 +87,10 @@ int main () file << std::endl; } } - BOOST_CATCH(interprocess_exception &ex){ + BOOST_INTERPROCESS_CATCH(interprocess_exception &ex){ std::cout << ex.what() << std::endl; return 1; - } BOOST_CATCH_END + } BOOST_INTERPROCESS_CATCH_END return 0; } //] diff --git a/example/doc_scoped_ptr.cpp b/example/doc_scoped_ptr.cpp index c2fc2b2..e178991 100644 --- a/example/doc_scoped_ptr.cpp +++ b/example/doc_scoped_ptr.cpp @@ -92,7 +92,7 @@ int main () //we destroy the object automatically my_deleter d(shmem.get_segment_manager()); - BOOST_TRY{ + BOOST_INTERPROCESS_TRY{ scoped_ptr > s_ptr(my_object, d); //Let's emulate a exception capable operation //In the second try, throw an exception @@ -104,7 +104,7 @@ int main () //to avoid destruction s_ptr.release(); } - BOOST_CATCH(const my_exception &){} BOOST_CATCH_END + BOOST_INTERPROCESS_CATCH(const my_exception &){} BOOST_INTERPROCESS_CATCH_END //Here, scoped_ptr is destroyed //so it we haven't thrown an exception //the object should be there, otherwise, destroyed diff --git a/example/doc_xsi_shared_memory.cpp b/example/doc_xsi_shared_memory.cpp index c25bed9..0f1638f 100644 --- a/example/doc_xsi_shared_memory.cpp +++ b/example/doc_xsi_shared_memory.cpp @@ -23,14 +23,14 @@ using namespace boost::interprocess; void remove_old_shared_memory(const xsi_key &key) { - BOOST_TRY{ + BOOST_INTERPROCESS_TRY{ xsi_shared_memory xsi(open_only, key); xsi_shared_memory::remove(xsi.get_shmid()); } - BOOST_CATCH(interprocess_exception &e){ + BOOST_INTERPROCESS_CATCH(interprocess_exception &e){ if(e.get_error_code() != not_found_error) - BOOST_RETHROW - } BOOST_CATCH_END + BOOST_INTERPROCESS_RETHROW + } BOOST_INTERPROCESS_CATCH_END } int main(int argc, char *argv[])