Skip to content

Commit

Permalink
tests: Add guards around SwiftApiResolver signpost calls
Browse files Browse the repository at this point in the history
To avoid warnings, given we're targeting a lower macOS version than the
one these appeared in.
  • Loading branch information
oleavr committed May 10, 2024
1 parent 942e753 commit af363b8
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tests/core/swiftapiresolver/runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,25 @@ run (const gchar * query)
guint num_matches = 0;

#ifdef HAVE_DARWIN
os_signpost_id_t id = os_signpost_id_generate (gum_log);
os_signpost_interval_begin (gum_log, id, "enumerate_matches",
"query='%{public}s'", query);
os_signpost_id_t id;

if (__builtin_available (macOS 10.14, iOS 12.0, *))
{
id = os_signpost_id_generate (gum_log);
os_signpost_interval_begin (gum_log, id, "enumerate_matches",
"query='%{public}s'", query);
}
#endif

gum_api_resolver_enumerate_matches (resolver, query, on_match, &num_matches,
NULL);

#ifdef HAVE_DARWIN
os_signpost_interval_end (gum_log, id, "enumerate_matches", "num_matches=%u",
num_matches);
if (__builtin_available (macOS 10.14, iOS 12.0, *))
{
os_signpost_interval_end (gum_log, id, "enumerate_matches",
"num_matches=%u", num_matches);
}
#endif

return num_matches;
Expand Down

0 comments on commit af363b8

Please sign in to comment.