comparison lib/portability.h @ 549:1f5bd8c93093

Implement Apple and Android versions of getline(), getdelim(), and clearenv().
author Georgi Chorbadzhiyski <gf@unixsol.org>
date Fri, 16 Mar 2012 06:42:08 -0500
parents 31215cc6c9f2
children b2194045c40e
comparison
equal deleted inserted replaced
548:99cb6ad605ee 549:1f5bd8c93093
1 // The tendency of gcc to produce stupid warnings continues with 1 // The tendency of gcc to produce stupid warnings continues with
2 // warn_unsed_result, which warns about things like ignoring the return code 2 // warn_unused_result, which warns about things like ignoring the return code
3 // of nice(2) (which is completely useless since -1 is a legitimate return 3 // of nice(2) (which is completely useless since -1 is a legitimate return
4 // value on success and even the man page tells you to use errno instead). 4 // value on success and even the man page tells you to use errno instead).
5 5
6 // This makes it stop. 6 // This makes it stop.
7 7
31 #define IS_BIG_ENDIAN 1 31 #define IS_BIG_ENDIAN 1
32 #else 32 #else
33 #define IS_BIG_ENDIAN 0 33 #define IS_BIG_ENDIAN 0
34 #endif 34 #endif
35 35
36 int clearenv(void);
36 #else 37 #else
37 38
38 #ifdef __BIG_ENDIAN__ 39 #ifdef __BIG_ENDIAN__
39 #define IS_BIG_ENDIAN 1 40 #define IS_BIG_ENDIAN 1
40 #else 41 #else
70 #if CFG_TOYBOX_DEBUG 71 #if CFG_TOYBOX_DEBUG
71 #define GCC_BUG =0 72 #define GCC_BUG =0
72 #else 73 #else
73 #define GCC_BUG 74 #define GCC_BUG
74 #endif 75 #endif
76
77 #if defined(__APPLE__) || defined(__ANDROID__)
78 ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream);
79 ssize_t getline(char **lineptr, size_t *n, FILE *stream);
80 #endif