summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorAlexander Golubev <[email protected]>2024-03-12 01:19:14 +0300
committerAlexander Golubev <[email protected]>2024-03-14 00:11:47 +0300
commitf7642b09c9e61f71e434aeb0ceb330d2ccaa25db (patch)
tree24caf3ca34bc91f4c3ea20b8fc436fdd71c44925 /src/tools
parentfa4475f36d6404a70d760ca95ac6a986a8846a3f (diff)
downloadtqt3-f7642b09c9e61f71e434aeb0ceb330d2ccaa25db.tar.gz
tqt3-f7642b09c9e61f71e434aeb0ceb330d2ccaa25db.zip
TQT_THREAD_SUPPORT->!TQT_NO_THREAD: migrate sources
Signed-off-by: Alexander Golubev <[email protected]>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/ntqglist.h2
-rw-r--r--src/tools/ntqmutex.h2
-rw-r--r--src/tools/ntqsemaphore.h2
-rw-r--r--src/tools/ntqthreadstorage.h4
-rw-r--r--src/tools/ntqwaitcondition.h2
-rw-r--r--src/tools/qcom_p.h2
-rw-r--r--src/tools/qcomlibrary.cpp10
-rw-r--r--src/tools/qcriticalsection_p.cpp2
-rw-r--r--src/tools/qcriticalsection_p.h2
-rw-r--r--src/tools/qcstring.cpp8
-rw-r--r--src/tools/qdatetime.cpp10
-rw-r--r--src/tools/qdir_unix.cpp12
-rw-r--r--src/tools/qgarray.cpp12
-rw-r--r--src/tools/qglist.cpp182
-rw-r--r--src/tools/qgvector.cpp8
-rw-r--r--src/tools/qlocale.cpp2
-rw-r--r--src/tools/qmutex_unix.cpp4
-rw-r--r--src/tools/qmutexpool.cpp2
-rw-r--r--src/tools/qmutexpool_p.h4
-rw-r--r--src/tools/qregexp.cpp20
-rw-r--r--src/tools/qsemaphore.cpp4
-rw-r--r--src/tools/qstring.cpp128
-rw-r--r--src/tools/qthreadinstance_p.h4
-rw-r--r--src/tools/qthreadstorage_unix.cpp4
-rw-r--r--src/tools/qwaitcondition_unix.cpp4
25 files changed, 217 insertions, 219 deletions
diff --git a/src/tools/ntqglist.h b/src/tools/ntqglist.h
index 247c4f68f..da5370c94 100644
--- a/src/tools/ntqglist.h
+++ b/src/tools/ntqglist.h
@@ -150,7 +150,7 @@ private:
TQLNode *locate( uint ); // get node at i'th pos
TQLNode *unlink(); // unlink node
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
// TQMutex* mutex;
#endif
diff --git a/src/tools/ntqmutex.h b/src/tools/ntqmutex.h
index c517c6355..bb0088f0f 100644
--- a/src/tools/ntqmutex.h
+++ b/src/tools/ntqmutex.h
@@ -45,7 +45,7 @@
#include "ntqglobal.h"
#endif // QT_H
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
class TQMutexPrivate;
diff --git a/src/tools/ntqsemaphore.h b/src/tools/ntqsemaphore.h
index 0dc8e81de..8fc5855db 100644
--- a/src/tools/ntqsemaphore.h
+++ b/src/tools/ntqsemaphore.h
@@ -45,7 +45,7 @@
#include "ntqglobal.h"
#endif // QT_H
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
class TQSemaphorePrivate;
diff --git a/src/tools/ntqthreadstorage.h b/src/tools/ntqthreadstorage.h
index b9e0e11bb..0b6db5105 100644
--- a/src/tools/ntqthreadstorage.h
+++ b/src/tools/ntqthreadstorage.h
@@ -43,7 +43,7 @@
#include "ntqglobal.h"
#endif // QT_H
-#ifdef TQT_THREAD_SUPPORT
+#ifndef TQT_NO_THREAD
class TQ_EXPORT TQThreadStorageData
{
@@ -90,6 +90,6 @@ public:
{ (void) d.set( t ); }
};
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD
#endif // TQTHREADSTORAGE_H
diff --git a/src/tools/ntqwaitcondition.h b/src/tools/ntqwaitcondition.h
index 503d5d6c9..9ef884140 100644
--- a/src/tools/ntqwaitcondition.h
+++ b/src/tools/ntqwaitcondition.h
@@ -45,7 +45,7 @@
#include "ntqglobal.h"
#endif // QT_H
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
#include <limits.h>
diff --git a/src/tools/qcom_p.h b/src/tools/qcom_p.h
index e11d63f27..5df9a665a 100644
--- a/src/tools/qcom_p.h
+++ b/src/tools/qcom_p.h
@@ -273,7 +273,7 @@ public: \
ulong release() {if(!--qtrefcount){delete this;return 0;}return qtrefcount;}
#ifndef Q_EXPORT_COMPONENT
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
#define QT_THREADED_BUILD 1
#define Q_UCM_FLAGS_STRING "11"
#else
diff --git a/src/tools/qcomlibrary.cpp b/src/tools/qcomlibrary.cpp
index 20366db9a..40684f9ff 100644
--- a/src/tools/qcomlibrary.cpp
+++ b/src/tools/qcomlibrary.cpp
@@ -48,9 +48,9 @@
#include <errno.h>
#endif // NO_ERROR_H
-#ifdef TQT_THREAD_SUPPORT
+#ifndef TQT_NO_THREAD
# include "qmutexpool_p.h"
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD
#ifndef QT_DEBUG_COMPONENT
# if defined(QT_DEBUG)
@@ -94,7 +94,7 @@ static bool qt_verify( const TQString& library, uint version, uint flags,
const TQCString &key, bool warn )
{
uint our_flags = 1;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
our_flags |= 2;
#endif
@@ -398,10 +398,10 @@ void TQComLibrary::createInstanceInternal()
bool query_done = FALSE;
bool warn_mismatch = TRUE;
-#ifdef TQT_THREAD_SUPPORT
+#ifndef TQT_NO_THREAD
TQMutexLocker locker( tqt_global_mutexpool ?
tqt_global_mutexpool->get( &cache ) : 0 );
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD
if ( ! cache ) {
cache = new TQSettings;
diff --git a/src/tools/qcriticalsection_p.cpp b/src/tools/qcriticalsection_p.cpp
index 534960952..c8609562d 100644
--- a/src/tools/qcriticalsection_p.cpp
+++ b/src/tools/qcriticalsection_p.cpp
@@ -38,7 +38,7 @@
#include "ntqglobal.h"
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
#include "qt_windows.h"
diff --git a/src/tools/qcriticalsection_p.h b/src/tools/qcriticalsection_p.h
index 0c362bc71..3f1baef60 100644
--- a/src/tools/qcriticalsection_p.h
+++ b/src/tools/qcriticalsection_p.h
@@ -56,7 +56,7 @@
#include "ntqglobal.h"
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
#if defined(TQ_WS_WIN)
diff --git a/src/tools/qcstring.cpp b/src/tools/qcstring.cpp
index 83e351a23..4cab00095 100644
--- a/src/tools/qcstring.cpp
+++ b/src/tools/qcstring.cpp
@@ -43,9 +43,9 @@
#include "ntqregexp.h"
#include "ntqdatastream.h"
-#ifdef TQT_THREAD_SUPPORT
+#ifndef TQT_NO_THREAD
# include <private/qmutexpool_p.h>
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD
#include <stdio.h>
#include <stdarg.h>
@@ -312,10 +312,10 @@ TQ_UINT16 tqChecksum( const char *data, uint len )
{
if ( !crc_tbl_init ) { // create lookup table
-#ifdef TQT_THREAD_SUPPORT
+#ifndef TQT_NO_THREAD
TQMutexLocker locker( tqt_global_mutexpool ?
tqt_global_mutexpool->get( &crc_tbl_init ) : 0 );
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD
if ( !crc_tbl_init ) {
createCRC16Table();
diff --git a/src/tools/qdatetime.cpp b/src/tools/qdatetime.cpp
index 51f0e51de..dbb1e390f 100644
--- a/src/tools/qdatetime.cpp
+++ b/src/tools/qdatetime.cpp
@@ -1039,7 +1039,7 @@ TQDate TQDate::currentDate( TQt::TimeSpec ts )
time( &ltime );
tm *t;
-# if defined(TQT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
+# if !defined(TQT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
// use the reentrant versions of localtime() and gmtime() where available
tm res;
if ( ts == TQt::LocalTime )
@@ -1051,7 +1051,7 @@ TQDate TQDate::currentDate( TQt::TimeSpec ts )
t = localtime( &ltime );
else
t = gmtime( &ltime );
-# endif // TQT_THREAD_SUPPORT && _POSIX_THREAD_SAFE_FUNCTIONS
+# endif // !TQT_NO_THREAD && _POSIX_THREAD_SAFE_FUNCTIONS
d.jd = gregorianToJulian( t->tm_year + 1900, t->tm_mon + 1, t->tm_mday );
#endif
@@ -1729,7 +1729,7 @@ bool TQTime::currentTime( TQTime *ct, TQt::TimeSpec ts )
time_t ltime = tv.tv_sec;
tm *t;
-# if defined(TQT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
+# if !defined(TQT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
// use the reentrant versions of localtime() and gmtime() where available
tm res;
if ( ts == TQt::LocalTime )
@@ -1741,7 +1741,7 @@ bool TQTime::currentTime( TQTime *ct, TQt::TimeSpec ts )
t = localtime( &ltime );
else
t = gmtime( &ltime );
-# endif // TQT_THREAD_SUPPORT && _POSIX_THREAD_SAFE_FUNCTIONS
+# endif // !TQT_NO_THREAD && _POSIX_THREAD_SAFE_FUNCTIONS
ct->ds = (uint)( MSECS_PER_HOUR * t->tm_hour + MSECS_PER_MIN * t->tm_min +
1000 * t->tm_sec + tv.tv_usec / 1000 );
@@ -2042,7 +2042,7 @@ void TQDateTime::setTime_t( time_t secsSince1Jan1970UTC, TQt::TimeSpec ts )
time_t tmp = secsSince1Jan1970UTC;
tm *brokenDown = 0;
-#if defined(Q_OS_UNIX) && defined(TQT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
+#if defined(Q_OS_UNIX) && !defined(TQT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
// posix compliant system
// use the reentrant versions of localtime() and gmtime() where available
tm res;
diff --git a/src/tools/qdir_unix.cpp b/src/tools/qdir_unix.cpp
index dcf01a861..6d94e57e5 100644
--- a/src/tools/qdir_unix.cpp
+++ b/src/tools/qdir_unix.cpp
@@ -48,9 +48,9 @@
#include "ntqregexp.h"
#include "ntqstringlist.h"
-#ifdef TQT_THREAD_SUPPORT
+#ifndef TQT_NO_THREAD
# include <private/qmutexpool_p.h>
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD
#include <stdlib.h>
#include <limits.h>
@@ -238,7 +238,7 @@ bool TQDir::readDirEntries( const TQString &nameFilter,
if ( !dir )
return FALSE; // cannot read the directory
-#if defined(TQT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
+#if !defined(TQT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
union {
struct dirent mt_file;
char b[sizeof(struct dirent) + MAXNAMLEN + 1];
@@ -246,7 +246,7 @@ bool TQDir::readDirEntries( const TQString &nameFilter,
while ( readdir_r(dir, &u.mt_file, &file ) == 0 && file )
#else
while ( (file = readdir(dir)) )
-#endif // TQT_THREAD_SUPPORT && _POSIX_THREAD_SAFE_FUNCTIONS
+#endif // !TQT_NO_THREAD && _POSIX_THREAD_SAFE_FUNCTIONS
{
TQString fn = TQFile::decodeName(file->d_name);
fi.setFile( *this, fn );
@@ -312,10 +312,10 @@ const TQFileInfoList * TQDir::drives()
if ( !knownMemoryLeak ) {
-#ifdef TQT_THREAD_SUPPORT
+#ifndef TQT_NO_THREAD
TQMutexLocker locker( tqt_global_mutexpool ?
tqt_global_mutexpool->get( &knownMemoryLeak ) : 0 );
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD
if ( !knownMemoryLeak ) {
knownMemoryLeak = new TQFileInfoList;
diff --git a/src/tools/qgarray.cpp b/src/tools/qgarray.cpp
index ff1f7b08b..7a741b308 100644
--- a/src/tools/qgarray.cpp
+++ b/src/tools/qgarray.cpp
@@ -52,9 +52,9 @@
#include <stdlib.h>
#include <string.h>
-#ifdef TQT_THREAD_SUPPORT
+#ifndef TQT_NO_THREAD
# include <private/qmutexpool_p.h>
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD
/*
If USE_MALLOC isn't defined, we use new[] and delete[] to allocate
@@ -733,10 +733,10 @@ void TQGArray::sort( uint sz )
if ( numItems < 2 )
return;
-#ifdef TQT_THREAD_SUPPORT
+#ifndef TQT_NO_THREAD
TQMutexLocker locker( tqt_global_mutexpool ?
tqt_global_mutexpool->get( &cmp_item_size ) : 0 );
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD
cmp_item_size = sz;
qsort( shd->data, numItems, sz, cmp_arr );
@@ -752,10 +752,10 @@ int TQGArray::bsearch( const char *d, uint sz ) const
if ( !numItems )
return -1;
-#ifdef TQT_THREAD_SUPPORT
+#ifndef TQT_NO_THREAD
TQMutexLocker locker( tqt_global_mutexpool ?
tqt_global_mutexpool->get( &cmp_item_size ) : 0 );
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD
cmp_item_size = sz;
char* r = (char*)::bsearch( d, shd->data, numItems, sz, cmp_arr );
diff --git a/src/tools/qglist.cpp b/src/tools/qglist.cpp
index 9dbe81d92..b28808c62 100644
--- a/src/tools/qglist.cpp
+++ b/src/tools/qglist.cpp
@@ -43,9 +43,7 @@
#include "ntqdatastream.h"
#include "ntqvaluelist.h"
-#if defined(TQT_THREAD_SUPPORT)
- #include "ntqmutex.h"
-#endif // defined(TQT_THREAD_SUPPORT)
+#include "ntqmutex.h"
/*!
\class TQLNode ntqglist.h
@@ -225,7 +223,7 @@ TQDataStream &TQGList::write( TQDataStream &s, TQPtrCollection::Item ) const
TQGList::TQGList()
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex = new TQMutex(true);
#endif
firstNode = lastNode = curNode = 0; // initialize list
@@ -241,7 +239,7 @@ TQGList::TQGList()
TQGList::TQGList( const TQGList & list )
: TQPtrCollection( list )
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex = new TQMutex(true);
#endif
firstNode = lastNode = curNode = 0; // initialize list
@@ -268,7 +266,7 @@ TQGList::~TQGList()
// twice on the same address! This is insane but let's try not to crash
// here.
iterators = 0;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//delete mutex;
#endif
}
@@ -337,11 +335,11 @@ bool TQGList::operator==( const TQGList &list ) const
TQLNode *TQGList::locate( uint index )
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( index == (uint)curIndex ) { // current node ?
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return curNode;
@@ -355,7 +353,7 @@ TQLNode *TQGList::locate( uint index )
bool forward; // direction to traverse
if ( index >= numNodes ) {
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return 0;
@@ -388,7 +386,7 @@ TQLNode *TQGList::locate( uint index )
}
}
curIndex = index; // must update index
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return curNode = node;
@@ -401,7 +399,7 @@ TQLNode *TQGList::locate( uint index )
void TQGList::inSort( TQPtrCollection::Item d )
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
int index = 0;
@@ -411,7 +409,7 @@ void TQGList::inSort( TQPtrCollection::Item d )
index++;
}
insertAt( index, d );
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
}
@@ -423,7 +421,7 @@ void TQGList::inSort( TQPtrCollection::Item d )
void TQGList::prepend( TQPtrCollection::Item d )
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode *n = new TQLNode( newItem(d) );
@@ -436,7 +434,7 @@ void TQGList::prepend( TQPtrCollection::Item d )
firstNode = curNode = n; // curNode affected
numNodes++;
curIndex = 0;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
}
@@ -448,7 +446,7 @@ void TQGList::prepend( TQPtrCollection::Item d )
void TQGList::append( TQPtrCollection::Item d )
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode *n = new TQLNode( newItem(d) );
@@ -463,7 +461,7 @@ void TQGList::append( TQPtrCollection::Item d )
lastNode = curNode = n; // curNode affected
curIndex = numNodes;
numNodes++;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
}
@@ -475,26 +473,26 @@ void TQGList::append( TQPtrCollection::Item d )
bool TQGList::insertAt( uint index, TQPtrCollection::Item d )
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( index == 0 ) {
prepend( d );
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return TRUE;
}
else if ( index == numNodes ) {
append( d );
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return TRUE;
}
TQLNode *nextNode = locate( index );
if ( !nextNode ) {
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return FALSE;
@@ -509,7 +507,7 @@ bool TQGList::insertAt( uint index, TQPtrCollection::Item d )
n->next = nextNode;
curNode = n; // curIndex set by locate()
numNodes++;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return TRUE;
@@ -522,11 +520,11 @@ bool TQGList::insertAt( uint index, TQPtrCollection::Item d )
void TQGList::relinkNode( TQLNode *n )
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( n == firstNode ) { // already first
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return;
@@ -543,7 +541,7 @@ void TQGList::relinkNode( TQLNode *n )
firstNode = curNode = n; // curNode affected
numNodes++;
curIndex = 0;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
}
@@ -555,11 +553,11 @@ void TQGList::relinkNode( TQLNode *n )
TQLNode *TQGList::unlink()
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( curNode == 0 ) { // null current node
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return 0;
@@ -593,7 +591,7 @@ TQLNode *TQGList::unlink()
iterators->notifyRemove( n, curNode );
}
numNodes--;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return n;
@@ -606,7 +604,7 @@ TQLNode *TQGList::unlink()
bool TQGList::removeNode( TQLNode *n )
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
#if defined(QT_CHECK_NULL)
@@ -622,7 +620,7 @@ bool TQGList::removeNode( TQLNode *n )
delete n;
curNode = firstNode;
curIndex = curNode ? 0 : -1;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return TRUE;
@@ -636,25 +634,25 @@ bool TQGList::removeNode( TQLNode *n )
bool TQGList::remove( TQPtrCollection::Item d )
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( d && find(d) == -1 ) {
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return FALSE;
}
TQLNode *n = unlink();
if ( !n ) {
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return FALSE;
}
deleteItem( n->data );
delete n;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return TRUE;
@@ -666,25 +664,25 @@ bool TQGList::remove( TQPtrCollection::Item d )
bool TQGList::removeRef( TQPtrCollection::Item d )
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( findRef(d) == -1 ) {
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return FALSE;
}
TQLNode *n = unlink();
if ( !n ) {
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return FALSE;
}
deleteItem( n->data );
delete n;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return TRUE;
@@ -708,25 +706,25 @@ bool TQGList::removeRef( TQPtrCollection::Item d )
bool TQGList::removeAt( uint index )
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( !locate(index) ) {
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return FALSE;
}
TQLNode *n = unlink();
if ( !n ) {
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return FALSE;
}
deleteItem( n->data );
delete n;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return TRUE;
@@ -738,12 +736,12 @@ bool TQGList::removeAt( uint index )
*/
bool TQGList::replaceAt( uint index, TQPtrCollection::Item d )
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode *n = locate( index );
if ( !n ) {
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return FALSE;
@@ -752,7 +750,7 @@ bool TQGList::replaceAt( uint index, TQPtrCollection::Item d )
deleteItem( n->data );
n->data = newItem( d );
}
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return TRUE;
@@ -766,14 +764,14 @@ bool TQGList::replaceAt( uint index, TQPtrCollection::Item d )
TQPtrCollection::Item TQGList::takeNode( TQLNode *n )
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
#if defined(QT_CHECK_NULL)
if ( n == 0 || (n->prev && n->prev->next != n) ||
(n->next && n->next->prev != n) ) {
tqWarning( "TQGList::takeNode: Corrupted node" );
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return 0;
@@ -785,7 +783,7 @@ TQPtrCollection::Item TQGList::takeNode( TQLNode *n )
delete n; // delete the node, not data
curNode = firstNode;
curIndex = curNode ? 0 : -1;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return d;
@@ -797,13 +795,13 @@ TQPtrCollection::Item TQGList::takeNode( TQLNode *n )
TQPtrCollection::Item TQGList::take()
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode *n = unlink(); // unlink node
Item d = n ? n->data : 0;
delete n; // delete node, keep contents
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return d;
@@ -815,11 +813,11 @@ TQPtrCollection::Item TQGList::take()
TQPtrCollection::Item TQGList::takeAt( uint index )
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( !locate(index) ) {
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return 0;
@@ -827,7 +825,7 @@ TQPtrCollection::Item TQGList::takeAt( uint index )
TQLNode *n = unlink(); // unlink node
Item d = n ? n->data : 0;
delete n; // delete node, keep contents
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return d;
@@ -839,14 +837,14 @@ TQPtrCollection::Item TQGList::takeAt( uint index )
TQPtrCollection::Item TQGList::takeFirst()
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
first();
TQLNode *n = unlink(); // unlink node
Item d = n ? n->data : 0;
delete n;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return d;
@@ -858,14 +856,14 @@ TQPtrCollection::Item TQGList::takeFirst()
TQPtrCollection::Item TQGList::takeLast()
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
last();
TQLNode *n = unlink(); // unlink node
Item d = n ? n->data : 0;
delete n;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return d;
@@ -878,7 +876,7 @@ TQPtrCollection::Item TQGList::takeLast()
void TQGList::clear()
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode *n = firstNode;
@@ -898,7 +896,7 @@ void TQGList::clear()
n = n->next;
delete prevNode; // deallocate node
}
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
}
@@ -911,7 +909,7 @@ void TQGList::clear()
int TQGList::findRef( TQPtrCollection::Item d, bool fromStart )
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode *n;
@@ -929,7 +927,7 @@ int TQGList::findRef( TQPtrCollection::Item d, bool fromStart )
}
curNode = n;
curIndex = n ? index : -1;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return curIndex; // return position of item
@@ -943,7 +941,7 @@ int TQGList::findRef( TQPtrCollection::Item d, bool fromStart )
int TQGList::find( TQPtrCollection::Item d, bool fromStart )
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode *n;
@@ -961,7 +959,7 @@ int TQGList::find( TQPtrCollection::Item d, bool fromStart )
}
curNode = n;
curIndex = n ? index : -1;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return curIndex; // return position of item
@@ -974,7 +972,7 @@ int TQGList::find( TQPtrCollection::Item d, bool fromStart )
uint TQGList::containsRef( TQPtrCollection::Item d ) const
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode *n = firstNode;
@@ -984,7 +982,7 @@ uint TQGList::containsRef( TQPtrCollection::Item d ) const
count++;
n = n->next;
}
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return count;
@@ -997,7 +995,7 @@ uint TQGList::containsRef( TQPtrCollection::Item d ) const
uint TQGList::contains( TQPtrCollection::Item d ) const
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode *n = firstNode;
@@ -1008,7 +1006,7 @@ uint TQGList::contains( TQPtrCollection::Item d ) const
count++;
n = n->next;
}
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return count;
@@ -1058,17 +1056,17 @@ uint TQGList::contains( TQPtrCollection::Item d ) const
TQPtrCollection::Item TQGList::first()
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( firstNode ) {
curIndex = 0;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return (curNode=firstNode)->data;
}
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return 0;
@@ -1080,17 +1078,17 @@ TQPtrCollection::Item TQGList::first()
TQPtrCollection::Item TQGList::last()
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( lastNode ) {
curIndex = numNodes-1;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return (curNode=lastNode)->data;
}
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return 0;
@@ -1102,14 +1100,14 @@ TQPtrCollection::Item TQGList::last()
TQPtrCollection::Item TQGList::next()
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( curNode ) {
if ( curNode->next ) {
curIndex++;
curNode = curNode->next;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return curNode->data;
@@ -1117,7 +1115,7 @@ TQPtrCollection::Item TQGList::next()
curIndex = -1;
curNode = 0;
}
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return 0;
@@ -1129,14 +1127,14 @@ TQPtrCollection::Item TQGList::next()
TQPtrCollection::Item TQGList::prev()
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( curNode ) {
if ( curNode->prev ) {
curIndex--;
curNode = curNode->prev;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return curNode->data;
@@ -1144,7 +1142,7 @@ TQPtrCollection::Item TQGList::prev()
curIndex = -1;
curNode = 0;
}
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return 0;
@@ -1157,12 +1155,12 @@ TQPtrCollection::Item TQGList::prev()
void TQGList::toVector( TQGVector *vector ) const
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
vector->clear();
if ( !vector->resize( count() ) ) {
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return;
@@ -1174,14 +1172,14 @@ void TQGList::toVector( TQGVector *vector ) const
n = n->next;
i++;
}
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
}
void TQGList::heapSortPushDown( TQPtrCollection::Item* heap, int first, int last )
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
int r = first;
@@ -1218,7 +1216,7 @@ void TQGList::heapSortPushDown( TQPtrCollection::Item* heap, int first, int last
}
}
}
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
}
@@ -1233,12 +1231,12 @@ void TQGList::heapSortPushDown( TQPtrCollection::Item* heap, int first, int last
void TQGList::sort()
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
uint n = count();
if ( n < 2 ) {
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return;
@@ -1273,7 +1271,7 @@ void TQGList::sort()
}
delete [] realheap;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
}
@@ -1300,7 +1298,7 @@ TQDataStream &operator<<( TQDataStream &s, const TQGList &list )
TQDataStream &TQGList::read( TQDataStream &s )
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
uint num;
@@ -1326,7 +1324,7 @@ TQDataStream &TQGList::read( TQDataStream &s )
}
curNode = firstNode;
curIndex = curNode ? 0 : -1;
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return s;
@@ -1338,7 +1336,7 @@ TQDataStream &TQGList::read( TQDataStream &s )
TQDataStream &TQGList::write( TQDataStream &s ) const
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
s << count(); // write number of items
@@ -1347,7 +1345,7 @@ TQDataStream &TQGList::write( TQDataStream &s ) const
write( s, n->data );
n = n->next;
}
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return s;
@@ -1361,13 +1359,13 @@ TQDataStream &TQGList::write( TQDataStream &s ) const
*/
TQLNode* TQGList::erase( TQLNode* it )
{
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode* n = it;
it = it->next;
removeNode( n );
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return it;
diff --git a/src/tools/qgvector.cpp b/src/tools/qgvector.cpp
index ea1e2018a..83cd3b92e 100644
--- a/src/tools/qgvector.cpp
+++ b/src/tools/qgvector.cpp
@@ -51,9 +51,9 @@
#include "ntqdatastream.h"
#include <stdlib.h>
-#ifdef TQT_THREAD_SUPPORT
+#ifndef TQT_NO_THREAD
# include <private/qmutexpool_p.h>
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD
#define USE_MALLOC // comment to use new/delete
@@ -405,10 +405,10 @@ void TQGVector::sort() // sort vector
}
}
-#ifdef TQT_THREAD_SUPPORT
+#ifndef TQT_NO_THREAD
TQMutexLocker locker( tqt_global_mutexpool ?
tqt_global_mutexpool->get( &sort_vec ) : 0 );
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD
sort_vec = (TQGVector*)this;
qsort( vec, count(), sizeof(Item), cmp_vec );
diff --git a/src/tools/qlocale.cpp b/src/tools/qlocale.cpp
index 0714dbb88..681c07734 100644
--- a/src/tools/qlocale.cpp
+++ b/src/tools/qlocale.cpp
@@ -3244,7 +3244,7 @@ TQString TQLocalePrivate::doubleToString(double d,
TQString digits;
#ifdef QT_QLOCALE_USES_FCVT
-#ifdef TQT_THREAD_SUPPORT
+#ifndef TQT_NO_THREAD
static bool dummy_for_mutex;
TQMutex *fcvt_mutex = tqt_global_mutexpool ? tqt_global_mutexpool->get( &dummy_for_mutex ) : 0;
# define FCVT_LOCK if (fcvt_mutex) fcvt_mutex->lock()
diff --git a/src/tools/qmutex_unix.cpp b/src/tools/qmutex_unix.cpp
index 3c568dbb8..8bb7a9dc1 100644
--- a/src/tools/qmutex_unix.cpp
+++ b/src/tools/qmutex_unix.cpp
@@ -40,7 +40,7 @@
#include "ntqglobal.h"
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
#include "qplatformdefs.h"
@@ -534,4 +534,4 @@ int TQMutex::level()
\sa TQMutexLocker::TQMutexLocker()
*/
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD
diff --git a/src/tools/qmutexpool.cpp b/src/tools/qmutexpool.cpp
index 72c66c8ca..da6450ae3 100644
--- a/src/tools/qmutexpool.cpp
+++ b/src/tools/qmutexpool.cpp
@@ -38,7 +38,7 @@
#include "qmutexpool_p.h"
-#ifdef TQT_THREAD_SUPPORT
+#ifndef TQT_NO_THREAD
#include <ntqthread.h>
diff --git a/src/tools/qmutexpool_p.h b/src/tools/qmutexpool_p.h
index 7f5ecabea..20b069ddc 100644
--- a/src/tools/qmutexpool_p.h
+++ b/src/tools/qmutexpool_p.h
@@ -56,7 +56,7 @@
#include "ntqmemarray.h"
#endif // QT_H
-#ifdef TQT_THREAD_SUPPORT
+#ifndef TQT_NO_THREAD
class TQ_EXPORT TQMutexPool
{
@@ -75,6 +75,6 @@ private:
extern TQ_EXPORT TQMutexPool *tqt_global_mutexpool;
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD
#endif // TQMUTEXPOOL_P_H
diff --git a/src/tools/qregexp.cpp b/src/tools/qregexp.cpp
index 5c0fac766..2ee6635da 100644
--- a/src/tools/qregexp.cpp
+++ b/src/tools/qregexp.cpp
@@ -52,10 +52,10 @@
#include "ntqstring.h"
#include "ntqtl.h"
-#ifdef TQT_THREAD_SUPPORT
+#ifndef TQT_NO_THREAD
#include "ntqthreadstorage.h"
#include <private/qthreadinstance_p.h>
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD
#undef TQT_TRANSLATE_NOOP
#define TQT_TRANSLATE_NOOP( context, sourceText ) sourceText
@@ -3212,25 +3212,25 @@ struct TQRegExpPrivate
#ifndef TQT_NO_REGEXP_OPTIM
static TQSingleCleanupHandler<TQCache<TQRegExpEngine> > cleanup_cache;
-# ifndef TQT_THREAD_SUPPORT
+# ifdef TQT_NO_THREAD
static TQCache<TQRegExpEngine> *engineCache = 0;
-# endif // TQT_THREAD_SUPPORT
+# endif // TQT_NO_THREAD
#endif // TQT_NO_REGEXP_OPTIM
static void regexpEngine( TQRegExpEngine *&eng, const TQString &pattern,
bool caseSensitive, bool deref )
{
-# ifdef TQT_THREAD_SUPPORT
+#ifndef TQT_NO_THREAD
static TQThreadStorage<TQCache<TQRegExpEngine> *> engineCaches;
TQCache<TQRegExpEngine> *engineCache = 0;
TQThreadInstance *currentThread = TQThreadInstance::current();
if (currentThread)
engineCache = engineCaches.localData();
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD
if ( !deref ) {
#ifndef TQT_NO_REGEXP_OPTIM
-# ifdef TQT_THREAD_SUPPORT
+# ifndef TQT_NO_THREAD
if ( currentThread )
# endif
{
@@ -3251,18 +3251,18 @@ static void regexpEngine( TQRegExpEngine *&eng, const TQString &pattern,
if ( eng->deref() ) {
#ifndef TQT_NO_REGEXP_OPTIM
-# ifdef TQT_THREAD_SUPPORT
+# ifndef TQT_NO_THREAD
if ( currentThread )
# endif
{
if ( engineCache == 0 ) {
engineCache = new TQCache<TQRegExpEngine>;
engineCache->setAutoDelete( TRUE );
-# ifdef TQT_THREAD_SUPPORT
+# ifndef TQT_NO_THREAD
engineCaches.setLocalData(engineCache);
# else
cleanup_cache.set( &engineCache );
-# endif // !TQT_THREAD_SUPPORT
+# endif // TQT_NO_THREAD
}
if ( !pattern.isNull() &&
engineCache->insert(pattern, eng, 4 + pattern.length() / 4) )
diff --git a/src/tools/qsemaphore.cpp b/src/tools/qsemaphore.cpp
index 394834fdd..101155d59 100644
--- a/src/tools/qsemaphore.cpp
+++ b/src/tools/qsemaphore.cpp
@@ -40,7 +40,7 @@
#include "ntqglobal.h"
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
#include "ntqsemaphore.h"
#include "ntqmutex.h"
@@ -254,4 +254,4 @@ bool TQSemaphore::tryAccess(int n)
return TRUE;
}
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD
diff --git a/src/tools/qstring.cpp b/src/tools/qstring.cpp
index 26e9b61cd..fcf0637fe 100644
--- a/src/tools/qstring.cpp
+++ b/src/tools/qstring.cpp
@@ -93,9 +93,9 @@
#define ULLONG_MAX TQ_UINT64_C(18446744073709551615)
#endif
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
#include "ntqmutex.h"
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
extern TQMutex *tqt_sharedStringMutex;
@@ -1054,9 +1054,9 @@ TQStringData::TQStringData() : TQShared(),
islatin1(FALSE),
security_unpaged(FALSE),
cString(0) {
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
mutex = new TQMutex(FALSE);
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
ref();
}
@@ -1069,9 +1069,9 @@ TQStringData::TQStringData(TQChar *u, uint l, uint m) : TQShared(),
islatin1(FALSE),
security_unpaged(FALSE),
cString(0) {
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
mutex = new TQMutex(FALSE);
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
}
TQStringData::~TQStringData() {
@@ -1089,12 +1089,12 @@ TQStringData::~TQStringData() {
if (cString) {
delete cString;
}
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
if ( mutex ) {
delete mutex;
mutex = NULL;
}
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
}
void TQStringData::setDirty() {
@@ -1466,14 +1466,14 @@ const TQChar TQChar::nbsp((ushort)0x00a0);
TQStringData* TQString::makeSharedNull()
{
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
if (tqt_sharedStringMutex) tqt_sharedStringMutex->lock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
if (TQString::shared_null) {
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
if (tqt_sharedStringMutex) tqt_sharedStringMutex->unlock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
return TQString::shared_null;
}
@@ -1483,9 +1483,9 @@ TQStringData* TQString::makeSharedNull()
that->d = TQString::shared_null;
#endif
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
if (tqt_sharedStringMutex) tqt_sharedStringMutex->unlock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
return TQString::shared_null;
}
@@ -1526,13 +1526,13 @@ TQString::TQString( const TQString &s ) :
d(s.d)
{
if ( d && (d != shared_null) ) {
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
d->ref();
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
}
}
@@ -1685,20 +1685,20 @@ TQString::~TQString()
return;
}
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
if ( d->deref() ) {
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
d->deleteSelf();
d = NULL;
}
else {
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
}
}
@@ -1720,22 +1720,22 @@ void TQString::real_detach()
void TQString::deref()
{
if ( d && (d != shared_null) ) {
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
if ( d->deref() ) {
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
if ( d != shared_null ) {
delete d;
}
d = 0;
}
else {
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
}
}
}
@@ -1778,13 +1778,13 @@ void TQStringData::deleteSelf()
TQString &TQString::operator=( const TQString &s )
{
if ( s.d && (s.d != shared_null) ) {
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
s.d->mutex->lock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
s.d->ref();
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
s.d->mutex->unlock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
}
deref();
d = s.d;
@@ -1892,9 +1892,9 @@ void TQString::truncate( uint newLen )
*/
void TQString::setLength( uint newLen )
{
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
if ( d->count != 1 || newLen > d->maxl ||
( newLen * 4 < d->maxl && d->maxl > 4 ) ) {
@@ -1905,24 +1905,24 @@ void TQString::setLength( uint newLen )
uint len = TQMIN( d->len, newLen );
memcpy( nd, d->unicode, sizeof(TQChar) * len );
bool unpaged = d->security_unpaged;
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
deref();
d = new TQStringData( nd, newLen, newMax );
setSecurityUnPaged(unpaged);
}
else {
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
}
}
else {
d->len = newLen;
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
d->setDirty();
}
}
@@ -2008,21 +2008,21 @@ void TQString::squeeze()
*/
void TQString::grow( uint newLen )
{
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
if ( d->count != 1 || newLen > d->maxl ) {
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
setLength( newLen );
}
else {
d->len = newLen;
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
d->setDirty();
}
}
@@ -6447,19 +6447,19 @@ TQString TQString::fromUcs2( const unsigned short *str )
*/
TQChar& TQString::ref(uint i) {
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
if ( (d->count != 1) || (i >= d->len) ) {
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
subat( i );
}
else {
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
}
d->setDirty();
return d->unicode[i];
@@ -6547,9 +6547,9 @@ TQString& TQString::setUnicode( const TQChar *unicode, uint len )
}
}
else {
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
if ( d->count != 1 || len > d->maxl || ( len * 4 < d->maxl && d->maxl > 4 ) ) {
// detach, grown or shrink
uint newMax = computeNewMax( len );
@@ -6557,17 +6557,17 @@ TQString& TQString::setUnicode( const TQChar *unicode, uint len )
if ( unicode ) {
memcpy( nd, unicode, sizeof(TQChar)*len );
}
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
deref();
d = new TQStringData( nd, len, newMax );
}
else {
d->len = len;
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
d->setDirty();
if ( unicode ) {
memcpy( d->unicode, unicode, sizeof(TQChar)*len );
@@ -7278,9 +7278,9 @@ TQConstString::TQConstString( const TQChar* unicode, uint length ) :
*/
TQConstString::~TQConstString()
{
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
if ( d->count > 1 ) {
TQChar* cp = QT_ALLOC_QCHAR_VEC( d->len );
@@ -7292,9 +7292,9 @@ TQConstString::~TQConstString()
}
// The original d->unicode is now unlinked.
-#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
+#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
-#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
+#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
}
/*!
diff --git a/src/tools/qthreadinstance_p.h b/src/tools/qthreadinstance_p.h
index 57244452c..0d99562be 100644
--- a/src/tools/qthreadinstance_p.h
+++ b/src/tools/qthreadinstance_p.h
@@ -56,7 +56,7 @@
#include "ntqwindowdefs.h"
#endif // QT_H
-#ifdef TQT_THREAD_SUPPORT
+#ifndef TQT_NO_THREAD
#ifdef Q_OS_UNIX
#include <pthread.h>
@@ -105,5 +105,5 @@ public:
bool disableThreadPostedEvents : 1;
};
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD
#endif // TQTHREAD_P_H
diff --git a/src/tools/qthreadstorage_unix.cpp b/src/tools/qthreadstorage_unix.cpp
index 7e34690b1..d2fc5e137 100644
--- a/src/tools/qthreadstorage_unix.cpp
+++ b/src/tools/qthreadstorage_unix.cpp
@@ -38,7 +38,7 @@
#include "ntqglobal.h"
-#ifdef TQT_THREAD_SUPPORT
+#ifndef TQT_NO_THREAD
#include "qplatformdefs.h"
@@ -348,4 +348,4 @@ void TQThreadStorageData::finish( void **thread_storage )
\sa localData() hasLocalData()
*/
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD
diff --git a/src/tools/qwaitcondition_unix.cpp b/src/tools/qwaitcondition_unix.cpp
index 866c524fd..24ce6855d 100644
--- a/src/tools/qwaitcondition_unix.cpp
+++ b/src/tools/qwaitcondition_unix.cpp
@@ -40,7 +40,7 @@
#include "ntqglobal.h"
-#if defined(TQT_THREAD_SUPPORT)
+#ifndef TQT_NO_THREAD
#include "qplatformdefs.h"
@@ -315,4 +315,4 @@ bool TQWaitCondition::wait(TQMutex *mutex, unsigned long time)
return (ret == 0);
}
-#endif // TQT_THREAD_SUPPORT
+#endif // TQT_NO_THREAD