chiark / gitweb /
ruby: Build 32-bit variants with gcc for now
[termux-packages] / ndk-patches / bits-struct_file.h.patch
1 diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/bits/struct_file.h ./usr/include/bits/struct_file.h
2 --- /home/fornwall/lib/android-ndk/sysroot/usr/include/bits/struct_file.h       2017-06-20 17:41:56.000000000 +0200
3 +++ ./usr/include/bits/struct_file.h    2017-06-26 13:35:19.040117023 +0200
4 @@ -33,13 +33,80 @@
5  
6  __BEGIN_DECLS
7  
8 +#if defined(__LP64__)
9 +struct __sbuf {
10 +       unsigned char* _base;
11 +       size_t _size;
12 +};
13 +#else
14 +struct __sbuf {
15 +       unsigned char *_base;
16 +       int     _size;
17 +};
18 +#endif
19 +
20 +#if defined(__LP64__)
21 +typedef int64_t _struct_file_off_t;
22 +#else
23 +typedef __kernel_off_t _struct_file_off_t;
24 +#endif
25 +
26  struct __sFILE {
27 +       unsigned char *_p;      /* current position in (some) buffer */
28 +       int     _r;             /* read space left for getc() */
29 +       int     _w;             /* write space left for putc() */
30  #if defined(__LP64__)
31 -  char __private[152];
32 +       int     _flags;         /* flags, below; this FILE is free if 0 */
33 +       int     _file;          /* fileno, if Unix descriptor, else -1 */
34  #else
35 -  char __private[84];
36 +       short   _flags;         /* flags, below; this FILE is free if 0 */
37 +       short   _file;          /* fileno, if Unix descriptor, else -1 */
38  #endif
39 -} __attribute__((aligned(sizeof(void*))));
40 +       struct  __sbuf _bf;     /* the buffer (at least 1 byte, if !NULL) */
41 +       int     _lbfsize;       /* 0 or -_bf._size, for inline putc */
42 +
43 +       /* operations */
44 +       void    *_cookie;       /* cookie passed to io functions */
45 +       int     (*_close)(void *);
46 +       int     (*_read)(void *, char *, int);
47 +       _struct_file_off_t      (*_seek)(void *, _struct_file_off_t, int);
48 +       int     (*_write)(void *, const char *, int);
49 +
50 +       /* extension data, to avoid further ABI breakage */
51 +       struct  __sbuf _ext;
52 +       /* data for long sequences of ungetc() */
53 +       unsigned char *_up;     /* saved _p when _p is doing ungetc data */
54 +       int     _ur;            /* saved _r when _r is counting ungetc data */
55 +
56 +       /* tricks to meet minimum requirements even when malloc() fails */
57 +       unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */
58 +       unsigned char _nbuf[1]; /* guarantee a getc() buffer */
59 +
60 +       /* separate buffer for fgetln() when line crosses buffer boundary */
61 +       struct  __sbuf _lb;     /* buffer for fgetln() */
62 +
63 +       /* Unix stdio files get aligned to block boundaries on fseek() */
64 +       int     _blksize;       /* stat.st_blksize (may be != _bf._size) */
65 +       _struct_file_off_t      _offset;        /* current lseek offset */
66 +};
67 +
68 +#define        __SLBF  0x0001          /* line buffered */
69 +#define        __SNBF  0x0002          /* unbuffered */
70 +#define        __SRD   0x0004          /* OK to read */
71 +#define        __SWR   0x0008          /* OK to write */
72 +       /* RD and WR are never simultaneously asserted */
73 +#define        __SRW   0x0010          /* open for reading & writing */
74 +#define        __SEOF  0x0020          /* found EOF */
75 +#define        __SERR  0x0040          /* found error */
76 +#define        __SMBF  0x0080          /* _buf is from malloc */
77 +#define        __SAPP  0x0100          /* fdopen()ed in append mode */
78 +#define        __SSTR  0x0200          /* this is an sprintf/snprintf string */
79 +#define        __SOPT  0x0400          /* do fseek() optimization */
80 +#define        __SNPT  0x0800          /* do not do fseek() optimization */
81 +#define        __SOFF  0x1000          /* set iff _offset is in fact correct */
82 +#define        __SMOD  0x2000          /* true => fgetln modified _p text */
83 +#define        __SALC  0x4000          /* allocate string space dynamically */
84 +#define        __SIGN  0x8000          /* ignore this file in _fwalk */
85  
86  __END_DECLS
87