diff --git a/libbacktrace/fileline.cpp b/libbacktrace/fileline.cpp index 3c3103d1..7b3dbfbf 100644 --- a/libbacktrace/fileline.cpp +++ b/libbacktrace/fileline.cpp @@ -47,7 +47,24 @@ POSSIBILITY OF SUCH DAMAGE. */ #include "internal.hpp" #ifndef HAVE_GETEXECNAME +# ifdef __APPLE__ +# include +static const char* getexecname() +{ + static char execname[PATH_MAX+1]; + uint32_t size = sizeof( execname ); + if( _NSGetExecutablePath( execname, &size ) == 0 ) + { + return execname; + } + else + { + return nullptr; + } +} +# else #define getexecname() NULL +# endif #endif namespace tracy