parent
d35a5d87aa
commit
25718958be
|
@ -45,6 +45,7 @@ void *memrchr(const void *s, int c, size_t n)
|
|||
extern void *memrchr(const void *s, int c, size_t n);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
// poll for read, unless forwrite!=0
|
||||
static void _fd_poll(long fd, int forwrite)
|
||||
{
|
||||
|
@ -60,6 +61,7 @@ static void _fd_poll(long fd, int forwrite)
|
|||
#else
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
static int _enonfatal(int err)
|
||||
{
|
||||
|
@ -226,7 +228,6 @@ static size_t _ios_read(ios_t *s, char *dest, size_t n, int all)
|
|||
{
|
||||
size_t tot = 0;
|
||||
size_t got, avail;
|
||||
int result;
|
||||
|
||||
while (n > 0) {
|
||||
avail = s->size - s->bpos;
|
||||
|
@ -260,9 +261,9 @@ static size_t _ios_read(ios_t *s, char *dest, size_t n, int all)
|
|||
if (n > MOST_OF(s->maxsize)) {
|
||||
// doesn't fit comfortably in buffer; go direct
|
||||
if (all)
|
||||
result = _os_read_all(s->fd, dest, n, &got);
|
||||
_os_read_all(s->fd, dest, n, &got);
|
||||
else
|
||||
result = _os_read(s->fd, dest, n, &got);
|
||||
_os_read(s->fd, dest, n, &got);
|
||||
tot += got;
|
||||
if (got == 0)
|
||||
s->_eof = 1;
|
||||
|
|
8
string.c
8
string.c
|
@ -47,14 +47,12 @@ value_t fl_string_count(value_t *args, u_int32_t nargs)
|
|||
return size_wrap(u8_charnum(str+start, stop-start));
|
||||
}
|
||||
|
||||
|
||||
#if defined( __WIN32__ ) || defined( __linux__ )
|
||||
extern int wcwidth( wchar_t );
|
||||
#if defined(__linux__) || (defined(__APPLE__) && defined(__MACH__))
|
||||
extern int wcwidth(uint32_t);
|
||||
#else
|
||||
# error "I need int wcwidth( wchar_t );"
|
||||
#error "wcwidth function not available"
|
||||
#endif
|
||||
|
||||
|
||||
value_t fl_string_width(value_t *args, u_int32_t nargs)
|
||||
{
|
||||
argcount("string.width", nargs, 1);
|
||||
|
|
Loading…
Reference in New Issue