Skip to content

Update DateTime to compile on Android - #6732

Merged
Anton Kolesnyk (antkmsft) merged 1 commit into
Azure:mainfrom
antkmsft:datetime-android
Sep 11, 2025
Merged

Anton Kolesnyk (antkmsft) merged 1 commit into
Azure:mainfrom
antkmsft:datetime-android

Conversation

@antkmsft

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the DateTime implementation to ensure compatibility with Android compilation by modifying static assertions and type handling in the GetMaxDateTime() function.

Key Changes

  • Replaced strict type equality assertion with more flexible type property checks
  • Changed from using DateTime::clock::duration::rep directly to using std::int64_t as the representative type
  • Added comprehensive static assertions to validate both system clock and DateTime clock duration properties

Comment thread sdk/core/azure-core/src/datetime.cpp
Comment thread sdk/core/azure-core/src/datetime.cpp
@antkmsft
Anton Kolesnyk (antkmsft) merged commit e7063f7 into Azure:main Sep 11, 2025
43 checks passed
@antkmsft
Anton Kolesnyk (antkmsft) deleted the datetime-android branch September 11, 2025 22:28
Mohamed Zaki (mohamed-zaki-coding) added a commit to mohamed-zaki-coding/azure-sdk-for-cpp that referenced this pull request Sep 24, 2026
Results from build 6876940 (26/31 jobs green):

- macOS: current images link Homebrew's openssl@3 into
  /usr/local/include, so azure-core compiled against Homebrew's OpenSSL
  headers while linking vcpkg's OpenSSL 3.0.5 (57 -Wold-style-cast
  errors from /usr/local/include/openssl/safestack.h). Unlink the
  Homebrew formula on macOS before building.
- macOS: the jump from Xcode 12.5.1 to 16.4 (Apple clang 17) surfaces
  new warnings in this branch's code, e.g. -Winteger-overflow in
  GetMaxDateTime() (datetime.cpp:54; fixed on main in Azure#6732). Build the
  macOS configurations with WARNINGS_AS_ERRORS=OFF; Linux and Windows
  keep warnings as errors.
- Coverage on Ubuntu 22.04 is 92.28%, below the 93% line target; lower
  it to 91%, as main did when it moved to Ubuntu 22.04 (Azure#4442).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants