diff options
author | Victor Chang <vichang@google.com> | 2021-01-19 10:17:17 +0000 |
---|---|---|
committer | Victor Chang <vichang@google.com> | 2024-04-19 12:13:13 +0100 |
commit | 88cb961cd6b7f1625cb3763f02ee4cd3f466aa12 (patch) | |
tree | 2e7bcb16188bd0dbbd07e1807fb4222d416fec15 | |
parent | f6265fc49580b5c84b1c957a2edf7c520c38a0e9 (diff) | |
download | icu-88cb961cd6b7f1625cb3763f02ee4cd3f466aa12.tar.gz |
Android patch: Include uconfig_local.h
Enable use of uconfig_local.h during compilation of ICU4C,
which is used by libicu and libandroidicu library.
libicuuc uses uconfig_local.h to safeguard a condition during compile time.
In libandroidicu the header file defines a few macros to configure
icu4c behaviour such as adding suffix to C functions.
This commit squashes the following 4 commits:
1. http://r.android.com/838352 -- Android patch: Include uconfig_local.h
2. http://r.android.com/852490 -- Android Patch: Include uconfig_local.h only when building with soong
3. http://r.android.com/854804 -- Android Patch: Fix the comment for UCONFIG_USE_LOCAL
4. http://r.android.com/1420719 -- Android patch: Include uconfig_local.h in NDK build
Test: For NDK build, ANDROID is not defined, but __ANDROID__ is as shown in the NDK toolchain
"toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang
-E -dM - < /dev/null | grep ANDROID"
Change-Id: Iec32b8f914833047420278594a77ed11abc1efa9
-rw-r--r-- | icu4c/source/common/unicode/uconfig.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/icu4c/source/common/unicode/uconfig.h b/icu4c/source/common/unicode/uconfig.h index c0488d502..4a6d1a4d8 100644 --- a/icu4c/source/common/unicode/uconfig.h +++ b/icu4c/source/common/unicode/uconfig.h @@ -17,6 +17,19 @@ #ifndef __UCONFIG_H__ #define __UCONFIG_H__ +// Android patch: Hard code UCONFIG_USE_LOCAL=1 so that ICU will use +// uconfig_local.h, which allows us to disable use of non-stable and +// internal APIs in libicu and Android's libandroidicu shim. For more +// information on this pre-processor variable see the comments below. +// Also, see http://b/117094880 + +// To keep updateicudata.py (which uses the ICU make process) working, +// uconfig_local.h is only included when ANDROID is defined in the +// platform build system(s), or __ANDROID__ is defined when targeting +// Android, e.g. NDK build. +#if defined(ANDROID) || defined(__ANDROID__) +#define UCONFIG_USE_LOCAL 1 +#endif /*! * \file |