]> sigrok.org Git - sigrok-util.git/blobdiff - cross-compile/android/Python-3.3.3.patch
sigrok-cross-mingw: Patch MXE's glib to fix compiler warnings.
[sigrok-util.git] / cross-compile / android / Python-3.3.3.patch
index 1b3428014618961dca83e752c4d99bf0788fb18e..70cb7355d42d9e8d8a33379efbcaed16e8cc0d63 100644 (file)
@@ -85,7 +85,7 @@ diff --git a/Python/pythonrun.c b/Python/pythonrun.c
 index 832df53..c43e5e9 100644
 --- a/Python/pythonrun.c
 +++ b/Python/pythonrun.c
-@@ -810,6 +810,44 @@ Py_SetPythonHome(wchar_t *home)
+@@ -810,6 +810,51 @@ Py_SetPythonHome(wchar_t *home)
      default_home = home;
  }
  
@@ -96,15 +96,20 @@ index 832df53..c43e5e9 100644
 +    size_t size = 0;
 +    if (in)
 +    {
-+        while(*in && size<maxlen) {
-+            if(*in < 128)
-+                *out++ = *in++;
-+            else
-+                *out++ = 0xdc00 + *in++;
++        while(*in && (!out || size<maxlen)) {
++            if (out) {
++                if(*in < 128)
++                    *out++ = *in++;
++                else
++                    *out++ = 0xdc00 + *in++;
++            } else {
++               in++;
++            }
 +            size += 1;
 +        }
 +    }
-+    *out = 0;
++    if (out && size<maxlen)
++        *out = 0;
 +    return size;
 +}
 +
@@ -112,7 +117,7 @@ index 832df53..c43e5e9 100644
 +{
 +    wchar_t c;
 +    size_t i;
-+    for (i=0; i<maxlen && source[i]; i++)
++    for (i=0; (!dest || i<maxlen) && source[i]; i++)
 +    {
 +        c=source[i];
 +        if (c >= 0xdc80 && c <= 0xdcff)
@@ -123,6 +128,8 @@ index 832df53..c43e5e9 100644
 +        if (dest)
 +            dest[i]=c;
 +    }
++    if (dest && i<maxlen)
++        dest[i] = 0;
 +    return i;
 +}
 +#endif
@@ -181,3 +188,33 @@ index 832df53..c43e5e9 100644
      SETS(setIndex++, "");
  #else
      SETS(setIndex++, p->pw_gecos);
+--- a/Python/bltinmodule.c 2014-04-13 10:14:13.053260705 +0200
++++ b/Python/bltinmodule.c     2014-04-26 15:18:24.094444817 +0200
+@@ -24,7 +24,7 @@
+ #ifdef HAVE_MBCS
+ const char *Py_FileSystemDefaultEncoding = "mbcs";
+ int Py_HasFileSystemDefaultEncoding = 1;
+-#elif defined(__APPLE__)
++#elif defined(__APPLE__) || defined(__ANDROID__)
+ const char *Py_FileSystemDefaultEncoding = "utf-8";
+ int Py_HasFileSystemDefaultEncoding = 1;
+ #else
+--- a/Lib/locale.py 2014-04-26 14:35:53.243526608 +0200
++++ b/Lib/locale.py    2014-04-26 14:36:53.752085946 +0200
+@@ -46,6 +46,7 @@
+ try:
+     from _locale import *
++    raise ImportError("")
+ except ImportError:
+--- a/Misc/python.pc.in 2014-04-26 23:16:09.108514880 +0200
++++ b/Misc/python.pc.in        2014-04-26 23:24:48.845467012 +0200
+@@ -9,5 +9,5 @@
+ Requires: 
+ Version: @VERSION@
+ Libs.private: @LIBS@
+-Libs: -L${libdir} -lpython@VERSION@@ABIFLAGS@
++Libs: -L${libdir} -lpython@VERSION@@ABIFLAGS@ -lz
+ Cflags: -I${includedir}/python@VERSION@@ABIFLAGS@