diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 101023db6b..ddb32ac5fb 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -64,7 +64,7 @@ qt_internal_add_module(Core global/qhooks.cpp global/qhooks_p.h global/qlibraryinfo.cpp global/qlibraryinfo.h global/qlibraryinfo_p.h global/qlogging.cpp global/qlogging.h global/qlogging_p.h - global/qmalloc.cpp + global/qmalloc.cpp global/qmalloc.h global/qminmax.h global/qnamespace.h # this header is specified on purpose so AUTOMOC processes it global/qnativeinterface.h global/qnativeinterface_p.h diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 01a4898132..42e8698965 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -136,10 +136,6 @@ typedef void (*QFunctionPointer)(); # define Q_UNIMPLEMENTED() qWarning("Unimplemented code.") #endif -Q_CORE_EXPORT void *qMallocAligned(size_t size, size_t alignment) Q_ALLOC_SIZE(1); -Q_CORE_EXPORT void *qReallocAligned(void *ptr, size_t size, size_t oldsize, size_t alignment) Q_ALLOC_SIZE(2); -Q_CORE_EXPORT void qFreeAligned(void *ptr); - // this adds const to non-const objects (like std::as_const) template @@ -174,6 +170,7 @@ QT_END_NAMESPACE #include #include #include +#include #include #include #include diff --git a/src/corelib/global/qmalloc.cpp b/src/corelib/global/qmalloc.cpp index be86aaf057..d413a35c6b 100644 --- a/src/corelib/global/qmalloc.cpp +++ b/src/corelib/global/qmalloc.cpp @@ -1,6 +1,7 @@ // Copyright (C) 2020 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +#include "qmalloc.h" #include "qplatformdefs.h" #include diff --git a/src/corelib/global/qmalloc.h b/src/corelib/global/qmalloc.h new file mode 100644 index 0000000000..c83aecd47c --- /dev/null +++ b/src/corelib/global/qmalloc.h @@ -0,0 +1,22 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QMALLOC_H +#define QMALLOC_H + +#include + +#if 0 +#pragma qt_class(QtMalloc) +#pragma qt_sync_stop_processing +#endif + +QT_BEGIN_NAMESPACE + +Q_CORE_EXPORT void *qMallocAligned(size_t size, size_t alignment) Q_ALLOC_SIZE(1); +Q_CORE_EXPORT void *qReallocAligned(void *ptr, size_t size, size_t oldsize, size_t alignment) Q_ALLOC_SIZE(2); +Q_CORE_EXPORT void qFreeAligned(void *ptr); + +QT_END_NAMESPACE + +#endif // QMALLOC_H