Rename SendResponse to SendDirectStackResponse in ocstack.c
[platform/upstream/iotivity.git] / resource / csdk / connectivity / lib / android / patches / glib-2.40.2.patch
1 diff -rupN glibref/glib-2.40.2/Android.mk glibpatch/glib-2.40.2/Android.mk
2 --- glibref/glib-2.40.2/Android.mk      1970-01-01 09:00:00.000000000 +0900
3 +++ glibpatch/glib-2.40.2/Android.mk    2015-04-01 13:20:38.597557242 +0900
4 @@ -0,0 +1,14 @@
5 +#GLIB Android Makefile to build GLIB modules
6 +
7 +LOCAL_PATH     := $(call my-dir)
8 +GLIB_MAIN_DIR  := $(LOCAL_PATH)
9 +
10 +GLIB_C_INCLUDES        := $(GLIB_MAIN_DIR) \
11 +                  $(GLIB_MAIN_DIR)/glib
12 +
13 +GTHREAD_C_INCLUDES     := $(GLIB_MAIN_DIR) \
14 +                          $(GLIB_MAIN_DIR)/gthread
15 +
16 +include $(GLIB_MAIN_DIR)/glib/Android.mk
17 +include $(GLIB_MAIN_DIR)/gthread/Android.mk
18 +
19 diff -rupN glibref/glib-2.40.2/config.h glibpatch/glib-2.40.2/config.h
20 --- glibref/glib-2.40.2/config.h        2015-03-31 16:25:56.882894898 +0900
21 +++ glibpatch/glib-2.40.2/config.h      2015-04-01 13:21:19.593558693 +0900
22 @@ -31,8 +31,9 @@
23  /* #undef ENABLE_GC_FRIENDLY_DEFAULT */
24  
25  /* always defined to indicate that i18n is enabled */
26 +#ifndef _GLIB_ANDROID_
27  #define ENABLE_NLS 1
28 -
29 +#endif /* _GLIB_ANDROID__ */
30  /* Define the gettext package to be used */
31  #define GETTEXT_PACKAGE "glib20"
32  
33 @@ -100,8 +101,9 @@
34  /* #undef HAVE_COCOA */
35  
36  /* Have nl_langinfo (CODESET) */
37 +#ifndef _GLIB_ANDROID_
38  #define HAVE_CODESET 1
39 -
40 +#endif /* _GLIB_ANDROID_ */
41  /* Define to 1 if you have the <crt_externs.h> header file. */
42  /* #undef HAVE_CRT_EXTERNS_H */
43  
44 @@ -130,8 +132,10 @@
45  /* we have the eventfd(2) system call */
46  #define HAVE_EVENTFD 1
47  
48 +#ifndef _GLIB_ANDROID_
49  /* Define to 1 if you have the `fallocate' function. */
50  #define HAVE_FALLOCATE 1
51 +#endif /* _GLIB_ANDROID_ */
52  
53  /* Define if we have FAM */
54  /* #undef HAVE_FAM */
55 @@ -224,6 +228,7 @@
56  /* Define to 1 if you have the `kqueue' function. */
57  /* #undef HAVE_KQUEUE */
58  
59 +#ifndef _GLIB_ANDROID_
60  /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
61  #define HAVE_LANGINFO_CODESET 1
62  
63 @@ -232,6 +237,7 @@
64  
65  /* Have nl_langinfo (PM_STR) */
66  #define HAVE_LANGINFO_TIME 1
67 +#endif /* _GLIB_ANDROID_ */
68  
69  /* Define to 1 if you have the `lchmod' function. */
70  /* #undef HAVE_LCHMOD */
71 @@ -283,9 +289,10 @@
72  
73  /* Define to 1 if you have the <memory.h> header file. */
74  #define HAVE_MEMORY_H 1
75 -
76 +#ifndef _GLIB_ANDROID_
77  /* Define to 1 if you have the `mmap' function. */
78  #define HAVE_MMAP 1
79 +#endif /* _GLIB_ANDROID_ */
80  
81  /* Define to 1 if you have the <mntent.h> header file. */
82  #define HAVE_MNTENT_H 1
83 @@ -317,8 +324,10 @@
84  /* Have POSIX function getgrgid_r */
85  #define HAVE_POSIX_GETGRGID_R 1
86  
87 +#ifndef _GLIB_ANDROID_
88  /* Have POSIX function getpwuid_r */
89  #define HAVE_POSIX_GETPWUID_R 1
90 +#endif /* _GLIB_ANDROID_ */
91  
92  /* Define to 1 if you have the `posix_memalign' function. */
93  #define HAVE_POSIX_MEMALIGN 1
94 @@ -333,8 +342,11 @@
95  #define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
96  
97  /* Have function pthread_cond_timedwait_relative_np */
98 +#ifndef _GLIB_ANDROID_
99  /* #undef HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP */
100 -
101 +#else
102 +#define HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP 0
103 +#endif /* _GLIB_ANDROID_ */
104  /* Define to 1 if the system has the type `ptrdiff_t'. */
105  #define HAVE_PTRDIFF_T 1
106  
107 @@ -384,8 +396,10 @@
108  /* Define to 1 if you have the <stdlib.h> header file. */
109  #define HAVE_STDLIB_H 1
110  
111 +#ifndef _GLIB_ANDROID_
112  /* Define to 1 if you have the `stpcpy' function. */
113  #define HAVE_STPCPY 1
114 +#endif /* _GLIB_ANDROID_ */
115  
116  /* Define to 1 if you have the `strcasecmp' function. */
117  #define HAVE_STRCASECMP 1
118 @@ -532,10 +546,10 @@
119  
120  /* Define to 1 if you have the <sys/xattr.h> header file. */
121  #define HAVE_SYS_XATTR_H 1
122 -
123 +#ifndef _GLIB_ANDROID_
124  /* Define to 1 if you have the `timegm' function. */
125  #define HAVE_TIMEGM 1
126 -
127 +#endif /* _GLIB_ANDROID_ */
128  /* Define to 1 if you have the <unistd.h> header file. */
129  #define HAVE_UNISTD_H 1
130  
131 @@ -563,7 +577,7 @@
132  
133  /* Define to 1 if you have the `vsnprintf' function. */
134  #define HAVE_VSNPRINTF 1
135 -
136 +#ifndef _GLIB_ANDROID_
137  /* Define if you have the 'wchar_t' type. */
138  #define HAVE_WCHAR_T 1
139  
140 @@ -575,12 +589,14 @@
141  
142  /* Define to 1 if xattr is available */
143  #define HAVE_XATTR 1
144 -
145 +#endif
146  /* Define to 1 if xattr API uses XATTR_NOFOLLOW */
147  /* #undef HAVE_XATTR_NOFOLLOW */
148  
149  /* Define to 1 if you have the <xlocale.h> header file. */
150 +#ifndef _GLIB_ANDROID_
151  #define HAVE_XLOCALE_H 1
152 +#endif /* _GLIB_ANDROID_ */
153  
154  /* Define to 1 if you have the `_NSGetEnviron' function. */
155  /* #undef HAVE__NSGETENVIRON */
156 diff -rupN glibref/glib-2.40.2/glib/Android.mk glibpatch/glib-2.40.2/glib/Android.mk
157 --- glibref/glib-2.40.2/glib/Android.mk 1970-01-01 09:00:00.000000000 +0900
158 +++ glibpatch/glib-2.40.2/glib/Android.mk       2015-03-31 17:10:22.722989176 +0900
159 @@ -0,0 +1,115 @@
160 +#glib Android Make File
161 +
162 +LOCAL_PATH             := $(call my-dir)
163 +
164 +include $(CLEAR_VARS)
165 +
166 +LOCAL_MODULE   := glib-2.40.2
167 +
168 +LOCAL_SRC_FILES        := \
169 +    libcharset/localcharset.c \
170 +    garray.c        \
171 +    gasyncqueue.c   \
172 +    gatomic.c       \
173 +    gbacktrace.c    \
174 +    gbase64.c       \
175 +    gbitlock.c      \
176 +    gbookmarkfile.c \
177 +    gbytes.c       \
178 +    gcharset.c      \
179 +    gchecksum.c     \
180 +    gconvert.c      \
181 +    gdataset.c      \
182 +    gdate.c         \
183 +    gdatetime.c     \
184 +    gdir.c          \
185 +    gerror.c        \
186 +    genviron.c      \
187 +    gfileutils.c    \
188 +    ggettext.c     \
189 +    ghash.c         \
190 +    ghmac.c         \
191 +    ghook.c         \
192 +    ghostutils.c    \
193 +    giochannel.c    \
194 +    gkeyfile.c      \
195 +    glib-init.c            \
196 +    glib-private.c  \
197 +    glib-unix.c     \
198 +    glist.c         \
199 +    gmain.c         \
200 +    gmappedfile.c   \
201 +    gmarkup.c       \
202 +    gmem.c          \
203 +    gmessages.c     \
204 +    gnode.c         \
205 +    goption.c       \
206 +    gpattern.c      \
207 +    gpoll.c         \
208 +    gprimes.c       \
209 +    gqsort.c        \
210 +    gquark.c        \
211 +    gqueue.c        \
212 +    grand.c         \
213 +    gregex.c        \
214 +    gscanner.c      \
215 +    gsequence.c     \
216 +    gshell.c        \
217 +    gslice.c        \
218 +    gslist.c        \
219 +    gstdio.c        \
220 +    gstrfuncs.c     \
221 +    gstring.c       \
222 +    gstringchunk.c  \
223 +    gtestutils.c    \
224 +    gthread.c       \
225 +    gthreadpool.c   \
226 +    gthread-posix.c \
227 +    gtimer.c        \
228 +    gtimezone.c     \
229 +    gtranslit.c     \
230 +    gtrashstack.c   \
231 +    gtree.c         \
232 +    guniprop.c      \
233 +    gutf8.c         \
234 +    gunibreak.c     \
235 +    gunicollate.c   \
236 +    gunidecomp.c    \
237 +    gurifuncs.c     \
238 +    gutils.c        \
239 +    gvariant.c      \
240 +    gvariant-core.c \
241 +    gvariant-parser.c \
242 +    gvariant-serialiser.c \
243 +    gvarianttypeinfo.c \
244 +    gvarianttype.c  \
245 +    gprintf.c       \
246 +    giounix.c       \
247 +    gspawn.c        \
248 +    gversion.c      \
249 +    gwakeup.c
250 +
251 +LOCAL_C_INCLUDES := $(GLIB_MAIN_DIR) \
252 +                   $(GLIB_MAIN_DIR)/glib \
253 +                   $(GLIB_MAIN_DIR)/glib/deprecated \
254 +                   $(GLIB_MAIN_DIR)/glib/libcharset \
255 +                   $(GLIB_MAIN_DIR)/pcre \
256 +
257 +LOCAL_STATIC_LIBRARIES := pcre
258 +
259 +LOCAL_LD_LIBS := -llog
260 +
261 +LOCAL_CFLAGS   := \
262 +       -D_GLIB_ANDROID_ \
263 +       -DLIBDIR=\"$(libdir)\" \
264 +       -DHAVE_CONFIG_H \
265 +       -DG_LOG_DOMAIN=\"GLib\" \
266 +       -DGLIB_COMPILATION \
267 +       -DPCRE_STATIC \
268 +       -DG_DISABLE_CAST_CHECKS
269 +
270 +include $(BUILD_SHARED_LIBRARY)
271 +
272 +include        $(GLIB_MAIN_DIR)/glib/pcre/Android.mk
273 +
274 +
275 diff -rupN glibref/glib-2.40.2/glib/gconvert.c glibpatch/glib-2.40.2/glib/gconvert.c
276 --- glibref/glib-2.40.2/glib/gconvert.c 2015-03-31 16:25:56.946894901 +0900
277 +++ glibpatch/glib-2.40.2/glib/gconvert.c       2015-03-31 16:40:50.546926503 +0900
278 @@ -22,7 +22,11 @@
279  #include "glibconfig.h"
280  
281  #ifndef G_OS_WIN32
282 +
283 +#ifndef _GLIB_ANDROID_
284  #include <iconv.h>
285 +#endif /* _GLIB_ANDROID_ */
286 +
287  #endif
288  #include <errno.h>
289  #include <stdio.h>
290 @@ -168,6 +172,7 @@
291  
292  G_DEFINE_QUARK (g_convert_error, g_convert_error)
293  
294 +#ifndef _GLIB_ANDROID_
295  static gboolean
296  try_conversion (const char *to_codeset,
297                 const char *from_codeset,
298 @@ -197,9 +202,9 @@ try_to_aliases (const char **to_aliases,
299           p++;
300         }
301      }
302 -
303    return FALSE;
304  }
305 +#endif /* _GLIB_ANDROID_ */
306  
307  /**
308   * g_iconv_open:
309 @@ -220,6 +225,7 @@ GIConv
310  g_iconv_open (const gchar  *to_codeset,
311               const gchar  *from_codeset)
312  {
313 +#ifndef _GLIB_ANDROID_
314    iconv_t cd;
315    
316    if (!try_conversion (to_codeset, from_codeset, &cd))
317 @@ -248,6 +254,9 @@ g_iconv_open (const gchar  *to_codeset,
318  
319   out:
320    return (cd == (iconv_t)-1) ? (GIConv)-1 : (GIConv)cd;
321 +#else
322 +  return (GIConv)-1;
323 +#endif /* _GLIB_ANDROID_ */
324  }
325  
326  /**
327 @@ -274,9 +283,13 @@ g_iconv (GIConv   converter,
328          gchar  **outbuf,
329          gsize   *outbytes_left)
330  {
331 +#ifndef _GLIB_ANDROID_
332    iconv_t cd = (iconv_t)converter;
333  
334    return iconv (cd, inbuf, inbytes_left, outbuf, outbytes_left);
335 +#else
336 +  return -1;
337 +#endif /* _GLIB_ANDROID_ */
338  }
339  
340  /**
341 @@ -297,9 +310,13 @@ g_iconv (GIConv   converter,
342  gint
343  g_iconv_close (GIConv converter)
344  {
345 +#ifndef _GLIB_ANDROID_
346    iconv_t cd = (iconv_t)converter;
347  
348    return iconv_close (cd);
349 +#else
350 +  return -1;
351 +#endif /* _GLIB_ANDROID_ */
352  }
353  
354  static GIConv
355 diff -rupN glibref/glib-2.40.2/glib/gfileutils.c glibpatch/glib-2.40.2/glib/gfileutils.c
356 --- glibref/glib-2.40.2/glib/gfileutils.c       2015-03-31 16:25:57.170894910 +0900
357 +++ glibpatch/glib-2.40.2/glib/gfileutils.c     2015-03-31 16:37:29.594919396 +0900
358 @@ -54,7 +54,9 @@
359  
360  #ifdef HAVE_LINUX_MAGIC_H /* for btrfs check */
361  #include <linux/magic.h>
362 +#ifndef _GLIB_ANDROID_
363  #include <sys/vfs.h>
364 +#endif /* _GLIB_ANDROID_ */
365  #endif
366  
367  
368 diff -rupN glibref/glib-2.40.2/glib/ggettext.c glibpatch/glib-2.40.2/glib/ggettext.c
369 --- glibref/glib-2.40.2/glib/ggettext.c 2015-03-31 16:25:57.182894907 +0900
370 +++ glibpatch/glib-2.40.2/glib/ggettext.c       2015-03-31 16:37:55.538920314 +0900
371 @@ -40,7 +40,10 @@
372  
373  #include <string.h>
374  #include <locale.h>
375 +
376 +#ifndef _GLIB_ANDROID_
377  #include <libintl.h>
378 +#endif /* _GLIB_ANDROID_ */
379  
380  #ifdef G_OS_WIN32
381  
382 diff -rupN glibref/glib-2.40.2/glib/glibconfig.h glibpatch/glib-2.40.2/glib/glibconfig.h
383 --- glibref/glib-2.40.2/glib/glibconfig.h       2015-03-31 16:25:57.166894909 +0900
384 +++ glibpatch/glib-2.40.2/glib/glibconfig.h     2015-03-31 16:38:06.954920717 +0900
385 @@ -154,7 +154,9 @@ typedef unsigned int guintptr;
386  #define G_THREADS_ENABLED
387  #define G_THREADS_IMPL_POSIX
388  
389 +#ifndef _GLIB_ANDROID_
390  #define G_ATOMIC_LOCK_FREE
391 +#endif /* _GLIB_ANDROID_ */
392  
393  #define GINT16_TO_LE(val)      ((gint16) (val))
394  #define GUINT16_TO_LE(val)     ((guint16) (val))
395 diff -rupN glibref/glib-2.40.2/glib/gslice.c glibpatch/glib-2.40.2/glib/gslice.c
396 --- glibref/glib-2.40.2/glib/gslice.c   2015-03-31 16:25:56.946894901 +0900
397 +++ glibpatch/glib-2.40.2/glib/gslice.c 2015-03-31 16:38:38.302921827 +0900
398 @@ -388,7 +388,9 @@ slice_config_init (SliceConfig *config)
399         * This way it's possible to force gslice to be enabled under
400         * valgrind just by setting G_SLICE to the empty string.
401         */
402 + #ifndef _GLIB_ANDROID_
403        if (RUNNING_ON_VALGRIND)
404 +#endif /* _GLIB_ANDROID_ */
405          config->always_malloc = TRUE;
406      }
407  }
408 diff -rupN glibref/glib-2.40.2/glib/gstrfuncs.c glibpatch/glib-2.40.2/glib/gstrfuncs.c
409 --- glibref/glib-2.40.2/glib/gstrfuncs.c        2015-03-31 16:25:56.950894901 +0900
410 +++ glibpatch/glib-2.40.2/glib/gstrfuncs.c      2015-03-31 16:39:00.154922598 +0900
411 @@ -309,6 +309,7 @@ static const guint16 ascii_table_data[25
412  
413  const guint16 * const g_ascii_table = ascii_table_data;
414  
415 +#ifndef _GLIB_ANDROID_
416  #if defined (HAVE_NEWLOCALE) && \
417      defined (HAVE_USELOCALE) && \
418      defined (HAVE_STRTOD_L) && \
419 @@ -316,6 +317,7 @@ const guint16 * const g_ascii_table = as
420      defined (HAVE_STRTOLL_L)
421  #define USE_XLOCALE 1
422  #endif
423 +#endif /* _GLIB_ANDROID_ */
424  
425  #ifdef USE_XLOCALE
426  static locale_t
427 diff -rupN glibref/glib-2.40.2/glib/pcre/Android.mk glibpatch/glib-2.40.2/glib/pcre/Android.mk
428 --- glibref/glib-2.40.2/glib/pcre/Android.mk    1970-01-01 09:00:00.000000000 +0900
429 +++ glibpatch/glib-2.40.2/glib/pcre/Android.mk  2015-01-13 08:04:00.000000000 +0900
430 @@ -0,0 +1,42 @@
431 +#libpcre Android Make File
432 +
433 +LOCAL_PATH             := $(call my-dir)
434 +
435 +include $(CLEAR_VARS)
436 +
437 +LOCAL_MODULE   := pcre
438 +
439 +LOCAL_LD_LIBS := -llog
440 +
441 +LOCAL_CFLAGS   := \
442 +       -DG_LOG_DOMAIN=\"GLib-GRegex\" \
443 +       -DHAVE_CONFIG_H \
444 +       -DHAVE_MEMMOVE \
445 +       -DSUPPORT_UCP \
446 +       -DSUPPORT_UTF \
447 +       -DSUPPORT_UTF8 \
448 +       -DNEWLINE=-1 \
449 +       -DMATCH_LIMIT=10000000 \
450 +       -DMATCH_LIMIT_RECURSION=8192 \
451 +       -DMAX_NAME_SIZE=32 \
452 +       -DMAX_NAME_COUNT=10000 \
453 +       -DMAX_DUPLENGTH=30000 \
454 +       -DLINK_SIZE=2 \
455 +       -DPOSIX_MALLOC_THRESHOLD=10 \
456 +       -DPCRE_STATIC \
457 +       -DG_DISABLE_CAST_CHECKS \
458 +       -DGLIB_COMPILATION \
459 +       -D_GLIB_ANDROID_
460 +
461 +LOCAL_SRC_FILES        :=      pcre_xclass.c pcre_valid_utf8.c pcre_tables.c \
462 +                                       pcre_study.c pcre_string_utils.c pcre_ord2utf8.c \
463 +                                       pcre_newline.c pcre_jit_compile.c pcre_globals.c \
464 +                                       pcre_get.c pcre_fullinfo.c pcre_exec.c \
465 +                                       pcre_dfa_exec.c pcre_config.c pcre_compile.c \
466 +                                       pcre_chartables.c pcre_byte_order.c
467 +
468 +LOCAL_C_INCLUDES := $(GLIB_MAIN_DIR) \
469 +                                       $(GLIB_MAIN_DIR)/glib
470 +
471 +
472 +include $(BUILD_STATIC_LIBRARY)
473 \ No newline at end of file
474 diff -rupN glibref/glib-2.40.2/gthread/Android.mk glibpatch/glib-2.40.2/gthread/Android.mk
475 --- glibref/glib-2.40.2/gthread/Android.mk      1970-01-01 09:00:00.000000000 +0900
476 +++ glibpatch/glib-2.40.2/gthread/Android.mk    2015-03-31 17:11:02.782990592 +0900
477 @@ -0,0 +1,25 @@
478 +#gthread Android Make File
479 +
480 +LOCAL_PATH             := $(call my-dir)
481 +
482 +include $(CLEAR_VARS)
483 +
484 +LOCAL_MODULE   := gthread-2.40.2
485 +
486 +LOCAL_SRC_FILES        :=      gthread-impl.c
487 +
488 +LOCAL_C_INCLUDES := $(GLIB_MAIN_DIR) \
489 +       $(GLIB_MAIN_DIR)/glib \
490 +       $(GLIB_MAIN_DIR)/gthread
491 +
492 +
493 +LOCAL_CFLAGS   := \
494 +       -DG_LOG_DOMAIN=\"GThread\" \
495 +       -DHAVE_CONFIG_H \
496 +       -DG_DISABLE_CAST_CHECKS \
497 +       -DG_DISABLE_DEPRECATED \
498 +       -D_GLIB_ANDROID_
499 +
500 +
501 +LOCAL_SHARED_LIBRARIES := glib-2.40.2
502 +include $(BUILD_SHARED_LIBRARY)
503 \ No newline at end of file