MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / GetProcessName

Function GetProcessName

Source/ThirdParty/tracy/client/TracyProfiler.cpp:422–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

420#endif
421
422static const char* GetProcessName()
423{
424 const char* processName = "FlaxEngine";
425#ifdef _WIN32
426 static char buf[_MAX_PATH];
427 GetModuleFileNameA( nullptr, buf, _MAX_PATH );
428 const char* ptr = buf;
429 while( *ptr != '\0' ) ptr++;
430 while( ptr > buf && *ptr != '\\' && *ptr != '/' ) ptr--;
431 if( ptr > buf ) ptr++;
432 processName = ptr;
433#elif defined __ANDROID__
434# if __ANDROID_API__ >= 21
435 auto buf = getprogname();
436 if( buf ) processName = buf;
437# endif
438#elif defined __linux__ && defined _GNU_SOURCE
439 if( program_invocation_short_name ) processName = program_invocation_short_name;
440#elif defined __APPLE__ || defined BSD
441 auto buf = getprogname();
442 if( buf ) processName = buf;
443#elif defined __QNX__
444 processName = __progname;
445#endif
446 return processName;
447}
448
449static const char* GetProcessExecutablePath()
450{

Callers 1

WorkerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected