diff options
| author | Martin Ridgers <[email protected]> | 2021-09-21 11:06:13 +0200 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-09-21 11:06:13 +0200 |
| commit | 68c951e0f440ffd483795dced737e88152c1a581 (patch) | |
| tree | 5c0910ca2a85b45fb05dba3ce457b7d156213894 /zencore/zencore.cpp | |
| parent | Merge main into linux-mac (diff) | |
| parent | Trigger storage scrubbing pass at startup (diff) | |
| download | zen-68c951e0f440ffd483795dced737e88152c1a581.tar.xz zen-68c951e0f440ffd483795dced737e88152c1a581.zip | |
Merged main into linux-mac
Diffstat (limited to 'zencore/zencore.cpp')
| -rw-r--r-- | zencore/zencore.cpp | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/zencore/zencore.cpp b/zencore/zencore.cpp index f9b19ba9d..3eb43c558 100644 --- a/zencore/zencore.cpp +++ b/zencore/zencore.cpp @@ -20,9 +20,9 @@ #include <zencore/intmath.h> #include <zencore/iobuffer.h> #include <zencore/memory.h> +#include <zencore/mpscqueue.h> #include <zencore/refcount.h> #include <zencore/sha1.h> -#include <zencore/snapshot_manifest.h> #include <zencore/stats.h> #include <zencore/stream.h> #include <zencore/string.h> @@ -30,6 +30,10 @@ #include <zencore/timer.h> #include <zencore/uid.h> +namespace zen { + +////////////////////////////////////////////////////////////////////////// + bool IsPointerToStack(const void* ptr) { @@ -55,12 +59,31 @@ IsPointerToStack(const void* ptr) #endif } -zen::AssertException::AssertException(const char* Msg) : m_Msg(Msg) +bool +IsDebuggerPresent() { +#if ZEN_PLATFORM_WINDOWS + return ::IsDebuggerPresent(); +#else + return false; +#endif } -zen::AssertException::~AssertException() +bool +IsInteractiveSession() { +#if ZEN_PLATFORM_WINDOWS + DWORD dwSessionId = 0; + if (ProcessIdToSessionId(GetCurrentProcessId(), &dwSessionId)) + { + return (dwSessionId != 0); + } + + return false; +#else + // TODO: figure out what makes sense here + return true; +#endif } ////////////////////////////////////////////////////////////////////////// @@ -81,6 +104,7 @@ RequestApplicationExit(int ExitCode) s_ApplicationExitRequested = true; } +#if ZEN_WITH_TESTS void zencore_forcelinktests() { @@ -91,9 +115,9 @@ zencore_forcelinktests() zen::intmath_forcelink(); zen::iobuffer_forcelink(); zen::memory_forcelink(); + zen::mpscqueue_forcelink(); zen::refcount_forcelink(); zen::sha1_forcelink(); - zen::snapshotmanifest_forcelink(); zen::stats_forcelink(); zen::stream_forcelink(); zen::string_forcelink(); @@ -104,3 +128,6 @@ zencore_forcelinktests() zen::usonbuilder_forcelink(); zen::usonpackage_forcelink(); } +#endif + +} // namespace zen |