Implement __isOSVersionAtLeast for Android
authorStephen Hines <srhines@google.com>
Tue, 15 Sep 2020 19:50:42 +0000 (12:50 -0700)
committerStephen Hines <srhines@google.com>
Tue, 15 Sep 2020 19:54:06 +0000 (12:54 -0700)
commit516a01b5f36d4188778a34202cd11856d70ac808
treed871cfa3ca3891d12cff2468e56734a4182ddf43
parent38ecd6161993ea9632efe0c0bf304bf6c2dee98f
Implement __isOSVersionAtLeast for Android

Add the implementation of __isOSVersionAtLeast for Android. Currently,
only the major version is checked against the API level of the platform
which is an integer. The API level is retrieved by reading the system
property ro.build.version.sdk (and optionally ro.build.version.codename
to see if the platform is released or not).

Patch by jiyong@google.com

Bug: 150860940
Bug: 134795810
Test: m

Reviewed By: srhines

Differential Revision: https://reviews.llvm.org/D86596
compiler-rt/lib/builtins/os_version_check.c