Skip to content

Commit 1543a9d

Browse files
CopilotBrzVlad
andauthored
Use timespec_get on iOS/tvOS/MacCatalyst now that 13.0 is the minimum version (#130246)
`timespec_get` was previously unavailable on iOS/tvOS/MacCatalyst below 13.0, so `LogAssert` in `debug.cpp` fell back to `gettimeofday` for those platforms. Since 13.0 is now the minimum deployment target, that fallback is no longer needed there. ## Changes - **`src/coreclr/utilcode/debug.cpp`**: Remove `HOST_IOS`, `HOST_TVOS`, and `HOST_MACCATALYST` from the `gettimeofday` fallback condition — `timespec_get` is now used directly on those platforms. `HOST_ANDROID` retains the fallback since targeted Android API levels still lack `timespec_get` support. ```c // Before #if defined(HOST_IOS) || defined(HOST_TVOS) || defined(HOST_MACCATALYST) || defined(HOST_ANDROID) // timespec_get is only available on iOS 13.0+ and not supported on Android API levels we target // After #if defined(HOST_ANDROID) // timespec_get is not supported on Android API levels we target ``` --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: BrzVlad <4720621+BrzVlad@users.noreply.github.com>
1 parent 3a604f0 commit 1543a9d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/coreclr/utilcode/debug.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ VOID LogAssert(
163163
STRESS_LOG2(LF_ASSERT, LL_ALWAYS, "ASSERT:%s:%d\n", szFile, iLine);
164164

165165
struct timespec ts;
166-
#if defined(HOST_IOS) || defined(HOST_TVOS) || defined(HOST_MACCATALYST) || defined(HOST_ANDROID)
167-
// timespec_get is only available on iOS 13.0+ and not supported on Android API levels we target, use gettimeofday instead
166+
#if defined(HOST_ANDROID)
167+
// timespec_get is not supported on Android API levels we target, use gettimeofday instead
168168
struct timeval tv;
169169
gettimeofday(&tv, nullptr);
170170
ts.tv_sec = tv.tv_sec;

0 commit comments

Comments
 (0)