aboutsummaryrefslogtreecommitdiff
path: root/zencore/zencore.cpp
diff options
context:
space:
mode:
authorPer Larsson <[email protected]>2021-09-20 08:54:34 +0200
committerPer Larsson <[email protected]>2021-09-20 08:54:34 +0200
commite25b4b20d8a5696aa7055c9c167fa47b3739bc7e (patch)
tree049654b87096a22e1bf696a385db608a75f229fa /zencore/zencore.cpp
parentProbe upstream Zen server when initializing upstream cache. (diff)
parentFixed unused variable warnings exposed by xmake build (unclear why I do not r... (diff)
downloadzen-e25b4b20d8a5696aa7055c9c167fa47b3739bc7e.tar.xz
zen-e25b4b20d8a5696aa7055c9c167fa47b3739bc7e.zip
Merge branch 'main' of https://github.com/EpicGames/zen
Diffstat (limited to 'zencore/zencore.cpp')
-rw-r--r--zencore/zencore.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/zencore/zencore.cpp b/zencore/zencore.cpp
index 5899f014d..122719d90 100644
--- a/zencore/zencore.cpp
+++ b/zencore/zencore.cpp
@@ -30,6 +30,8 @@
namespace zen {
+//////////////////////////////////////////////////////////////////////////
+
bool
IsPointerToStack(const void* ptr)
{
@@ -55,12 +57,31 @@ IsPointerToStack(const void* ptr)
#endif
}
-AssertException::AssertException(const char* Msg) : m_Msg(Msg)
+bool
+IsDebuggerPresent()
{
+#if ZEN_PLATFORM_WINDOWS
+ return ::IsDebuggerPresent();
+#else
+ return false;
+#endif
}
-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
}
//////////////////////////////////////////////////////////////////////////