source: gs2-extensions/gnome-lib/trunk/src/packages/android-patches/glib-android.patch

Last change on this file was 26787, checked in by davidb, 11 years ago

Files that patch code fro Android NDK

File size: 9.9 KB
  • .28.1/glib/gstrfuncs.c

    old new g_ascii_strtod (const gchar *nptr,  
    442442
    443443  fail_pos = NULL;
    444444
     445#ifdef __ANDROID__
     446  decimal_point = ".";
     447#else
    445448  locale_data = localeconv ();
    446449  decimal_point = locale_data->decimal_point;
     450#endif
    447451  decimal_point_len = strlen (decimal_point);
    448452
    449453  g_assert (decimal_point_len != 0);
    g_ascii_formatd (gchar *buffer,  
    656660
    657661  _g_snprintf (buffer, buf_len, format, d);
    658662
     663#ifdef __ANDROID__
     664  decimal_point = ".";
     665#else
    659666  locale_data = localeconv ();
    660667  decimal_point = locale_data->decimal_point;
     668#endif
    661669  decimal_point_len = strlen (decimal_point);
    662670
    663671  g_assert (decimal_point_len != 0);
  • .28.1/glib/gutils.c

    old new  
    2929 */
    3030
    3131#include "config.h"
     32#ifdef __ANDROID__
     33#undef HAVE_PWD_H
     34#endif
    3235
    3336#ifdef HAVE_UNISTD_H
    3437#include <unistd.h>
  • .28.1/gio/libasyncns/asyncns.c

    old new  
    1818  <http://www.gnu.org/licenses/>.
    1919***/
    2020
     21#ifdef __ANDROID__
     22typedef struct {
     23    unsigned    id :16;     /*%< query identification number */
     24            /* fields in third byte */
     25    unsigned    rd :1;      /*%< recursion desired */
     26    unsigned    tc :1;      /*%< truncated message */
     27    unsigned    aa :1;      /*%< authoritive answer */
     28    unsigned    opcode :4;  /*%< purpose of message */
     29    unsigned    qr :1;      /*%< response flag */
     30            /* fields in fourth byte */
     31    unsigned    rcode :4;   /*%< response code */
     32    unsigned    cd: 1;      /*%< checking disabled by resolver */
     33    unsigned    ad: 1;      /*%< authentic data from named */
     34    unsigned    unused :1;  /*%< unused bits (MBZ as of 4.9.3a3) */
     35    unsigned    ra :1;      /*%< recursion available */
     36            /* remaining bytes */
     37    unsigned    qdcount :16;    /*%< number of question entries */
     38    unsigned    ancount :16;    /*%< number of answer entries */
     39    unsigned    nscount :16;    /*%< number of authority entries */
     40    unsigned    arcount :16;    /*%< number of resource entries */
     41} HEADER;
     42#endif
     43
     44
    2145#ifdef HAVE_CONFIG_H
    2246#include "g-asyncns.h"
    2347#endif
     
    5781#include <inttypes.h>
    5882#endif
    5983
     84#ifdef __ANDROID__
     85#undef HAVE_SYS_PRCTL_H
     86#endif
     87
    6088#ifdef HAVE_SYS_PRCTL_H
    6189#include <sys/prctl.h>
    6290#endif
  • .28.1/gio/gresolver.c

    old new  
    2020 * Boston, MA 02111-1307, USA.
    2121 */
    2222
     23#ifdef __ANDROID__
     24/*%
     25 * Inline versions of get/put short/long.  Pointer is advanced.
     26 */
     27#define NS_INT32SZ  4   /*%< #/bytes of data in a u_int32_t */
     28#define NS_INT16SZ  2   /*%< #/bytes of data in a u_int16_t */
     29#define NS_GET16(s, cp) do { \
     30    register const u_char *t_cp = (const u_char *)(cp); \
     31    (s) = ((u_int16_t)t_cp[0] << 8) \
     32        | ((u_int16_t)t_cp[1]) \
     33        ; \
     34    (cp) += NS_INT16SZ; \
     35} while (0)
     36#define NS_GET32(l, cp) do { \
     37    register const u_char *t_cp = (const u_char *)(cp); \
     38    (l) = ((u_int32_t)t_cp[0] << 24) \
     39        | ((u_int32_t)t_cp[1] << 16) \
     40        | ((u_int32_t)t_cp[2] << 8) \
     41        | ((u_int32_t)t_cp[3]) \
     42        ; \
     43    (cp) += NS_INT32SZ; \
     44} while (0)
     45
     46
     47#define GETSHORT        NS_GET16
     48#define GETLONG         NS_GET32
     49
     50#define ns_c_in     1   /*%< Internet. */
     51#define ns_t_srv    33  /*%< Internet. */
     52#define C_IN        ns_c_in
     53#define T_SRV       ns_t_srv
     54
     55typedef struct {
     56    unsigned    id :16;     /*%< query identification number */
     57            /* fields in third byte */
     58    unsigned    rd :1;      /*%< recursion desired */
     59    unsigned    tc :1;      /*%< truncated message */
     60    unsigned    aa :1;      /*%< authoritive answer */
     61    unsigned    opcode :4;  /*%< purpose of message */
     62    unsigned    qr :1;      /*%< response flag */
     63            /* fields in fourth byte */
     64    unsigned    rcode :4;   /*%< response code */
     65    unsigned    cd: 1;      /*%< checking disabled by resolver */
     66    unsigned    ad: 1;      /*%< authentic data from named */
     67    unsigned    unused :1;  /*%< unused bits (MBZ as of 4.9.3a3) */
     68    unsigned    ra :1;      /*%< recursion available */
     69            /* remaining bytes */
     70    unsigned    qdcount :16;    /*%< number of question entries */
     71    unsigned    ancount :16;    /*%< number of answer entries */
     72    unsigned    nscount :16;    /*%< number of authority entries */
     73    unsigned    arcount :16;    /*%< number of resource entries */
     74} HEADER;
     75#endif
     76
     77
    2378#include "config.h"
    2479#include <glib.h>
    2580#include "glibintl.h"
  • .28.1/gio/gthreadedresolver.c

    old new  
    2020 * Boston, MA 02111-1307, USA.
    2121 */
    2222
     23#ifdef __ANDROID__
     24/*%
     25 * Inline versions of get/put short/long.  Pointer is advanced.
     26 */
     27#define NS_INT32SZ  4   /*%< #/bytes of data in a u_int32_t */
     28#define NS_INT16SZ  2   /*%< #/bytes of data in a u_int16_t */
     29#define NS_GET16(s, cp) do { \
     30    register const u_char *t_cp = (const u_char *)(cp); \
     31    (s) = ((u_int16_t)t_cp[0] << 8) \
     32        | ((u_int16_t)t_cp[1]) \
     33        ; \
     34    (cp) += NS_INT16SZ; \
     35} while (0)
     36#define NS_GET32(l, cp) do { \
     37    register const u_char *t_cp = (const u_char *)(cp); \
     38    (l) = ((u_int32_t)t_cp[0] << 24) \
     39        | ((u_int32_t)t_cp[1] << 16) \
     40        | ((u_int32_t)t_cp[2] << 8) \
     41        | ((u_int32_t)t_cp[3]) \
     42        ; \
     43    (cp) += NS_INT32SZ; \
     44} while (0)
     45
     46
     47#define GETSHORT        NS_GET16
     48#define GETLONG         NS_GET32
     49
     50#define ns_c_in     1   /*%< Internet. */
     51#define ns_t_srv    33  /*%< Internet. */
     52#define C_IN        ns_c_in
     53#define T_SRV       ns_t_srv
     54
     55    typedef struct {
     56        unsigned    id :16;     /*%< query identification number */
     57        /* fields in third byte */
     58        unsigned    rd :1;      /*%< recursion desired */
     59        unsigned    tc :1;      /*%< truncated message */
     60        unsigned    aa :1;      /*%< authoritive answer */
     61        unsigned    opcode :4;  /*%< purpose of message */
     62        unsigned    qr :1;      /*%< response flag */
     63        /* fields in fourth byte */
     64        unsigned    rcode :4;   /*%< response code */
     65        unsigned    cd: 1;      /*%< checking disabled by resolver */
     66        unsigned    ad: 1;      /*%< authentic data from named */
     67        unsigned    unused :1;  /*%< unused bits (MBZ as of 4.9.3a3) */
     68        unsigned    ra :1;      /*%< recursion available */
     69        /* remaining bytes */
     70        unsigned    qdcount :16;    /*%< number of question entries */
     71        unsigned    ancount :16;    /*%< number of answer entries */
     72        unsigned    nscount :16;    /*%< number of authority entries */
     73        unsigned    arcount :16;    /*%< number of resource entries */
     74    } HEADER;
     75#endif
     76
    2377#include "config.h"
    2478#include <glib.h>
    2579#include "glibintl.h"
  • .28.1/gio/gunixresolver.c

    old new  
    2020 * Boston, MA 02111-1307, USA.
    2121 */
    2222
     23#ifdef __ANDROID__
     24/*%
     25 * Inline versions of get/put short/long.  Pointer is advanced.
     26 */
     27#define NS_INT32SZ  4   /*%< #/bytes of data in a u_int32_t */
     28#define NS_INT16SZ  2   /*%< #/bytes of data in a u_int16_t */
     29#define NS_GET16(s, cp) do { \
     30    register const u_char *t_cp = (const u_char *)(cp); \
     31    (s) = ((u_int16_t)t_cp[0] << 8) \
     32        | ((u_int16_t)t_cp[1]) \
     33        ; \
     34    (cp) += NS_INT16SZ; \
     35} while (0)
     36#define NS_GET32(l, cp) do { \
     37    register const u_char *t_cp = (const u_char *)(cp); \
     38    (l) = ((u_int32_t)t_cp[0] << 24) \
     39        | ((u_int32_t)t_cp[1] << 16) \
     40        | ((u_int32_t)t_cp[2] << 8) \
     41        | ((u_int32_t)t_cp[3]) \
     42        ; \
     43    (cp) += NS_INT32SZ; \
     44} while (0)
     45
     46
     47#define GETSHORT        NS_GET16
     48#define GETLONG         NS_GET32
     49
     50#define ns_c_in     1   /*%< Internet. */
     51#define ns_t_srv    33  /*%< Internet. */
     52#define C_IN        ns_c_in
     53#define T_SRV       ns_t_srv
     54
     55    typedef struct {
     56        unsigned    id :16;     /*%< query identification number */
     57        /* fields in third byte */
     58        unsigned    rd :1;      /*%< recursion desired */
     59        unsigned    tc :1;      /*%< truncated message */
     60        unsigned    aa :1;      /*%< authoritive answer */
     61        unsigned    opcode :4;  /*%< purpose of message */
     62        unsigned    qr :1;      /*%< response flag */
     63        /* fields in fourth byte */
     64        unsigned    rcode :4;   /*%< response code */
     65        unsigned    cd: 1;      /*%< checking disabled by resolver */
     66        unsigned    ad: 1;      /*%< authentic data from named */
     67        unsigned    unused :1;  /*%< unused bits (MBZ as of 4.9.3a3) */
     68        unsigned    ra :1;      /*%< recursion available */
     69        /* remaining bytes */
     70        unsigned    qdcount :16;    /*%< number of question entries */
     71        unsigned    ancount :16;    /*%< number of answer entries */
     72        unsigned    nscount :16;    /*%< number of authority entries */
     73        unsigned    arcount :16;    /*%< number of resource entries */
     74    } HEADER;
     75#endif
     76
     77
     78
    2379#include "config.h"
    2480#include <glib.h>
    2581#include "glibintl.h"
  • .28.1/gio/glocalfileinfo.c

    old new lookup_uid_data (uid_t uid)  
    10961096      if (pwbufp->pw_name != NULL && pwbufp->pw_name[0] != 0)
    10971097    data->user_name = convert_pwd_string_to_utf8 (pwbufp->pw_name);
    10981098
     1099#ifdef __ANDROID__
     1100      gecos = NULL;
     1101#else
    10991102      gecos = pwbufp->pw_gecos;
     1103#endif
    11001104
    11011105      if (gecos)
    11021106    {
  • .28.1/gio/ginetaddress.c

    old new  
    2020 * Authors: Christian Kellner <address@hidden>
    2121 *          Samuel Cormier-Iijima <address@hidden>
    2222 */
     23#ifdef __ANDROID__
     24#define IN6_IS_ADDR_MC_NODELOCAL(a) \
     25    (IN6_IS_ADDR_MULTICAST(a)                         \
     26     && ((((__const uint8_t *) (a))[1] & 0xf) == 0x1))
     27
     28#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
     29    (IN6_IS_ADDR_MULTICAST(a)                         \
     30     && ((((__const uint8_t *) (a))[1] & 0xf) == 0x2))
     31
     32#define IN6_IS_ADDR_MC_SITELOCAL(a) \
     33    (IN6_IS_ADDR_MULTICAST(a)                         \
     34     && ((((__const uint8_t *) (a))[1] & 0xf) == 0x5))
     35
     36#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
     37    (IN6_IS_ADDR_MULTICAST(a)                         \
     38     && ((((__const uint8_t *) (a))[1] & 0xf) == 0x8))
     39
     40#define IN6_IS_ADDR_MC_GLOBAL(a) \
     41    (IN6_IS_ADDR_MULTICAST(a)                         \
     42     && ((((__const uint8_t *) (a))[1] & 0xf) == 0xe))
     43#endif
    2344
    2445#include <config.h>
    2546
Note: See TracBrowser for help on using the repository browser.