summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-10-02 09:35:24 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-10-02 23:59:03 +0200
commitb73d5a0511bed8c3ccc504e74c52a61d4d3749b4 (patch)
tree9942c07e311f653792b660766bbc605e2643b546 /src/corelib/io
parent013b6cf0f15b2e770a0e51be745e4484e89ea926 (diff)
Remove typedef Q_PID
It is not used in public API any more since 0f8848b7e25e4d8fb9265ff6e0aa31946addd741. 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>
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qprocess.cpp11
-rw-r--r--src/corelib/io/qprocess.h18
-rw-r--r--src/corelib/io/qprocess_p.h8
-rw-r--r--src/corelib/io/qprocess_unix.cpp2
4 files changed, 14 insertions, 25 deletions
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index a7be5f2708..826f421eee 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -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
diff --git a/src/corelib/io/qprocess.h b/src/corelib/io/qprocess.h
index 4a24f7576f..4ed01197b3 100644
--- a/src/corelib/io/qprocess.h
+++ b/src/corelib/io/qprocess.h
@@ -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;
diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h
index dec2ea0703..9518b099f2 100644
--- a/src/corelib/io/qprocess_p.h
+++ b/src/corelib/io/qprocess_p.h
@@ -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;
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index 5fce848c2c..2c2f376028 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -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