summaryrefslogtreecommitdiff
path: root/libc/include/android/api-level.h
AgeCommit message (Collapse)Author
2021-01-07Fix things so that <features.h> can be used from assembler again.Elliott Hughes
Bug: https://github.com/android/ndk/issues/1422 Test: builds Change-Id: I1b94ffe688f3d420533074c94f7ffed606ca923f
2020-08-11Add api-level.h to dac, improve docs.Dan Albert
We don't list most of bionic on dac since it would be overwhelming for the current layout, but this file in particular seems useful, especially __ANDROID_API__. Unfortunately, c2devsite doesn't include macro documentation. Until then, it's still useful to include the functions defined in this header. I've also elaborated a bit in the __ANDROID_API__ documentation, since the existing phrasing led to confusion over whether it was closer to minSdkVersion or compileSdkVersion. In practice these are identical for the NDK, but if we switch to weakly-linked APIs via the availability attribute that would change. Test: built docs, looked at them Bug: None Change-Id: I5cf78a6143b5c15790c369bdf888611e4c1189db
2020-04-09Add API constant for S.Dan Albert
Test: treehugger Bug: http://b/152037166 Change-Id: I9039377e80574cd59e13726a12072fe3002df67d
2019-12-20Stop using the __ANDROID_API_x__ constants.Elliott Hughes
Historically we've made a few mistakes where they haven't matched the right number. And most non-Googlers are much more familiar with the numbers, so it seems to make sense to rely more on them. Especially in header files, which we actually expect real people to have to read from time to time. Test: treehugger Change-Id: I0d4a97454ee108de1d32f21df285315c5488d886
2019-10-15Remove __ANDROID_NDK__ from bionic, and document our #defines.Elliott Hughes
__ANDROID_NDK__ is moving into the NDK's <android/ndk-version.h> instead. Test: treehugger Change-Id: I192016165a929547009d15dbcc30e8f6dad1ac88
2019-10-08Restore __ANDROID_NDK__.Elliott Hughes
At heart a revert of "Don't #define __ANDROID_NDK__ for the platform build!", which was commit eb6143037423a241ba8035304936149b300f7a5d. The original change was insufficiently motivated, and meant that the NDK -- not just the platform -- no longer defines __ANDROID_NDK__. Which then broke at least building toybox with NDK r19. Change-Id: Ic616688e4d17d25714a9ef381269d7431deac9b0
2019-04-24threads.h: Add C11 thread support.Elliott Hughes
FreeBSD, glibc, and musl have all implemented C11 threads at this point. POSIX is looking at how to align with it. Probably time to jump on the bandwagon ourselves... Implemented in the same style as <termios.h> so we can provide this functionality even on older API levels. This does mean that this is strictly more expensive than calling pthread functions directly. Although this isn't in POSIX yet, assume that it's going to be basically the same as C11 and add the header test anyway. We should revisit this when POSIX actually adds <threads.h>. Test: new tests Change-Id: I8602d67ce71ca7f8ed1529daa0a8ea1feb083dd6
2018-11-15Fix a comment in <android/api-level.h>.Elliott Hughes
Bug: N/A Test: N/A Change-Id: Id6ef27caf8fe095d2be7fbf18fed74cc1334f86b
2018-11-15Make android_get_application_target_sdk_version available to the NDK.Elliott Hughes
Also move this and android_get_device_api_level into <android/api-level.h> so that they're always available. This involves cleaning up <sys/cdefs.h> slightly. Bug: N/A Test: builds Change-Id: I25435c55f3549cd0d827a7581bee75ea8228028b
2018-10-17Don't #define __ANDROID_NDK__ for the platform build!Elliott Hughes
Caused an ODR violation trying to build current ToT of toybox. Bug: N/A Test: can successfully build code with `#ifdef __ANDROID_NDK__` Change-Id: Ia80b8889b267779ee01f6257744e1794db0ebc65
2018-09-06Add android_get_device_api_level.Elliott Hughes
Bug: http://b/113615412 Test: ran tests Change-Id: I0a7ae336c96c9ed6543b6935cbc242d14d4a4a67
2018-08-22Folks are starting to need a placeholder name for Q.Elliott Hughes
Better to just have one place to update... Bug: N/A Test: builds Change-Id: If7135d26f498b0841f9ae505bf6ca3ed05767345
2018-01-30The future is now (2018 edition).Elliott Hughes
Bug: N/A Test: builds Change-Id: Ic638e5b1f4e5901885fe7bc60b2a265817636b21
2017-10-02Add O MR1 defineJohn Reck
Bug: 64394076 Test: none Change-Id: Ice3991c626dd2cce93c9a571ba529fa5b0129492
2017-07-26Add __ANDROID_NDK__ to identify using the NDK.Dan Albert
I've added some things like __ANDROID_MAJOR__ to an ndk-version.h, but that is only in the NDK itself and so doesn't help the platform. Add __ANDROID_NDK__ to identify that you're building for the NDK and not the platform. Test: make checkbuild Bug: https://github.com/android-ndk/ndk/issues/407 Change-Id: I2d1f1c28e3764e4e658cf675b290b7a17253ee33
2016-11-16Add and use constants for the Android API levels.Elliott Hughes
Test: bionic tests still pass Change-Id: If1b619cfc9db1d3f5d91f14f2ace71058dca0c4a
2016-09-21Add __ANDROID_API_FUTURE__.Dan Albert
Needed for checking conditions like `__ANDROID_API__ < __ANDROID_API_FUTURE__` for providing inlines for things that have not yet been included in any release. Test: make checkbuild tests Bug: None Change-Id: Ibcddac5a538ede020a8cb65fca03194475121966
2016-07-22Always include <sys/cdefs.h>.Elliott Hughes
I made a mistake caught by code review earlier, so let's try to be safer by default. This patch also moves all our "forwarding" headers to the guardless just-include-the-other-thing style that we usually use. (Where we have a comment explaining where the header comes from, I've kept that.) Change-Id: I37342cf5e2563c6a269b2ba61a697069b1c7913b
2016-04-13Don't redefine __ANDROID_API__.Josh Gao
Bug: http://b/28178111 Change-Id: I00ded8f90694d9ed28f3b4c97778635f5a564592
2014-05-07Give bionic's __ANDROID_API__ a more reasonable value.Elliott Hughes
This matches what frameworks/base does with Build.VERSION and means that bionic's version number will always sort >= than any released version. This should prevent confusion in code that builds both against bionic and the NDK. (Note that <sys/cdefs.h> drags this in, so it's always in the namespace.) Bug: 14613709 Change-Id: I91fb745920e848a6b20f2f5797c0a7d6cde6c032
2010-12-06libc: Add <android/api-level.h>David 'Digit' Turner
Add a new header that defines __ANDROID_API__ as a constant integer corresponding to the current native API level. This header is included by <sys/cdefs.h> Change-Id: Ib4774e247b395991266245815a24292afc919848 NOTE: This header is already provided by the NDK's platform headers. for levels 3 to 9.