diff options
author | Harald Fernengel <harald@trolltech.com> | 2009-06-15 14:49:04 (GMT) |
---|---|---|
committer | Harald Fernengel <harald@trolltech.com> | 2009-06-15 14:49:04 (GMT) |
commit | 77a41bfb4f1ce5e3fa52412e72c69b4397011fc1 (patch) | |
tree | 091b58ac54d9779b0f11cd306635e635b98af4e9 /src | |
parent | 08ae7ee1fb930e7d4b4039e2294cba69f9380964 (diff) | |
download | Qt-77a41bfb4f1ce5e3fa52412e72c69b4397011fc1.zip Qt-77a41bfb4f1ce5e3fa52412e72c69b4397011fc1.tar.gz Qt-77a41bfb4f1ce5e3fa52412e72c69b4397011fc1.tar.bz2 |
export qBadAlloc only if exceptions are on
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qglobal.cpp | 2 | ||||
-rw-r--r-- | src/corelib/global/qglobal.h | 3 |
2 files changed, 5 insertions, 0 deletions
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 <new> 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) |