1 diff -rupN glibremake/glibbase/glib-2.40.2/config.h glibremake/glib-2.40.2/config.h
2 --- glibremake/glibbase/glib-2.40.2/config.h 2015-03-31 18:56:48.099484578 +0900
3 +++ glibremake/glib-2.40.2/config.h 2015-03-31 19:36:57.139558379 +0900
5 #define ALIGNOF_GUINT32 4
7 /* The normal alignment of `guint64', in bytes. */
8 -#define ALIGNOF_GUINT64 8
9 +#define ALIGNOF_GUINT64 4
11 /* The normal alignment of `unsigned long', in bytes. */
12 -#define ALIGNOF_UNSIGNED_LONG 8
13 +#define ALIGNOF_UNSIGNED_LONG 4
15 /* poll doesn't work on devices */
16 /* #undef BROKEN_POLL */
18 /* #undef ENABLE_GC_FRIENDLY_DEFAULT */
20 /* always defined to indicate that i18n is enabled */
21 +#ifndef _GLIB_ANDROID_
24 +#endif /* _GLIB_ANDROID__ */
25 /* Define the gettext package to be used */
26 #define GETTEXT_PACKAGE "glib20"
29 /* #undef HAVE_COCOA */
31 /* Have nl_langinfo (CODESET) */
32 +#ifndef _GLIB_ANDROID_
33 #define HAVE_CODESET 1
35 +#endif /* _GLIB_ANDROID_ */
36 /* Define to 1 if you have the <crt_externs.h> header file. */
37 /* #undef HAVE_CRT_EXTERNS_H */
40 /* we have the eventfd(2) system call */
41 #define HAVE_EVENTFD 1
43 +#ifndef _GLIB_ANDROID_
44 /* Define to 1 if you have the `fallocate' function. */
45 #define HAVE_FALLOCATE 1
46 +#endif /* _GLIB_ANDROID_ */
48 /* Define if we have FAM */
51 /* Define to 1 if you have the `kqueue' function. */
52 /* #undef HAVE_KQUEUE */
54 +#ifndef _GLIB_ANDROID_
55 /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
56 #define HAVE_LANGINFO_CODESET 1
60 /* Have nl_langinfo (PM_STR) */
61 #define HAVE_LANGINFO_TIME 1
62 +#endif /* _GLIB_ANDROID_ */
64 /* Define to 1 if you have the `lchmod' function. */
65 /* #undef HAVE_LCHMOD */
68 /* Define to 1 if you have the <memory.h> header file. */
69 #define HAVE_MEMORY_H 1
71 +#ifndef _GLIB_ANDROID_
72 /* Define to 1 if you have the `mmap' function. */
74 +#endif /* _GLIB_ANDROID_ */
76 /* Define to 1 if you have the <mntent.h> header file. */
77 #define HAVE_MNTENT_H 1
79 /* Have POSIX function getgrgid_r */
80 #define HAVE_POSIX_GETGRGID_R 1
82 +#ifndef _GLIB_ANDROID_
83 /* Have POSIX function getpwuid_r */
84 #define HAVE_POSIX_GETPWUID_R 1
85 +#endif /* _GLIB_ANDROID_ */
87 /* Define to 1 if you have the `posix_memalign' function. */
88 #define HAVE_POSIX_MEMALIGN 1
90 #define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
92 /* Have function pthread_cond_timedwait_relative_np */
93 +#ifndef _GLIB_ANDROID_
94 /* #undef HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP */
97 +#define HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP 0
98 +#endif /* _GLIB_ANDROID_ */
99 /* Define to 1 if the system has the type `ptrdiff_t'. */
100 #define HAVE_PTRDIFF_T 1
103 /* Define to 1 if you have the <stdlib.h> header file. */
104 #define HAVE_STDLIB_H 1
106 +#ifndef _GLIB_ANDROID_
107 /* Define to 1 if you have the `stpcpy' function. */
108 #define HAVE_STPCPY 1
109 +#endif /* _GLIB_ANDROID_ */
111 /* Define to 1 if you have the `strcasecmp' function. */
112 #define HAVE_STRCASECMP 1
113 @@ -532,10 +546,10 @@
115 /* Define to 1 if you have the <sys/xattr.h> header file. */
116 #define HAVE_SYS_XATTR_H 1
118 +#ifndef _GLIB_ANDROID_
119 /* Define to 1 if you have the `timegm' function. */
120 #define HAVE_TIMEGM 1
122 +#endif /* _GLIB_ANDROID_ */
123 /* Define to 1 if you have the <unistd.h> header file. */
124 #define HAVE_UNISTD_H 1
128 /* Define to 1 if you have the `vsnprintf' function. */
129 #define HAVE_VSNPRINTF 1
131 +#ifndef _GLIB_ANDROID_
132 /* Define if you have the 'wchar_t' type. */
133 #define HAVE_WCHAR_T 1
135 @@ -575,12 +589,14 @@
137 /* Define to 1 if xattr is available */
141 /* Define to 1 if xattr API uses XATTR_NOFOLLOW */
142 /* #undef HAVE_XATTR_NOFOLLOW */
144 /* Define to 1 if you have the <xlocale.h> header file. */
145 +#ifndef _GLIB_ANDROID_
146 #define HAVE_XLOCALE_H 1
147 +#endif /* _GLIB_ANDROID_ */
149 /* Define to 1 if you have the `_NSGetEnviron' function. */
150 /* #undef HAVE__NSGETENVIRON */
154 /* The size of `long', as computed by sizeof. */
155 -#define SIZEOF_LONG 8
156 +#define SIZEOF_LONG 4
158 /* The size of `long long', as computed by sizeof. */
159 #define SIZEOF_LONG_LONG 8
160 @@ -637,13 +653,13 @@
161 #define SIZEOF_SHORT 2
163 /* The size of `size_t', as computed by sizeof. */
164 -#define SIZEOF_SIZE_T 8
165 +#define SIZEOF_SIZE_T 4
167 /* The size of `ssize_t', as computed by sizeof. */
168 -#define SIZEOF_SSIZE_T 8
169 +#define SIZEOF_SSIZE_T 4
171 /* The size of `void *', as computed by sizeof. */
172 -#define SIZEOF_VOID_P 8
173 +#define SIZEOF_VOID_P 4
175 /* The size of `__int64', as computed by sizeof. */
176 #define SIZEOF___INT64 0
181 -/* Enable large inode numbers on Mac OS X 10.5. */
182 -#ifndef _DARWIN_USE_64_BIT_INODE
183 -# define _DARWIN_USE_64_BIT_INODE 1
186 /* Number of bits in a file offset, on hosts where this is settable. */
187 -/* #undef _FILE_OFFSET_BITS */
188 +#define _FILE_OFFSET_BITS 64
190 /* defines how to decorate public symbols while building */
191 #define _GLIB_EXTERN __attribute__((visibility("default"))) extern
192 diff -rupN glibremake/glibbase/glib-2.40.2/glib/gconvert.c glibremake/glib-2.40.2/glib/gconvert.c
193 --- glibremake/glibbase/glib-2.40.2/glib/gconvert.c 2015-03-31 18:56:47.783484568 +0900
194 +++ glibremake/glib-2.40.2/glib/gconvert.c 2015-03-31 19:00:09.863490759 +0900
196 #include "glibconfig.h"
200 +#ifndef _GLIB_ANDROID_
202 +#endif /* _GLIB_ANDROID_ */
209 G_DEFINE_QUARK (g_convert_error, g_convert_error)
211 +#ifndef _GLIB_ANDROID_
213 try_conversion (const char *to_codeset,
214 const char *from_codeset,
215 @@ -200,6 +205,7 @@ try_to_aliases (const char **to_aliases,
219 +#endif /* _GLIB_ANDROID_ */
223 @@ -220,6 +226,7 @@ GIConv
224 g_iconv_open (const gchar *to_codeset,
225 const gchar *from_codeset)
227 +#ifndef _GLIB_ANDROID_
230 if (!try_conversion (to_codeset, from_codeset, &cd))
231 @@ -248,6 +255,9 @@ g_iconv_open (const gchar *to_codeset,
234 return (cd == (iconv_t)-1) ? (GIConv)-1 : (GIConv)cd;
237 +#endif /* _GLIB_ANDROID_ */
241 @@ -274,9 +284,13 @@ g_iconv (GIConv converter,
243 gsize *outbytes_left)
245 +#ifndef _GLIB_ANDROID_
246 iconv_t cd = (iconv_t)converter;
248 return iconv (cd, inbuf, inbytes_left, outbuf, outbytes_left);
251 +#endif /* _GLIB_ANDROID_ */
255 @@ -297,9 +311,13 @@ g_iconv (GIConv converter,
257 g_iconv_close (GIConv converter)
259 +#ifndef _GLIB_ANDROID_
260 iconv_t cd = (iconv_t)converter;
262 return iconv_close (cd);
265 +#endif /* _GLIB_ANDROID_ */
269 diff -rupN glibremake/glibbase/glib-2.40.2/glib/gfileutils.c glibremake/glib-2.40.2/glib/gfileutils.c
270 --- glibremake/glibbase/glib-2.40.2/glib/gfileutils.c 2015-03-31 18:56:47.687484565 +0900
271 +++ glibremake/glib-2.40.2/glib/gfileutils.c 2015-03-31 18:59:50.395490162 +0900
274 #ifdef HAVE_LINUX_MAGIC_H /* for btrfs check */
275 #include <linux/magic.h>
276 -#include <sys/vfs.h>
277 +//#include <sys/vfs.h>
281 diff -rupN glibremake/glibbase/glib-2.40.2/glib/ggettext.c glibremake/glib-2.40.2/glib/ggettext.c
282 --- glibremake/glibbase/glib-2.40.2/glib/ggettext.c 2015-03-31 18:56:47.687484565 +0900
283 +++ glibremake/glib-2.40.2/glib/ggettext.c 2015-03-31 19:27:28.671540964 +0900
289 +#ifndef _GLIB_ANDROID_
291 +#endif /* _GLIB_ANDROID_ */
295 diff -rupN glibremake/glibbase/glib-2.40.2/glib/glibconfig.h glibremake/glib-2.40.2/glib/glibconfig.h
296 --- glibremake/glibbase/glib-2.40.2/glib/glibconfig.h 2015-03-31 18:56:47.783484568 +0900
297 +++ glibremake/glib-2.40.2/glib/glibconfig.h 2015-03-31 19:33:14.071551545 +0900
298 @@ -48,30 +48,30 @@ typedef unsigned int guint32;
299 #define G_GUINT32_FORMAT "u"
300 #define G_HAVE_GINT64 1 /* deprecated, always true */
302 -typedef signed long gint64;
303 -typedef unsigned long guint64;
304 +G_GNUC_EXTENSION typedef signed long long gint64;
305 +G_GNUC_EXTENSION typedef unsigned long long guint64;
307 -#define G_GINT64_CONSTANT(val) (val##L)
308 -#define G_GUINT64_CONSTANT(val) (val##UL)
309 -#define G_GINT64_MODIFIER "l"
310 -#define G_GINT64_FORMAT "li"
311 -#define G_GUINT64_FORMAT "lu"
313 -#define GLIB_SIZEOF_VOID_P 8
314 -#define GLIB_SIZEOF_LONG 8
315 -#define GLIB_SIZEOF_SIZE_T 8
316 -#define GLIB_SIZEOF_SSIZE_T 8
318 -typedef signed long gssize;
319 -typedef unsigned long gsize;
320 -#define G_GSIZE_MODIFIER "l"
321 -#define G_GSSIZE_MODIFIER "l"
322 -#define G_GSIZE_FORMAT "lu"
323 -#define G_GSSIZE_FORMAT "li"
325 -#define G_MAXSIZE G_MAXULONG
326 -#define G_MINSSIZE G_MINLONG
327 -#define G_MAXSSIZE G_MAXLONG
328 +#define G_GINT64_CONSTANT(val) (G_GNUC_EXTENSION (val##LL))
329 +#define G_GUINT64_CONSTANT(val) (G_GNUC_EXTENSION (val##ULL))
330 +#define G_GINT64_MODIFIER "ll"
331 +#define G_GINT64_FORMAT "lli"
332 +#define G_GUINT64_FORMAT "llu"
334 +#define GLIB_SIZEOF_VOID_P 4
335 +#define GLIB_SIZEOF_LONG 4
336 +#define GLIB_SIZEOF_SIZE_T 4
337 +#define GLIB_SIZEOF_SSIZE_T 4
339 +typedef signed int gssize;
340 +typedef unsigned int gsize;
341 +#define G_GSIZE_MODIFIER ""
342 +#define G_GSSIZE_MODIFIER ""
343 +#define G_GSIZE_FORMAT "u"
344 +#define G_GSSIZE_FORMAT "i"
346 +#define G_MAXSIZE G_MAXUINT
347 +#define G_MINSSIZE G_MININT
348 +#define G_MAXSSIZE G_MAXINT
350 typedef gint64 goffset;
351 #define G_MINOFFSET G_MININT64
352 @@ -82,18 +82,18 @@ typedef gint64 goffset;
353 #define G_GOFFSET_CONSTANT(val) G_GINT64_CONSTANT(val)
356 -#define GPOINTER_TO_INT(p) ((gint) (glong) (p))
357 -#define GPOINTER_TO_UINT(p) ((guint) (gulong) (p))
358 +#define GPOINTER_TO_INT(p) ((gint) (gint) (p))
359 +#define GPOINTER_TO_UINT(p) ((guint) (guint) (p))
361 -#define GINT_TO_POINTER(i) ((gpointer) (glong) (i))
362 -#define GUINT_TO_POINTER(u) ((gpointer) (gulong) (u))
363 +#define GINT_TO_POINTER(i) ((gpointer) (gint) (i))
364 +#define GUINT_TO_POINTER(u) ((gpointer) (guint) (u))
366 -typedef signed long gintptr;
367 -typedef unsigned long guintptr;
368 +typedef signed int gintptr;
369 +typedef unsigned int guintptr;
371 -#define G_GINTPTR_MODIFIER "l"
372 -#define G_GINTPTR_FORMAT "li"
373 -#define G_GUINTPTR_FORMAT "lu"
374 +#define G_GINTPTR_MODIFIER ""
375 +#define G_GINTPTR_FORMAT "i"
376 +#define G_GUINTPTR_FORMAT "u"
377 #ifndef G_DISABLE_DEPRECATED
378 #define g_ATEXIT(proc) (atexit (proc))
379 #define g_memmove(dest,src,len) G_STMT_START { memmove ((dest), (src), (len)); } G_STMT_END
380 @@ -107,7 +107,6 @@ typedef unsigned long guintptr;
383 #define G_VA_COPY va_copy
384 -#define G_VA_COPY_AS_ARRAY 1
387 #define G_HAVE_INLINE 1
388 @@ -155,7 +154,9 @@ typedef unsigned long guintptr;
389 #define G_THREADS_ENABLED
390 #define G_THREADS_IMPL_POSIX
392 +#ifndef _GLIB_ANDROID_
393 #define G_ATOMIC_LOCK_FREE
394 +#endif /* _GLIB_ANDROID_ */
396 #define GINT16_TO_LE(val) ((gint16) (val))
397 #define GUINT16_TO_LE(val) ((guint16) (val))
398 @@ -169,18 +170,18 @@ typedef unsigned long guintptr;
399 #define GUINT64_TO_LE(val) ((guint64) (val))
400 #define GINT64_TO_BE(val) ((gint64) GUINT64_SWAP_LE_BE (val))
401 #define GUINT64_TO_BE(val) (GUINT64_SWAP_LE_BE (val))
402 -#define GLONG_TO_LE(val) ((glong) GINT64_TO_LE (val))
403 -#define GULONG_TO_LE(val) ((gulong) GUINT64_TO_LE (val))
404 -#define GLONG_TO_BE(val) ((glong) GINT64_TO_BE (val))
405 -#define GULONG_TO_BE(val) ((gulong) GUINT64_TO_BE (val))
406 +#define GLONG_TO_LE(val) ((glong) GINT32_TO_LE (val))
407 +#define GULONG_TO_LE(val) ((gulong) GUINT32_TO_LE (val))
408 +#define GLONG_TO_BE(val) ((glong) GINT32_TO_BE (val))
409 +#define GULONG_TO_BE(val) ((gulong) GUINT32_TO_BE (val))
410 #define GINT_TO_LE(val) ((gint) GINT32_TO_LE (val))
411 #define GUINT_TO_LE(val) ((guint) GUINT32_TO_LE (val))
412 #define GINT_TO_BE(val) ((gint) GINT32_TO_BE (val))
413 #define GUINT_TO_BE(val) ((guint) GUINT32_TO_BE (val))
414 -#define GSIZE_TO_LE(val) ((gsize) GUINT64_TO_LE (val))
415 -#define GSSIZE_TO_LE(val) ((gssize) GINT64_TO_LE (val))
416 -#define GSIZE_TO_BE(val) ((gsize) GUINT64_TO_BE (val))
417 -#define GSSIZE_TO_BE(val) ((gssize) GINT64_TO_BE (val))
418 +#define GSIZE_TO_LE(val) ((gsize) GUINT32_TO_LE (val))
419 +#define GSSIZE_TO_LE(val) ((gssize) GINT32_TO_LE (val))
420 +#define GSIZE_TO_BE(val) ((gsize) GUINT32_TO_BE (val))
421 +#define GSSIZE_TO_BE(val) ((gssize) GINT32_TO_BE (val))
422 #define G_BYTE_ORDER G_LITTLE_ENDIAN
424 #define GLIB_SYSDEF_POLLIN =1
425 diff -rupN glibremake/glibbase/glib-2.40.2/glib/gslice.c glibremake/glib-2.40.2/glib/gslice.c
426 --- glibremake/glibbase/glib-2.40.2/glib/gslice.c 2015-03-31 18:56:47.775484568 +0900
427 +++ glibremake/glib-2.40.2/glib/gslice.c 2015-03-31 18:57:16.255485440 +0900
428 @@ -388,7 +388,9 @@ slice_config_init (SliceConfig *config)
429 * This way it's possible to force gslice to be enabled under
430 * valgrind just by setting G_SLICE to the empty string.
433 if (RUNNING_ON_VALGRIND)
435 config->always_malloc = TRUE;
438 diff -rupN glibremake/glibbase/glib-2.40.2/glib/gstrfuncs.c glibremake/glib-2.40.2/glib/gstrfuncs.c
439 --- glibremake/glibbase/glib-2.40.2/glib/gstrfuncs.c 2015-03-31 18:56:47.683484565 +0900
440 +++ glibremake/glib-2.40.2/glib/gstrfuncs.c 2015-03-31 18:57:07.783485181 +0900
441 @@ -309,6 +309,7 @@ static const guint16 ascii_table_data[25
443 const guint16 * const g_ascii_table = ascii_table_data;
445 +#ifndef _GLIB_ANDROID_
446 #if defined (HAVE_NEWLOCALE) && \
447 defined (HAVE_USELOCALE) && \
448 defined (HAVE_STRTOD_L) && \
449 @@ -316,6 +317,7 @@ const guint16 * const g_ascii_table = as
450 defined (HAVE_STRTOLL_L)
451 #define USE_XLOCALE 1
453 +#endif /* _GLIB_ANDROID_ */