1 diff -rupN glibref/glib-2.40.2/config.h glibpatch/glib-2.40.2/config.h
2 --- glibref/glib-2.40.2/config.h 2015-03-31 16:25:56.882894898 +0900
3 +++ glibpatch/glib-2.40.2/config.h 2015-04-01 13:21:19.593558693 +0900
5 /* #undef ENABLE_GC_FRIENDLY_DEFAULT */
7 /* always defined to indicate that i18n is enabled */
8 +#ifndef _GLIB_ANDROID_
11 +#endif /* _GLIB_ANDROID__ */
12 /* Define the gettext package to be used */
13 #define GETTEXT_PACKAGE "glib20"
16 /* #undef HAVE_COCOA */
18 /* Have nl_langinfo (CODESET) */
19 +#ifndef _GLIB_ANDROID_
20 #define HAVE_CODESET 1
22 +#endif /* _GLIB_ANDROID_ */
23 /* Define to 1 if you have the <crt_externs.h> header file. */
24 /* #undef HAVE_CRT_EXTERNS_H */
27 /* we have the eventfd(2) system call */
28 #define HAVE_EVENTFD 1
30 +#ifndef _GLIB_ANDROID_
31 /* Define to 1 if you have the `fallocate' function. */
32 #define HAVE_FALLOCATE 1
33 +#endif /* _GLIB_ANDROID_ */
35 /* Define if we have FAM */
38 /* Define to 1 if you have the `kqueue' function. */
39 /* #undef HAVE_KQUEUE */
41 +#ifndef _GLIB_ANDROID_
42 /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
43 #define HAVE_LANGINFO_CODESET 1
47 /* Have nl_langinfo (PM_STR) */
48 #define HAVE_LANGINFO_TIME 1
49 +#endif /* _GLIB_ANDROID_ */
51 /* Define to 1 if you have the `lchmod' function. */
52 /* #undef HAVE_LCHMOD */
55 /* Define to 1 if you have the <memory.h> header file. */
56 #define HAVE_MEMORY_H 1
58 +#ifndef _GLIB_ANDROID_
59 /* Define to 1 if you have the `mmap' function. */
61 +#endif /* _GLIB_ANDROID_ */
63 /* Define to 1 if you have the <mntent.h> header file. */
64 #define HAVE_MNTENT_H 1
66 /* Have POSIX function getgrgid_r */
67 #define HAVE_POSIX_GETGRGID_R 1
69 +#ifndef _GLIB_ANDROID_
70 /* Have POSIX function getpwuid_r */
71 #define HAVE_POSIX_GETPWUID_R 1
72 +#endif /* _GLIB_ANDROID_ */
74 /* Define to 1 if you have the `posix_memalign' function. */
75 #define HAVE_POSIX_MEMALIGN 1
77 #define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
79 /* Have function pthread_cond_timedwait_relative_np */
80 +#ifndef _GLIB_ANDROID_
81 /* #undef HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP */
84 +#define HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP 0
85 +#endif /* _GLIB_ANDROID_ */
86 /* Define to 1 if the system has the type `ptrdiff_t'. */
87 #define HAVE_PTRDIFF_T 1
90 /* Define to 1 if you have the <stdlib.h> header file. */
91 #define HAVE_STDLIB_H 1
93 +#ifndef _GLIB_ANDROID_
94 /* Define to 1 if you have the `stpcpy' function. */
96 +#endif /* _GLIB_ANDROID_ */
98 /* Define to 1 if you have the `strcasecmp' function. */
99 #define HAVE_STRCASECMP 1
100 @@ -532,10 +546,10 @@
102 /* Define to 1 if you have the <sys/xattr.h> header file. */
103 #define HAVE_SYS_XATTR_H 1
105 +#ifndef _GLIB_ANDROID_
106 /* Define to 1 if you have the `timegm' function. */
107 #define HAVE_TIMEGM 1
109 +#endif /* _GLIB_ANDROID_ */
110 /* Define to 1 if you have the <unistd.h> header file. */
111 #define HAVE_UNISTD_H 1
115 /* Define to 1 if you have the `vsnprintf' function. */
116 #define HAVE_VSNPRINTF 1
118 +#ifndef _GLIB_ANDROID_
119 /* Define if you have the 'wchar_t' type. */
120 #define HAVE_WCHAR_T 1
122 @@ -575,12 +589,14 @@
124 /* Define to 1 if xattr is available */
128 /* Define to 1 if xattr API uses XATTR_NOFOLLOW */
129 /* #undef HAVE_XATTR_NOFOLLOW */
131 /* Define to 1 if you have the <xlocale.h> header file. */
132 +#ifndef _GLIB_ANDROID_
133 #define HAVE_XLOCALE_H 1
134 +#endif /* _GLIB_ANDROID_ */
136 /* Define to 1 if you have the `_NSGetEnviron' function. */
137 /* #undef HAVE__NSGETENVIRON */
138 diff -rupN glibref/glib-2.40.2/glib/gconvert.c glibpatch/glib-2.40.2/glib/gconvert.c
139 --- glibref/glib-2.40.2/glib/gconvert.c 2015-03-31 16:25:56.946894901 +0900
140 +++ glibpatch/glib-2.40.2/glib/gconvert.c 2015-03-31 16:40:50.546926503 +0900
142 #include "glibconfig.h"
146 +#ifndef _GLIB_ANDROID_
148 +#endif /* _GLIB_ANDROID_ */
155 G_DEFINE_QUARK (g_convert_error, g_convert_error)
157 +#ifndef _GLIB_ANDROID_
159 try_conversion (const char *to_codeset,
160 const char *from_codeset,
161 @@ -197,9 +202,9 @@ try_to_aliases (const char **to_aliases,
168 +#endif /* _GLIB_ANDROID_ */
172 @@ -220,6 +225,7 @@ GIConv
173 g_iconv_open (const gchar *to_codeset,
174 const gchar *from_codeset)
176 +#ifndef _GLIB_ANDROID_
179 if (!try_conversion (to_codeset, from_codeset, &cd))
180 @@ -248,6 +254,9 @@ g_iconv_open (const gchar *to_codeset,
183 return (cd == (iconv_t)-1) ? (GIConv)-1 : (GIConv)cd;
186 +#endif /* _GLIB_ANDROID_ */
190 @@ -274,9 +283,13 @@ g_iconv (GIConv converter,
192 gsize *outbytes_left)
194 +#ifndef _GLIB_ANDROID_
195 iconv_t cd = (iconv_t)converter;
197 return iconv (cd, inbuf, inbytes_left, outbuf, outbytes_left);
200 +#endif /* _GLIB_ANDROID_ */
204 @@ -297,9 +310,13 @@ g_iconv (GIConv converter,
206 g_iconv_close (GIConv converter)
208 +#ifndef _GLIB_ANDROID_
209 iconv_t cd = (iconv_t)converter;
211 return iconv_close (cd);
214 +#endif /* _GLIB_ANDROID_ */
218 diff -rupN glibref/glib-2.40.2/glib/gfileutils.c glibpatch/glib-2.40.2/glib/gfileutils.c
219 --- glibref/glib-2.40.2/glib/gfileutils.c 2015-03-31 16:25:57.170894910 +0900
220 +++ glibpatch/glib-2.40.2/glib/gfileutils.c 2015-03-31 16:37:29.594919396 +0900
223 #ifdef HAVE_LINUX_MAGIC_H /* for btrfs check */
224 #include <linux/magic.h>
225 +#ifndef _GLIB_ANDROID_
227 +#endif /* _GLIB_ANDROID_ */
231 diff -rupN glibref/glib-2.40.2/glib/ggettext.c glibpatch/glib-2.40.2/glib/ggettext.c
232 --- glibref/glib-2.40.2/glib/ggettext.c 2015-03-31 16:25:57.182894907 +0900
233 +++ glibpatch/glib-2.40.2/glib/ggettext.c 2015-03-31 16:37:55.538920314 +0900
239 +#ifndef _GLIB_ANDROID_
241 +#endif /* _GLIB_ANDROID_ */
245 diff -rupN glibref/glib-2.40.2/glib/glibconfig.h glibpatch/glib-2.40.2/glib/glibconfig.h
246 --- glibref/glib-2.40.2/glib/glibconfig.h 2015-03-31 16:25:57.166894909 +0900
247 +++ glibpatch/glib-2.40.2/glib/glibconfig.h 2015-03-31 16:38:06.954920717 +0900
248 @@ -154,7 +154,9 @@ typedef unsigned int guintptr;
249 #define G_THREADS_ENABLED
250 #define G_THREADS_IMPL_POSIX
252 +#ifndef _GLIB_ANDROID_
253 #define G_ATOMIC_LOCK_FREE
254 +#endif /* _GLIB_ANDROID_ */
256 #define GINT16_TO_LE(val) ((gint16) (val))
257 #define GUINT16_TO_LE(val) ((guint16) (val))
258 diff -rupN glibref/glib-2.40.2/glib/gslice.c glibpatch/glib-2.40.2/glib/gslice.c
259 --- glibref/glib-2.40.2/glib/gslice.c 2015-03-31 16:25:56.946894901 +0900
260 +++ glibpatch/glib-2.40.2/glib/gslice.c 2015-03-31 16:38:38.302921827 +0900
261 @@ -388,7 +388,9 @@ slice_config_init (SliceConfig *config)
262 * This way it's possible to force gslice to be enabled under
263 * valgrind just by setting G_SLICE to the empty string.
265 + #ifndef _GLIB_ANDROID_
266 if (RUNNING_ON_VALGRIND)
267 +#endif /* _GLIB_ANDROID_ */
268 config->always_malloc = TRUE;
271 diff -rupN glibref/glib-2.40.2/glib/gstrfuncs.c glibpatch/glib-2.40.2/glib/gstrfuncs.c
272 --- glibref/glib-2.40.2/glib/gstrfuncs.c 2015-03-31 16:25:56.950894901 +0900
273 +++ glibpatch/glib-2.40.2/glib/gstrfuncs.c 2015-03-31 16:39:00.154922598 +0900
274 @@ -309,6 +309,7 @@ static const guint16 ascii_table_data[25
276 const guint16 * const g_ascii_table = ascii_table_data;
278 +#ifndef _GLIB_ANDROID_
279 #if defined (HAVE_NEWLOCALE) && \
280 defined (HAVE_USELOCALE) && \
281 defined (HAVE_STRTOD_L) && \
282 @@ -316,6 +317,7 @@ const guint16 * const g_ascii_table = as
283 defined (HAVE_STRTOLL_L)
284 #define USE_XLOCALE 1
286 +#endif /* _GLIB_ANDROID_ */