diff --git a/renderdoc/os/posix/apple/apple_process.cpp b/renderdoc/os/posix/apple/apple_process.cpp index 0ec1d3cfb..be5dd5c01 100644 --- a/renderdoc/os/posix/apple/apple_process.cpp +++ b/renderdoc/os/posix/apple/apple_process.cpp @@ -29,6 +29,7 @@ #include #include "common/common.h" #include "common/formatting.h" +#include "core/core.h" #include "os/os_specific.h" char **GetCurrentEnvironment() @@ -200,3 +201,10 @@ uint64_t Process::GetMemoryUsage() return taskInfo.resident_size; } + +// Helper method to avoid #include file conflicts between +// and "core/core.h" +bool ShouldOutputDebugMon() +{ + return OSUtility::DebuggerPresent() && RenderDoc::Inst().IsReplayApp(); +} diff --git a/renderdoc/os/posix/apple/apple_stringio.cpp b/renderdoc/os/posix/apple/apple_stringio.cpp index 4c9b45d94..b32b3bb9b 100644 --- a/renderdoc/os/posix/apple/apple_stringio.cpp +++ b/renderdoc/os/posix/apple/apple_stringio.cpp @@ -318,6 +318,10 @@ rdcwstr UTF82Wide(const rdcstr &s) } }; +// Helper method to avoid #include file conflicts between +// and "core/core.h" +bool ShouldOutputDebugMon(); + namespace OSUtility { void WriteOutput(int channel, const char *str) @@ -326,6 +330,8 @@ void WriteOutput(int channel, const char *str) fprintf(stdout, "%s", str); else if(channel == OSUtility::Output_StdErr) fprintf(stderr, "%s", str); + else if(channel == OSUtility::Output_DebugMon && ShouldOutputDebugMon()) + fprintf(stdout, "%s", str); } uint64_t GetMachineIdent()