mirror of
git://sourceware.org/git/valgrind.git
synced 2026-01-12 00:19:31 +08:00
Darwin regtest: update none apple-main-arg for macOS 10.14
Looks like the apple pointer to the executable name started having a prefix starting with macOS 10.14.
This commit is contained in:
@@ -24,19 +24,21 @@ int main(int argc, char *argv[], char *envp[], char *apple[])
|
||||
|
||||
// Make sure realpath(argv[0]) == realpath(apple[0]). (realpath resolves
|
||||
// symlinks.)
|
||||
// PJF this changed with macOS 11, apple path now has a prefix
|
||||
#if (DARWIN_VERS >= DARWIN_11_00)
|
||||
// PJF this changed with macOS 10.14, apple path now has a prefix
|
||||
#if (DARWIN_VERS >= DARWIN_10_14)
|
||||
const char prefix[] = "executable_path=";
|
||||
const size_t prefix_len = strlen(prefix);
|
||||
assert(strncmp(apple[0], prefix, prefix_len) == 0);
|
||||
realpath(apple[0]+prefix_len, pappl);
|
||||
exit(0);
|
||||
#else
|
||||
realpath(apple[0], pappl);
|
||||
#endif
|
||||
realpath(argv[0], pargv);
|
||||
assert(0 == strcmp(pargv, pappl));
|
||||
|
||||
free(pargv);
|
||||
free(pappl);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user