File: execname.mac.inc

package info (click to toggle)
performous 1.1%2Bgit20181118-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 11,712 kB
  • sloc: cpp: 30,008; ansic: 2,751; sh: 801; xml: 464; python: 374; makefile: 22
file content (9 lines) | stat: -rw-r--r-- 188 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
#include <mach-o/dyld.h>

fs::path execname() {
	char buf[1024];
	uint32_t size = sizeof(buf);
	int ret = _NSGetExecutablePath(buf, &size);
	if (ret != 0) return fs::path();
	return buf;
}