Make sure we export the non-inline qMalloc & friends functions
authorThiago Macieira <thiago.macieira@intel.com>
Thu, 3 May 2012 15:22:07 +0000 (17:22 +0200)
committerQt by Nokia <qt-info@nokia.com>
Sat, 5 May 2012 20:02:22 +0000 (22:02 +0200)
If QtCore is built with Qt 5.0 API, the Q_CORE_EXPORT does not appear
anywhere and these functions wouldn't get exported, despite being
defined. So make sure that they get the Q_CORE_EXPORT attribute.

Change-Id: I0684ea1b9ad634c13dca12c97683032e44f6a290
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
src/corelib/global/qmalloc.cpp

index a6d3b4f..4cd1b48 100644 (file)
 
 QT_BEGIN_NAMESPACE
 
+#if !QT_DEPRECATED_SINCE(5, 0)
+// Make sure they're defined to be exportedgit
+Q_CORE_EXPORT void *qMalloc(size_t size) Q_ALLOC_SIZE(1);
+Q_CORE_EXPORT void qFree(void *ptr);
+Q_CORE_EXPORT void *qRealloc(void *ptr, size_t size) Q_ALLOC_SIZE(2);
+Q_CORE_EXPORT void *qMemCopy(void *dest, const void *src, size_t n);
+Q_CORE_EXPORT void *qMemSet(void *dest, int c, size_t n);
+#endif
+
+
 void *qMalloc(size_t size)
 {
     return ::malloc(size);