diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-10-20 12:52:09 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-20 16:10:53 +0200 |
commit | 0bc89aac4c64bb833e387657f680e194c26aef97 (patch) | |
tree | 7cf8313e66b7dbf221cb736636ab2c6074d0bfa9 /codemaker/source/cppumaker/includes.cxx | |
parent | eb37196aa773369555a36318e7aeaa2ed437d423 (diff) |
cppumaker: Allow UNO interface functions to throw std::exception
...so that exceptions like std::bad_alloc need not be treated in C++
implementations of UNO interfaces to not cause std::unexpected. Of course, this
requires implementations to be adapted and actually mention std::exception in
their exception specifications.
Change-Id: Ie7f91e7ca47d8a81e3d0ba817e65d83c7823af75
Diffstat (limited to 'codemaker/source/cppumaker/includes.cxx')
-rw-r--r-- | codemaker/source/cppumaker/includes.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/codemaker/source/cppumaker/includes.cxx b/codemaker/source/cppumaker/includes.cxx index c6516745a5d2..4c47c7e5be86 100644 --- a/codemaker/source/cppumaker/includes.cxx +++ b/codemaker/source/cppumaker/includes.cxx @@ -41,8 +41,8 @@ Includes::Includes( rtl::Reference< TypeManager > const & manager, codemaker::cppumaker::Dependencies const & dependencies, bool hpp): m_manager(manager), m_map(dependencies.getMap()), m_hpp(hpp), - m_includeCassert(false), m_includeAny(dependencies.hasAnyDependency()), - m_includeReference(false), + m_includeCassert(false), m_includeException(false), + m_includeAny(dependencies.hasAnyDependency()), m_includeReference(false), m_includeSequence(dependencies.hasSequenceDependency()), m_includeType(dependencies.hasTypeDependency()), m_includeCppuMacrosHxx(false), m_includeCppuUnotypeHxx(false), @@ -147,8 +147,14 @@ void Includes::dump(FileStream & out, OUString const * companionHdl) { } } out << "#include \"sal/config.h\"\n"; - if (m_includeCassert) { - out << "\n#include <cassert>\n"; + if (m_includeCassert || m_includeException) { + out << "\n"; + if (m_includeCassert) { + out << "#include <cassert>\n"; + } + if (m_includeException) { + out << "#include <exception>\n"; + } } if (companionHdl) { out << "\n"; |