Remove typedef Q_PID

It is not used in public API any more since
0f8848b7e2.

Replace by an internal Windows-specific Q_PROCESS_INFORMATION typedef.

Change-Id: Ia6dcc83ca667c40ac5d678c00d143c09d650e42a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Friedemann Kleint 2020-10-02 09:35:24 +02:00
parent 013b6cf0f1
commit b73d5a0511
4 changed files with 14 additions and 25 deletions

View File

@ -2504,17 +2504,6 @@ QString QProcess::nullDevice()
#endif
}
/*!
\typedef Q_PID
\relates QProcess
Typedef for the identifiers used to represent processes on the underlying
platform. On Unix, this corresponds to \l qint64; on Windows, it
corresponds to \c{_PROCESS_INFORMATION*}.
\sa QProcess::processId()
*/
#endif // QT_CONFIG(process)
QT_END_NAMESPACE

View File

@ -48,13 +48,13 @@
QT_REQUIRE_CONFIG(processenvironment);
#ifdef Q_OS_WIN
typedef struct _PROCESS_INFORMATION *Q_PID;
#endif
#if defined(Q_OS_WIN) || defined(Q_CLANG_QDOC)
typedef struct _SECURITY_ATTRIBUTES Q_SECURITY_ATTRIBUTES;
typedef struct _STARTUPINFOW Q_STARTUPINFO;
struct _PROCESS_INFORMATION;
struct _SECURITY_ATTRIBUTES;
struct _STARTUPINFOW;
using Q_PROCESS_INFORMATION = _PROCESS_INFORMATION;
using Q_SECURITY_ATTRIBUTES = _SECURITY_ATTRIBUTES;
using Q_STARTUPINFO = _STARTUPINFOW;
#endif
QT_BEGIN_NAMESPACE
@ -62,10 +62,6 @@ QT_BEGIN_NAMESPACE
class QProcessPrivate;
class QProcessEnvironmentPrivate;
#ifndef Q_OS_WIN
typedef qint64 Q_PID;
#endif
class Q_CORE_EXPORT QProcessEnvironment
{
public:
@ -200,7 +196,7 @@ public:
void *environment;
const wchar_t *currentDirectory;
Q_STARTUPINFO *startupInfo;
Q_PID processInformation;
Q_PROCESS_INFORMATION *processInformation;
};
typedef std::function<void(CreateProcessArguments *)> CreateProcessArgumentModifier;
CreateProcessArgumentModifier createProcessArgumentsModifier() const;

View File

@ -302,8 +302,12 @@ public:
QProcess::ProcessError processError = QProcess::UnknownError;
QProcess::ProcessState processState = QProcess::NotRunning;
QString workingDirectory;
Q_PID pid = 0;
int sequenceNumber = 0;
#ifdef Q_OS_WIN
Q_PROCESS_INFORMATION *pid = nullptr;
#else
qint64 pid = 0;
#endif
int sequenceNumber;
bool dying = false;
bool emittedReadyRead = false;

View File

@ -503,7 +503,7 @@ void QProcessPrivate::startProcess()
::_exit(-1);
}
pid = Q_PID(childPid);
pid = qint64(childPid);
// parent
// close the ends we don't use and make all pipes non-blocking