summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in78
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"