From 9c966b622422eb680fb71a8026c5147a907556a3 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 20 Feb 2019 13:13:29 +0100 Subject: [PATCH] Process name retrieval on apple. --- client/TracyProfiler.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 261a9a9e..ee9e0fce 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -27,6 +27,11 @@ # include #endif +#ifdef __APPLE__ +# include +# include +#endif + #include #include #include @@ -219,6 +224,10 @@ static const char* GetProcessName() # endif #elif defined _GNU_SOURCE || defined __CYGWIN__ processName = program_invocation_short_name; +#elif defined __APPLE__ + static char buf[1024]; + proc_name( getpid(), buf, 1024 ); + processName = buf; #endif return processName; }