| 420 | #endif |
| 421 | |
| 422 | static 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 | |
| 449 | static const char* GetProcessExecutablePath() |
| 450 | { |