mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Implement getexecname() for osx.
This commit is contained in:
parent
31dc44feee
commit
fd363d7d85
@ -47,7 +47,24 @@ POSSIBILITY OF SUCH DAMAGE. */
|
||||
#include "internal.hpp"
|
||||
|
||||
#ifndef HAVE_GETEXECNAME
|
||||
# ifdef __APPLE__
|
||||
# include <mach-o/dyld.h>
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user