Avoid potential negative array index access to cached text.
[LibreOffice.git] / external / icu / icu4c-android.patch.1
blob9ba252b402d1d297289b079f2c136732eb7c7fbf
1 diff -ur icu.org/source/common/unicode/platform.h icu/source/common/unicode/platform.h
2 --- icu.org/source/common/unicode/platform.h    2021-10-28 18:04:57.000000000 +0200
3 +++ icu/source/common/unicode/platform.h        2021-11-15 21:03:11.474638494 +0100
4 @@ -818,7 +818,7 @@
5                              UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllimport__))
6  #   define U_EXPORT __declspec(dllexport)
7  #elif defined(__GNUC__)
8 -#   define U_EXPORT __attribute__((visibility("default")))
9 +#   define U_EXPORT
10  #elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
11     || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550) 
12  #   define U_EXPORT __global
13 diff -ur icu.org/source/config/mh-linux icu/source/config/mh-linux
14 --- icu.org/source/config/mh-linux      2021-11-15 20:56:39.460705065 +0100
15 +++ icu/source/config/mh-linux  2021-11-15 21:03:11.474638494 +0100
16 @@ -27,7 +27,7 @@
18  ## Compiler switch to embed a library name
19  # The initial tab in the next line is to prevent icu-config from reading it.
20 -       LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
21 +       #LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
22  #SH# # We can't depend on MIDDLE_SO_TARGET being set.
23  #SH# LD_SONAME=
25 diff -ur icu.org/source/configure icu/source/configure
26 --- icu.org/source/configure    2021-11-15 20:56:39.875703936 +0100
27 +++ icu/source/configure        2021-11-15 21:03:11.475638491 +0100
28 @@ -5272,7 +5273,7 @@
29         else
30                 icu_cv_host_frag=mh-linux-va
31         fi ;;
32 -*-*-linux*|*-*-gnu|*-*-k*bsd*-gnu|*-*-kopensolaris*-gnu) icu_cv_host_frag=mh-linux ;;
33 +*-*-linux*|*-*-gnu|*-*-k*bsd*-gnu|*-*-kopensolaris*-gnu|*-*-*-androideabi*) icu_cv_host_frag=mh-linux ;;
34  i[34567]86-*-cygwin)
35         if test "$GCC" = yes; then
36                 icu_cv_host_frag=mh-cygwin
37 @@ -6472,6 +6466,10 @@
38  # Check to see if genccode can generate simple assembly.
39  GENCCODE_ASSEMBLY=
40  case "${host}" in
41 +arm-*-linux-androideabi)
42 +    if test "$GCC" = yes; then
43 +        GENCCODE_ASSEMBLY="-a gcc-android-arm"
44 +    fi ;;
45  *-linux*|*-kfreebsd*-gnu*|i*86-*-*bsd*|i*86-pc-gnu)
46      if test "$GCC" = yes; then
47          # We're using gcc, and the simple -a gcc command line works for genccode
48 @@ -7594,6 +7592,10 @@
49      # wchar_t can be used
50      CHECK_UTF16_STRING_RESULT="available"
51      ;;
52 +*-*-*-androideabi|mips-unknown-linux-android)
53 +    # no UTF-16 strings thanks, I think, this is to avoid the -std=c++0x which causes trouble with uint64_t
54 +    CHECK_UTF16_STRING_RESULT="nope"
55 +    ;;
56  *)
57      ;;
58  esac
59 diff -ur icu.org/source/i18n/decimfmt.cpp icu/source/i18n/decimfmt.cpp
60 --- icu.org/source/i18n/decimfmt.cpp    2021-10-28 18:04:57.000000000 +0200
61 +++ icu/source/i18n/decimfmt.cpp        2021-11-15 21:03:11.476638489 +0100
62 @@ -9,6 +9,13 @@
63  // Helpful in toString methods and elsewhere.
64  #define UNISTR_FROM_STRING_EXPLICIT
66 +#ifdef __ANDROID__
67 +#ifndef ARM
68 +#define ARM
69 +#endif
70 +#include <android/compatibility.hxx>
71 +#endif
73  #include <cmath>
74  #include <cstdlib>
75  #include <stdlib.h>