diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/lib/common/sys/apr/APRBase.cpp | 10 | ||||
-rw-r--r-- | cpp/lib/common/sys/apr/APRBase.h | 12 |
2 files changed, 12 insertions, 10 deletions
diff --git a/cpp/lib/common/sys/apr/APRBase.cpp b/cpp/lib/common/sys/apr/APRBase.cpp index 30c84e8736..861071499f 100644 --- a/cpp/lib/common/sys/apr/APRBase.cpp +++ b/cpp/lib/common/sys/apr/APRBase.cpp @@ -82,16 +82,6 @@ void APRBase::decrement(){ getInstance()->_decrement(); } -void qpid::sys::check(apr_status_t status, const char* file, const int line){ - if (status != APR_SUCCESS){ - const int size = 50; - char tmp[size]; - std::string msg(apr_strerror(status, tmp, size)); - throw QpidError(APR_ERROR + ((int) status), msg, - qpid::SrcLine(file, line)); - } -} - std::string qpid::sys::get_desc(apr_status_t status){ const int size = 50; char tmp[size]; diff --git a/cpp/lib/common/sys/apr/APRBase.h b/cpp/lib/common/sys/apr/APRBase.h index 9beba9fbad..6a866a554a 100644 --- a/cpp/lib/common/sys/apr/APRBase.h +++ b/cpp/lib/common/sys/apr/APRBase.h @@ -24,6 +24,7 @@ #include <string> #include <apr_thread_mutex.h> #include <apr_errno.h> +#include <QpidError.h> namespace qpid { namespace sys { @@ -60,6 +61,17 @@ namespace sys { } } +// Inlined as it is called *a lot* +void inline qpid::sys::check(apr_status_t status, const char* file, const int line){ + if (status != APR_SUCCESS){ + const int size = 50; + char tmp[size]; + std::string msg(apr_strerror(status, tmp, size)); + throw qpid::QpidError(APR_ERROR + ((int) status), msg, + qpid::SrcLine(file, line)); + } +} + |