From 26c92da8dca1ce12df9d0f3cf7994290a736f1a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Tue, 27 May 2008 17:05:22 +0000 Subject: [PATCH] Ticket #1921: interprocess shared_memory example needs patch (provided) [SVN r45816] --- example/doc_file_mapping.cpp | 1 - example/doc_message_queueA.cpp | 2 -- example/doc_shared_memory.cpp | 1 - example/doc_shared_memory2.cpp | 3 ++- include/boost/interprocess/detail/math_functions.hpp | 2 ++ 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/example/doc_file_mapping.cpp b/example/doc_file_mapping.cpp index 24d20ac..568f577 100644 --- a/example/doc_file_mapping.cpp +++ b/example/doc_file_mapping.cpp @@ -56,7 +56,6 @@ int main () std::cout << ex.what() << std::endl; return 1; } - std::remove("file.bin"); return 0; } //] diff --git a/example/doc_message_queueA.cpp b/example/doc_message_queueA.cpp index 784ff24..04c1838 100644 --- a/example/doc_message_queueA.cpp +++ b/example/doc_message_queueA.cpp @@ -35,11 +35,9 @@ int main () } } catch(interprocess_exception &ex){ - message_queue::remove("message_queue"); std::cout << ex.what() << std::endl; return 1; } - message_queue::remove("message_queue"); return 0; } diff --git a/example/doc_shared_memory.cpp b/example/doc_shared_memory.cpp index 4764c9f..3b5b7bc 100644 --- a/example/doc_shared_memory.cpp +++ b/example/doc_shared_memory.cpp @@ -38,7 +38,6 @@ int main () std::cout << ex.what() << std::endl; return 1; } - shared_memory_object::remove("shared_memory"); return 0; } //] diff --git a/example/doc_shared_memory2.cpp b/example/doc_shared_memory2.cpp index a8999bb..ad7b8ec 100644 --- a/example/doc_shared_memory2.cpp +++ b/example/doc_shared_memory2.cpp @@ -33,12 +33,13 @@ int main () } } std::cout << "Test successful!" << std::endl; + shared_memory_object::remove("shared_memory"); } catch(interprocess_exception &ex){ std::cout << "Unexpected exception: " << ex.what() << std::endl; + shared_memory_object::remove("shared_memory"); return 1; } - return 0; } //] diff --git a/include/boost/interprocess/detail/math_functions.hpp b/include/boost/interprocess/detail/math_functions.hpp index 3dba900..8b80aa2 100644 --- a/include/boost/interprocess/detail/math_functions.hpp +++ b/include/boost/interprocess/detail/math_functions.hpp @@ -16,6 +16,8 @@ #ifndef BOOST_INTERPROCESS_DETAIL_MATH_FUNCTIONS_HPP #define BOOST_INTERPROCESS_DETAIL_MATH_FUNCTIONS_HPP +#include + namespace boost { namespace interprocess { namespace detail {