From 77a41bfb4f1ce5e3fa52412e72c69b4397011fc1 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Mon, 15 Jun 2009 16:49:04 +0200 Subject: export qBadAlloc only if exceptions are on --- src/corelib/global/qglobal.cpp | 2 ++ src/corelib/global/qglobal.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index e53fd2d..88f845a 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1929,6 +1929,7 @@ void qt_check_pointer(const char *n, int l) qWarning("In file %s, line %d: Out of memory", n, l); } +#ifndef QT_NO_EXCEPTIONS /* \internal Allows you to throw an exception without including Called internally from Q_CHECK_PTR on certain OS combinations @@ -1937,6 +1938,7 @@ void qBadAlloc() { QT_THROW(std::bad_alloc()); } +#endif /* The Q_ASSERT macro calls this function when the test fails. diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 825b7e8..361c038 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1605,7 +1605,10 @@ Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char * #endif Q_CORE_EXPORT void qt_check_pointer(const char *, int); + +#ifndef QT_NO_EXCEPTIONS Q_CORE_EXPORT void qBadAlloc(); +#endif #ifdef QT_NO_EXCEPTIONS # if defined(QT_NO_DEBUG) -- cgit v0.12