This has been tested with Sun WorkShop 4.2 C++ which does not
contain class istdiostream.
+#undef HAVE_CLASS_ISTDIOSTREAM
+
#define ZEND_API
@TOP@
AM_PROG_LEX
AM_PROG_CC_STDC
+AC_C_INLINE
dnl Hack to work around a Mac OS X cpp problem
dnl Known versions needing this workaround are 5.3 and 5.4
AC_CHECK_LIB(C, cin)
AC_CHECK_LIB(g++, cin)
AC_CHECK_LIB(stdc++, cin)
+
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_MSG_CHECKING(for class istdiostream)
+AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <unistd.h>
+#include <fstream.h>
+#include <stdiostream.h>
+],[
+istdiostream *foo = new istdiostream((FILE *) 0);
+],[
+ AC_DEFINE(HAVE_CLASS_ISTDIOSTREAM, 1)
+ AC_MSG_RESULT(yes)
+],[
+ AC_MSG_RESULT(no)
+])
+AC_LANG_RESTORE
+
fi
AC_SUBST(CXXFLAGS)
# define MY_INPUT input
#endif
+#if defined(ZTS) && !defined(HAVE_CLASS_ISTDIOSTREAM)
+class istdiostream : public istream
+{
+private:
+ stdiobuf _file;
+public:
+ istdiostream (FILE* __f) : istream(), _file(__f) { init(&_file); }
+};
+#endif
+
#define YY_FATAL_ERROR zend_fatal_scanner_error
#define HANDLE_NEWLINES(s,l) \
}
-ZEND_API inline int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
+ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
{
#ifndef ZTS
switch (file_handle->type) {