Rename SendResponse to SendDirectStackResponse in ocstack.c
[platform/upstream/iotivity.git] / resource / csdk / connectivity / lib / android / patches / glib-2.40.2-x64-withoutMakefile.patch
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
4 @@ -8,10 +8,10 @@
5  #define ALIGNOF_GUINT32 4
6  
7  /* The normal alignment of `guint64', in bytes. */
8 -#define ALIGNOF_GUINT64 8
9 +#define ALIGNOF_GUINT64 4
10  
11  /* The normal alignment of `unsigned long', in bytes. */
12 -#define ALIGNOF_UNSIGNED_LONG 8
13 +#define ALIGNOF_UNSIGNED_LONG 4
14  
15  /* poll doesn't work on devices */
16  /* #undef BROKEN_POLL */
17 @@ -31,8 +31,9 @@
18  /* #undef ENABLE_GC_FRIENDLY_DEFAULT */
19  
20  /* always defined to indicate that i18n is enabled */
21 +#ifndef _GLIB_ANDROID_
22  #define ENABLE_NLS 1
23 -
24 +#endif /* _GLIB_ANDROID__ */
25  /* Define the gettext package to be used */
26  #define GETTEXT_PACKAGE "glib20"
27  
28 @@ -100,8 +101,9 @@
29  /* #undef HAVE_COCOA */
30  
31  /* Have nl_langinfo (CODESET) */
32 +#ifndef _GLIB_ANDROID_
33  #define HAVE_CODESET 1
34 -
35 +#endif /* _GLIB_ANDROID_ */
36  /* Define to 1 if you have the <crt_externs.h> header file. */
37  /* #undef HAVE_CRT_EXTERNS_H */
38  
39 @@ -130,8 +132,10 @@
40  /* we have the eventfd(2) system call */
41  #define HAVE_EVENTFD 1
42  
43 +#ifndef _GLIB_ANDROID_
44  /* Define to 1 if you have the `fallocate' function. */
45  #define HAVE_FALLOCATE 1
46 +#endif /* _GLIB_ANDROID_ */
47  
48  /* Define if we have FAM */
49  /* #undef HAVE_FAM */
50 @@ -224,6 +228,7 @@
51  /* Define to 1 if you have the `kqueue' function. */
52  /* #undef HAVE_KQUEUE */
53  
54 +#ifndef _GLIB_ANDROID_
55  /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
56  #define HAVE_LANGINFO_CODESET 1
57  
58 @@ -232,6 +237,7 @@
59  
60  /* Have nl_langinfo (PM_STR) */
61  #define HAVE_LANGINFO_TIME 1
62 +#endif /* _GLIB_ANDROID_ */
63  
64  /* Define to 1 if you have the `lchmod' function. */
65  /* #undef HAVE_LCHMOD */
66 @@ -283,9 +289,10 @@
67  
68  /* Define to 1 if you have the <memory.h> header file. */
69  #define HAVE_MEMORY_H 1
70 -
71 +#ifndef _GLIB_ANDROID_
72  /* Define to 1 if you have the `mmap' function. */
73  #define HAVE_MMAP 1
74 +#endif /* _GLIB_ANDROID_ */
75  
76  /* Define to 1 if you have the <mntent.h> header file. */
77  #define HAVE_MNTENT_H 1
78 @@ -317,8 +324,10 @@
79  /* Have POSIX function getgrgid_r */
80  #define HAVE_POSIX_GETGRGID_R 1
81  
82 +#ifndef _GLIB_ANDROID_
83  /* Have POSIX function getpwuid_r */
84  #define HAVE_POSIX_GETPWUID_R 1
85 +#endif /* _GLIB_ANDROID_ */
86  
87  /* Define to 1 if you have the `posix_memalign' function. */
88  #define HAVE_POSIX_MEMALIGN 1
89 @@ -333,8 +342,11 @@
90  #define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
91  
92  /* Have function pthread_cond_timedwait_relative_np */
93 +#ifndef _GLIB_ANDROID_
94  /* #undef HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP */
95 -
96 +#else
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
101  
102 @@ -384,8 +396,10 @@
103  /* Define to 1 if you have the <stdlib.h> header file. */
104  #define HAVE_STDLIB_H 1
105  
106 +#ifndef _GLIB_ANDROID_
107  /* Define to 1 if you have the `stpcpy' function. */
108  #define HAVE_STPCPY 1
109 +#endif /* _GLIB_ANDROID_ */
110  
111  /* Define to 1 if you have the `strcasecmp' function. */
112  #define HAVE_STRCASECMP 1
113 @@ -532,10 +546,10 @@
114  
115  /* Define to 1 if you have the <sys/xattr.h> header file. */
116  #define HAVE_SYS_XATTR_H 1
117 -
118 +#ifndef _GLIB_ANDROID_
119  /* Define to 1 if you have the `timegm' function. */
120  #define HAVE_TIMEGM 1
121 -
122 +#endif /* _GLIB_ANDROID_ */
123  /* Define to 1 if you have the <unistd.h> header file. */
124  #define HAVE_UNISTD_H 1
125  
126 @@ -563,7 +577,7 @@
127  
128  /* Define to 1 if you have the `vsnprintf' function. */
129  #define HAVE_VSNPRINTF 1
130 -
131 +#ifndef _GLIB_ANDROID_
132  /* Define if you have the 'wchar_t' type. */
133  #define HAVE_WCHAR_T 1
134  
135 @@ -575,12 +589,14 @@
136  
137  /* Define to 1 if xattr is available */
138  #define HAVE_XATTR 1
139 -
140 +#endif
141  /* Define to 1 if xattr API uses XATTR_NOFOLLOW */
142  /* #undef HAVE_XATTR_NOFOLLOW */
143  
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_ */
148  
149  /* Define to 1 if you have the `_NSGetEnviron' function. */
150  /* #undef HAVE__NSGETENVIRON */
151 @@ -628,7 +644,7 @@
152  #define SIZEOF_INT 4
153  
154  /* The size of `long', as computed by sizeof. */
155 -#define SIZEOF_LONG 8
156 +#define SIZEOF_LONG 4
157  
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
162  
163  /* The size of `size_t', as computed by sizeof. */
164 -#define SIZEOF_SIZE_T 8
165 +#define SIZEOF_SIZE_T 4
166  
167  /* The size of `ssize_t', as computed by sizeof. */
168 -#define SIZEOF_SSIZE_T 8
169 +#define SIZEOF_SSIZE_T 4
170  
171  /* The size of `void *', as computed by sizeof. */
172 -#define SIZEOF_VOID_P 8
173 +#define SIZEOF_VOID_P 4
174  
175  /* The size of `__int64', as computed by sizeof. */
176  #define SIZEOF___INT64 0
177 @@ -720,13 +736,8 @@
178  # endif
179  #endif
180  
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
184 -#endif
185 -
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
189  
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
195 @@ -22,7 +22,11 @@
196  #include "glibconfig.h"
197  
198  #ifndef G_OS_WIN32
199 +
200 +#ifndef _GLIB_ANDROID_
201  #include <iconv.h>
202 +#endif /* _GLIB_ANDROID_ */
203 +
204  #endif
205  #include <errno.h>
206  #include <stdio.h>
207 @@ -168,6 +172,7 @@
208  
209  G_DEFINE_QUARK (g_convert_error, g_convert_error)
210  
211 +#ifndef _GLIB_ANDROID_
212  static gboolean
213  try_conversion (const char *to_codeset,
214                 const char *from_codeset,
215 @@ -200,6 +205,7 @@ try_to_aliases (const char **to_aliases,
216  
217    return FALSE;
218  }
219 +#endif /* _GLIB_ANDROID_ */
220  
221  /**
222   * g_iconv_open:
223 @@ -220,6 +226,7 @@ GIConv
224  g_iconv_open (const gchar  *to_codeset,
225               const gchar  *from_codeset)
226  {
227 +#ifndef _GLIB_ANDROID_
228    iconv_t cd;
229    
230    if (!try_conversion (to_codeset, from_codeset, &cd))
231 @@ -248,6 +255,9 @@ g_iconv_open (const gchar  *to_codeset,
232  
233   out:
234    return (cd == (iconv_t)-1) ? (GIConv)-1 : (GIConv)cd;
235 +#else
236 +  return (GIConv)-1;
237 +#endif /* _GLIB_ANDROID_ */
238  }
239  
240  /**
241 @@ -274,9 +284,13 @@ g_iconv (GIConv   converter,
242          gchar  **outbuf,
243          gsize   *outbytes_left)
244  {
245 +#ifndef _GLIB_ANDROID_
246    iconv_t cd = (iconv_t)converter;
247  
248    return iconv (cd, inbuf, inbytes_left, outbuf, outbytes_left);
249 +#else
250 +  return -1;
251 +#endif /* _GLIB_ANDROID_ */
252  }
253  
254  /**
255 @@ -297,9 +311,13 @@ g_iconv (GIConv   converter,
256  gint
257  g_iconv_close (GIConv converter)
258  {
259 +#ifndef _GLIB_ANDROID_
260    iconv_t cd = (iconv_t)converter;
261  
262    return iconv_close (cd);
263 +#else
264 +  return -1;
265 +#endif /* _GLIB_ANDROID_ */
266  }
267  
268  static GIConv
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
272 @@ -54,7 +54,7 @@
273  
274  #ifdef HAVE_LINUX_MAGIC_H /* for btrfs check */
275  #include <linux/magic.h>
276 -#include <sys/vfs.h>
277 +//#include <sys/vfs.h>
278  #endif
279  
280  
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
284 @@ -40,7 +40,10 @@
285  
286  #include <string.h>
287  #include <locale.h>
288 +
289 +#ifndef _GLIB_ANDROID_
290  #include <libintl.h>
291 +#endif /* _GLIB_ANDROID_ */
292  
293  #ifdef G_OS_WIN32
294  
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 */
301  
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;
306  
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"
312 -
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
317 -
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"
324 -
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"
333 +
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
338 +
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"
345 +
346 +#define G_MAXSIZE      G_MAXUINT
347 +#define G_MINSSIZE     G_MININT
348 +#define G_MAXSSIZE     G_MAXINT
349  
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)
354  
355  
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))
360  
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))
365  
366 -typedef signed long gintptr;
367 -typedef unsigned long guintptr;
368 +typedef signed int gintptr;
369 +typedef unsigned int guintptr;
370  
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;
381  
382  
383  #define G_VA_COPY      va_copy
384 -#define G_VA_COPY_AS_ARRAY 1
385  
386  #ifdef __cplusplus
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
391  
392 +#ifndef _GLIB_ANDROID_
393  #define G_ATOMIC_LOCK_FREE
394 +#endif /* _GLIB_ANDROID_ */
395  
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
423  
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.
431         */
432 + #if 0
433        if (RUNNING_ON_VALGRIND)
434 +#endif   
435          config->always_malloc = TRUE;
436      }
437  }
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
442  
443  const guint16 * const g_ascii_table = ascii_table_data;
444  
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
452  #endif
453 +#endif /* _GLIB_ANDROID_ */
454  
455  #ifdef USE_XLOCALE
456  static locale_t