Add INVALID_PROCESS to represent invalid PROCESS value

This commit is contained in:
Robert Müller 2023-03-10 17:39:24 +01:00
parent 4834cfdac9
commit a0c61a1b60
3 changed files with 4 additions and 2 deletions

View file

@ -2449,8 +2449,10 @@ void cmdline_free(int argc, const char **argv);
#if defined(CONF_FAMILY_WINDOWS)
typedef void *PROCESS;
constexpr PROCESS INVALID_PROCESS = nullptr;
#else
typedef pid_t PROCESS;
constexpr PROCESS INVALID_PROCESS = 0;
#endif
/*

View file

@ -84,7 +84,7 @@ CMenus::CMenus()
m_DemoPlayerState = DEMOPLAYER_NONE;
m_Dummy = false;
m_ServerProcess.m_Process = 0;
m_ServerProcess.m_Process = INVALID_PROCESS;
for(SUIAnimator &animator : m_aAnimatorsSettingsTab)
{

View file

@ -294,6 +294,6 @@ void CMenus::KillServer()
if(m_ServerProcess.m_Process)
{
kill_process(m_ServerProcess.m_Process);
m_ServerProcess.m_Process = 0;
m_ServerProcess.m_Process = INVALID_PROCESS;
}
}