Moving guards to proper places.

This commit is contained in:
Alan Mishchenko 2025-12-24 21:08:18 -08:00
parent 52741b9123
commit 997619d33e
1 changed files with 14 additions and 2 deletions

View File

@ -50,10 +50,14 @@ void OptMgr::PrintUsage() {
}
}
ABC_NAMESPACE_IMPL_END
#ifdef __linux__
#include <sys/prctl.h>
ABC_NAMESPACE_IMPL_START
void kill_on_parent_death(int sig)
{
// kill process if parent dies
@ -67,6 +71,8 @@ void kill_on_parent_death(int sig)
}
}
ABC_NAMESPACE_IMPL_END
#elif defined(__APPLE__)
#include <thread>
@ -78,6 +84,8 @@ void kill_on_parent_death(int sig)
#include <sys/event.h>
#include <sys/time.h>
ABC_NAMESPACE_IMPL_START
template <typename Func>
static auto retry_eintr(Func &&fn) -> decltype(fn())
{
@ -124,12 +132,16 @@ void kill_on_parent_death(int sig)
monitor_thread.detach();
}
ABC_NAMESPACE_IMPL_END
#else // neither linux or OS X
ABC_NAMESPACE_IMPL_START
void kill_on_parent_death(int sig)
{
}
#endif
ABC_NAMESPACE_IMPL_END
#endif