Fix build error on iOS with the configure option -qtnamespace

qtbase/src/corelib/kernel/qsharedmemory_p.h:62:33: error:
    unknown type name 'QString'; did you mean 'XXXX::QString'?
    int createUnixKeyFile(const QString &fileName);
                                ^~~~~~~
                                XXXX::QString

Pick-to: 5.15 6.0 6.1
Change-Id: I455526503f059efc2f496b159b4cb098385dda00
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Lars Schmertmann 2020-05-15 12:51:31 +02:00
parent 6a91ad7b5b
commit d81a9206ac
2 changed files with 9 additions and 3 deletions

View File

@ -56,14 +56,20 @@
#include <QtCore/qstring.h>
#ifdef QT_NO_SHAREDMEMORY
# ifndef QT_NO_SYSTEMSEMAPHORE
# ifndef QT_NO_SYSTEMSEMAPHORE
QT_BEGIN_NAMESPACE
namespace QSharedMemoryPrivate
{
int createUnixKeyFile(const QString &fileName);
QString makePlatformSafeKey(const QString &key,
const QString &prefix = QLatin1String("qipc_sharedmemory_"));
}
#endif
QT_END_NAMESPACE
# endif
#else
#include "qsystemsemaphore.h"

View File

@ -109,7 +109,7 @@ key_t QSharedMemoryPrivate::handle()
0 already existed
1 created
*/
int QSharedMemoryPrivate::createUnixKeyFile(const QString &fileName)
int QT_PREPEND_NAMESPACE(QSharedMemoryPrivate)::createUnixKeyFile(const QString &fileName)
{
int fd = qt_safe_open(QFile::encodeName(fileName).constData(),
O_EXCL | O_CREAT | O_RDWR, 0640);