use /permissive- with msvc to get alternative operator representation

(reverts 2d4258a3)
This commit is contained in:
Juergen E. Fischer 2023-11-09 18:24:25 +01:00
parent 5486c4152c
commit 01c6335fba
3 changed files with 12 additions and 12 deletions

View File

@ -751,8 +751,8 @@ endif()
set (AGGRESSIVE_SAFE_MODE FALSE CACHE BOOL "Forces a aggressive safe mode where issues like unsafe thread access will resort in fatal exceptions")
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8 /std:c++17")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /utf-8 /std:c++17")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8 /std:c++17 /permissive-")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /utf-8 /std:c++17 /permissive-")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
# disable macros that offend std::numeric_limits<T>::min()/max()

View File

@ -26,7 +26,7 @@
#include <QTimer>
#include <QDateTime>
#if !defined(Q_OS_ANDROID)
#if not defined( Q_OS_ANDROID )
#include <QSharedMemory>
#endif
@ -82,7 +82,7 @@ QString QgsCacheDirectoryManager::getCacheDirectory( bool createIfNotExisting )
QgsDebugMsgLevel( QStringLiteral( "Creating our cache dir %1/%2" ).arg( baseDirectory, processPath ), 2 );
QDir( baseDirectory ).mkpath( processPath );
}
#if !defined(Q_OS_ANDROID)
#if not defined( Q_OS_ANDROID )
if ( mCounter == 0 && mKeepAliveWorks )
{
mThread = new QgsCacheDirectoryManagerKeepAlive( createAndAttachSHM() );
@ -159,7 +159,7 @@ bool QgsCacheDirectoryManager::removeDir( const QString &dirName )
return dir.rmdir( dirName );
}
#if !defined(Q_OS_ANDROID)
#if not defined( Q_OS_ANDROID )
std::unique_ptr<QSharedMemory> QgsCacheDirectoryManager::createAndAttachSHM()
{
std::unique_ptr<QSharedMemory> sharedMemory;
@ -189,7 +189,7 @@ std::unique_ptr<QSharedMemory> QgsCacheDirectoryManager::createAndAttachSHM()
void QgsCacheDirectoryManager::init()
{
#if !defined(Q_OS_ANDROID)
#if not defined( Q_OS_ANDROID )
auto sharedMemory = createAndAttachSHM();
mKeepAliveWorks = sharedMemory.get() != nullptr;
sharedMemory.reset();
@ -225,7 +225,7 @@ void QgsCacheDirectoryManager::init()
{
canDelete = true;
}
#if !defined(Q_OS_ANDROID)
#if not defined( Q_OS_ANDROID )
else if ( mKeepAliveWorks )
{
canDelete = true;
@ -290,7 +290,7 @@ void QgsCacheDirectoryManager::init()
// -------------------------
#if !defined(Q_OS_ANDROID)
#if not defined( Q_OS_ANDROID )
// We use a keep alive mechanism where every KEEP_ALIVE_DELAY ms we update
// a shared memory segment with the current timestamp. This way, other QGIS
// processes can check if the temporary directories of other process correspond

View File

@ -1,5 +1,5 @@
/***************************************************************************
qgsbackgroundcachedshareddata.h
qgsbacckgroundcachedshareddata.h
---------------------
begin : October 2019
copyright : (C) 2016-2019 by Even Rouault
@ -20,7 +20,7 @@
#include <QThread>
#include <QMutex>
#if !defined(Q_OS_ANDROID)
#if not defined( Q_OS_ANDROID )
#include <QSharedMemory>
#endif
@ -59,7 +59,7 @@ class QgsCacheDirectoryManager
//! Called by constructor
void init();
#if !defined(Q_OS_ANDROID)
#if not defined( Q_OS_ANDROID )
//! Create a shared memory segment for the keep-alive mechanism
std::unique_ptr<QSharedMemory> createAndAttachSHM();
#endif
@ -73,7 +73,7 @@ class QgsCacheDirectoryManager
static bool removeDir( const QString &dirName );
};
#if !defined(Q_OS_ANDROID)
#if not defined( Q_OS_ANDROID )
//! For internal use of QgsCacheDirectoryManager
class QgsCacheDirectoryManagerKeepAlive: public QThread
{