mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Getting program name on android.
This commit is contained in:
parent
5cf962e03d
commit
8f280b147b
@ -16,6 +16,7 @@
|
|||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "../common/TracyProtocol.hpp"
|
#include "../common/TracyProtocol.hpp"
|
||||||
@ -60,11 +61,15 @@ static const char* GetProcessName()
|
|||||||
while( ptr > buf && *ptr != '\\' && *ptr != '/' ) ptr--;
|
while( ptr > buf && *ptr != '\\' && *ptr != '/' ) ptr--;
|
||||||
if( ptr > buf ) ptr++;
|
if( ptr > buf ) ptr++;
|
||||||
return ptr;
|
return ptr;
|
||||||
|
#elif defined __ANDROID__
|
||||||
|
# if __ANDROID_API__ >= 21
|
||||||
|
auto buf = getprogname();
|
||||||
|
if( buf ) return buf;
|
||||||
|
# endif
|
||||||
#elif defined _GNU_SOURCE
|
#elif defined _GNU_SOURCE
|
||||||
return program_invocation_short_name;
|
return program_invocation_short_name;
|
||||||
#else
|
|
||||||
return "unknown";
|
|
||||||
#endif
|
#endif
|
||||||
|
return "unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
enum { QueuePrealloc = 256 * 1024 };
|
enum { QueuePrealloc = 256 * 1024 };
|
||||||
|
Loading…
Reference in New Issue
Block a user