mirror of
https://github.com/wolfpld/tracy
synced 2025-04-30 12:53:51 +00:00
Implement getexecname() for osx.
This commit is contained in:
parent
31dc44feee
commit
fd363d7d85
@ -47,8 +47,25 @@ POSSIBILITY OF SUCH DAMAGE. */
|
|||||||
#include "internal.hpp"
|
#include "internal.hpp"
|
||||||
|
|
||||||
#ifndef HAVE_GETEXECNAME
|
#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
|
#define getexecname() NULL
|
||||||
# endif
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace tracy
|
namespace tracy
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user