aboutsummaryrefslogtreecommitdiff
path: root/zencore/zencore.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-09-17 15:39:49 +0200
committerStefan Boberg <[email protected]>2021-09-17 15:39:49 +0200
commit68897f04bd60624fb57d1bd5add4ca7aed1d5e50 (patch)
treec5c822f1069d6cf1e5b8200ca5b12e53db995672 /zencore/zencore.cpp
parentAdded namespace scopes to more includes for better consistency (diff)
downloadzen-68897f04bd60624fb57d1bd5add4ca7aed1d5e50.tar.xz
zen-68897f04bd60624fb57d1bd5add4ca7aed1d5e50.zip
Added IsDebuggerPresent() query function to query whether a debugger is currently attached to the running process
Diffstat (limited to 'zencore/zencore.cpp')
-rw-r--r--zencore/zencore.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/zencore/zencore.cpp b/zencore/zencore.cpp
index 5899f014d..bb457ed0a 100644
--- a/zencore/zencore.cpp
+++ b/zencore/zencore.cpp
@@ -30,6 +30,8 @@
namespace zen {
+//////////////////////////////////////////////////////////////////////////
+
bool
IsPointerToStack(const void* ptr)
{
@@ -55,6 +57,18 @@ IsPointerToStack(const void* ptr)
#endif
}
+bool
+IsDebuggerPresent()
+{
+#if ZEN_PLATFORM_WINDOWS
+ return ::IsDebuggerPresent();
+#else
+ return false;
+#endif
+}
+
+//////////////////////////////////////////////////////////////////////////
+
AssertException::AssertException(const char* Msg) : m_Msg(Msg)
{
}