From fa4475f36d6404a70d760ca95ac6a986a8846a3f Mon Sep 17 00:00:00 2001 From: Alexander Golubev Date: Mon, 11 Mar 2024 21:20:42 +0300 Subject: Initial conversion for TQT_THREAD_SUPPORT->!TQT_NO_THREAD Signed-off-by: Alexander Golubev --- src/kernel/ntqthread.h | 4 ++-- src/kernel/qthread.cpp | 2 ++ src/kernel/qthread_unix.cpp | 2 ++ src/moc/moc.pro | 2 +- src/qt.pro | 3 ++- src/tools/ntqglobal.h | 6 ++++++ src/tools/ntqthreadstorage.h | 4 ++-- src/tools/qcriticalsection_p.cpp | 2 ++ src/tools/qcriticalsection_p.h | 2 ++ src/tools/qmutex_unix.cpp | 2 ++ src/tools/qmutexpool_p.h | 4 ++-- src/tools/qsemaphore.cpp | 2 ++ src/tools/qthreadinstance_p.h | 4 ++-- src/tools/qthreadstorage_unix.cpp | 2 ++ src/tools/qwaitcondition_unix.cpp | 2 ++ 15 files changed, 33 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/kernel/ntqthread.h b/src/kernel/ntqthread.h index 695a61fb7..6f72e67c1 100644 --- a/src/kernel/ntqthread.h +++ b/src/kernel/ntqthread.h @@ -41,12 +41,12 @@ #ifndef TQTHREAD_H #define TQTHREAD_H -#if defined(TQT_THREAD_SUPPORT) - #ifndef QT_H #include "ntqwindowdefs.h" #endif // QT_H +#if defined(TQT_THREAD_SUPPORT) + #include class TQThreadInstance; diff --git a/src/kernel/qthread.cpp b/src/kernel/qthread.cpp index bb51e41fc..185921c70 100644 --- a/src/kernel/qthread.cpp +++ b/src/kernel/qthread.cpp @@ -36,6 +36,8 @@ ** **********************************************************************/ +#include "ntqglobal.h" + #ifdef TQT_THREAD_SUPPORT #include "qplatformdefs.h" diff --git a/src/kernel/qthread_unix.cpp b/src/kernel/qthread_unix.cpp index 7a6bc3393..501471fec 100644 --- a/src/kernel/qthread_unix.cpp +++ b/src/kernel/qthread_unix.cpp @@ -36,6 +36,8 @@ ** **********************************************************************/ +#include "ntqglobal.h" + #if defined(TQT_THREAD_SUPPORT) #include "qplatformdefs.h" diff --git a/src/moc/moc.pro b/src/moc/moc.pro index c8abcf0d7..3e9cb1b59 100644 --- a/src/moc/moc.pro +++ b/src/moc/moc.pro @@ -3,7 +3,7 @@ TARGET = tqmoc CONFIG = console release qtinc yacc lex_included yacc_no_name_mangle DEFINES += QT_MOC TQT_NO_CODECS QT_LITE_UNICODE TQT_NO_COMPONENT \ - TQT_NO_STL TQT_NO_COMPRESS + TQT_NO_STL TQT_NO_COMPRESS TQT_NO_THREAD win32:DEFINES += QT_NODLL DESTDIR = ../../bin diff --git a/src/qt.pro b/src/qt.pro index 84482686b..e9c005987 100644 --- a/src/qt.pro +++ b/src/qt.pro @@ -121,7 +121,8 @@ thread { !win32-borland:TARGET = tqt-mt win32-borland:TARGET = qtmt embedded:TARGET = qte-mt - DEFINES += TQT_THREAD_SUPPORT +} else { + DEFINES += TQT_NO_THREAD } !cups:DEFINES += TQT_NO_CUPS diff --git a/src/tools/ntqglobal.h b/src/tools/ntqglobal.h index f83da9d79..4805869a8 100644 --- a/src/tools/ntqglobal.h +++ b/src/tools/ntqglobal.h @@ -822,6 +822,12 @@ class TQString; #include "ntqfeatures.h" #endif /* QT_H */ +// Keep the old flag for thread support in sync with the new one +#ifndef TQT_NO_THREAD +# define TQT_THREAD_SUPPORT +#else +# undef TQT_THREAD_SUPPORT +#endif // // Create TQt DLL if QT_DLL is defined (Windows only) diff --git a/src/tools/ntqthreadstorage.h b/src/tools/ntqthreadstorage.h index 588621237..b9e0e11bb 100644 --- a/src/tools/ntqthreadstorage.h +++ b/src/tools/ntqthreadstorage.h @@ -39,12 +39,12 @@ #ifndef TQTHREADSTORAGE_H #define TQTHREADSTORAGE_H -#ifdef TQT_THREAD_SUPPORT - #ifndef QT_H #include "ntqglobal.h" #endif // QT_H +#ifdef TQT_THREAD_SUPPORT + class TQ_EXPORT TQThreadStorageData { public: diff --git a/src/tools/qcriticalsection_p.cpp b/src/tools/qcriticalsection_p.cpp index 20c2127b0..534960952 100644 --- a/src/tools/qcriticalsection_p.cpp +++ b/src/tools/qcriticalsection_p.cpp @@ -36,6 +36,8 @@ ** **********************************************************************/ +#include "ntqglobal.h" + #if defined(TQT_THREAD_SUPPORT) #include "qt_windows.h" diff --git a/src/tools/qcriticalsection_p.h b/src/tools/qcriticalsection_p.h index 330e141e1..0c362bc71 100644 --- a/src/tools/qcriticalsection_p.h +++ b/src/tools/qcriticalsection_p.h @@ -54,6 +54,8 @@ // // +#include "ntqglobal.h" + #if defined(TQT_THREAD_SUPPORT) #if defined(TQ_WS_WIN) diff --git a/src/tools/qmutex_unix.cpp b/src/tools/qmutex_unix.cpp index 597d3e628..3c568dbb8 100644 --- a/src/tools/qmutex_unix.cpp +++ b/src/tools/qmutex_unix.cpp @@ -38,6 +38,8 @@ ** **********************************************************************/ +#include "ntqglobal.h" + #if defined(TQT_THREAD_SUPPORT) #include "qplatformdefs.h" diff --git a/src/tools/qmutexpool_p.h b/src/tools/qmutexpool_p.h index a0bb28562..7f5ecabea 100644 --- a/src/tools/qmutexpool_p.h +++ b/src/tools/qmutexpool_p.h @@ -51,13 +51,13 @@ // // -#ifdef TQT_THREAD_SUPPORT - #ifndef QT_H #include "ntqmutex.h" #include "ntqmemarray.h" #endif // QT_H +#ifdef TQT_THREAD_SUPPORT + class TQ_EXPORT TQMutexPool { public: diff --git a/src/tools/qsemaphore.cpp b/src/tools/qsemaphore.cpp index 810837b4c..394834fdd 100644 --- a/src/tools/qsemaphore.cpp +++ b/src/tools/qsemaphore.cpp @@ -38,6 +38,8 @@ ** **********************************************************************/ +#include "ntqglobal.h" + #if defined(TQT_THREAD_SUPPORT) #include "ntqsemaphore.h" diff --git a/src/tools/qthreadinstance_p.h b/src/tools/qthreadinstance_p.h index 14f0de591..57244452c 100644 --- a/src/tools/qthreadinstance_p.h +++ b/src/tools/qthreadinstance_p.h @@ -51,13 +51,13 @@ // // -#ifdef TQT_THREAD_SUPPORT - #ifndef QT_H #include "ntqmutex.h" #include "ntqwindowdefs.h" #endif // QT_H +#ifdef TQT_THREAD_SUPPORT + #ifdef Q_OS_UNIX #include #endif diff --git a/src/tools/qthreadstorage_unix.cpp b/src/tools/qthreadstorage_unix.cpp index d53f6fb6e..7e34690b1 100644 --- a/src/tools/qthreadstorage_unix.cpp +++ b/src/tools/qthreadstorage_unix.cpp @@ -36,6 +36,8 @@ ** **********************************************************************/ +#include "ntqglobal.h" + #ifdef TQT_THREAD_SUPPORT #include "qplatformdefs.h" diff --git a/src/tools/qwaitcondition_unix.cpp b/src/tools/qwaitcondition_unix.cpp index 62038bae5..866c524fd 100644 --- a/src/tools/qwaitcondition_unix.cpp +++ b/src/tools/qwaitcondition_unix.cpp @@ -38,6 +38,8 @@ ** **********************************************************************/ +#include "ntqglobal.h" + #if defined(TQT_THREAD_SUPPORT) #include "qplatformdefs.h" -- cgit v1.2.1