diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-03-25 14:50:40 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-03-25 14:50:40 +0000 |
commit | dfaf41d759a700458e900051ddcbe54d65834ae1 (patch) | |
tree | cd7d94c77a710b4ac5422eb1d159298dded63f87 /configure.in | |
parent | 45ca4d69aa75994d8a96632529b69ae747b6639d (diff) |
* configure.in (FILE_READPTR): new. for IO#gets improvement.
* io.c (READ_DATA_PENDING_PTR): ditto.
* io.c (remain_size): separated from read_all().
* io.c (read_all): argument chagend.
* io.c (appendline): new. get a line and append to string.
* io.c (swallow): new. swallow continuous line delimiters.
* io.c (rb_io_getline_fast): add delimiter argument.
* io.c (rb_io_getline): performance improvement.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 78 |
1 files changed, 56 insertions, 22 deletions
diff --git a/configure.in b/configure.in index d7c6c290d5..e147656a8f 100644 --- a/configure.in +++ b/configure.in @@ -453,29 +453,21 @@ else AC_DEFINE(RSHIFT(x,y), (((x)<0) ? ~((~(x))>>y) : (x)>>y)) fi -AC_MSG_CHECKING(count field in FILE structures) +AC_MSG_CHECKING(read count field in FILE structures) AC_CACHE_VAL(rb_cv_fcnt, -[AC_TRY_COMPILE([#include <stdio.h>], - [FILE *f = stdin; f->_cnt = 0;], rb_cv_fcnt="_cnt", ) -if test "$rb_cv_fcnt" = ""; then - AC_TRY_COMPILE([#include <stdio.h>], - [FILE *f = stdin; f->__cnt = 0;], rb_cv_fcnt="__cnt", ) -fi -if test "$rb_cv_fcnt" = ""; then - AC_TRY_COMPILE([#include <stdio.h>], - [FILE *f = stdin; f->_r = 0;], rb_cv_fcnt="_r", ) -fi -if test "$rb_cv_fcnt" = ""; then - AC_TRY_COMPILE([#include <stdio.h>], - [FILE *f = stdin; f->readCount = 0;], - rb_cv_fcnt="readCount", ) -fi -dnl for emx0.9c -if test "$rb_cv_fcnt" = ""; then - AC_TRY_COMPILE([#include <stdio.h>], - [FILE *f = stdin; f->_rcount = 0;], - rb_cv_fcnt="_rcount", rb_cv_fcnt="not found") -fi]) +[for fcnt in dnl + _cnt dnl + __cnt dnl + _r dnl + readCount dnl + _rcount dnl for emx0.9c +; do + AC_TRY_COMPILE([#include <stdio.h> +], + [FILE *f = stdin; f->$fcnt = 0;], + rb_cv_fcnt="$fcnt"; break, + rb_cv_fcnt="not found") +done]) if test "$rb_cv_fcnt" = "not found"; then AC_MSG_RESULT([not found(OK if using GNU libc)]) else @@ -483,6 +475,48 @@ else AC_DEFINE_UNQUOTED(FILE_COUNT, $rb_cv_fcnt) fi +AC_MSG_CHECKING(read buffer ptr field in FILE structures) +AC_CACHE_VAL(rb_cv_frptr, +[for frptr in dnl + _IO_read_ptr dnl + _ptr dnl + __ptr dnl + bufpos dnl +; do + AC_TRY_COMPILE([#include <stdio.h> +], + [FILE *f = stdin; char buf[256]; f->$frptr = buf;], + rb_cv_frptr="$frptr"; break, + rb_cv_frptr="not found") +done]) +if test "$rb_cv_frptr" = "not found"; then + AC_MSG_RESULT([not found]) +else + AC_MSG_RESULT($rb_cv_frptr) + AC_DEFINE_UNQUOTED(FILE_READPTR, $rb_cv_frptr) + + if test "$rb_cv_fcnt" = "not found"; then + AC_MSG_CHECKING(read buffer end field in FILE structures) + AC_CACHE_VAL(rb_cv_frend, + [for frend in dnl + _IO_read_end dnl + bufend dnl + ; do + AC_TRY_COMPILE([#include <stdio.h> + ], + [FILE *f = stdin; char buf[256]; f->$frend = buf;], + rb_cv_frend="$frend"; break, + rb_cv_frend="not found") + done]) + if test "$rb_cv_frend" = "not found"; then + AC_MSG_RESULT([not found]) + else + AC_MSG_RESULT($rb_cv_frend) + AC_DEFINE_UNQUOTED(FILE_READEND, $rb_cv_frend) + fi + fi +fi + dnl default value for $KANJI DEFAULT_KCODE="KCODE_NONE" |