Skip to content

Commit

Permalink
Provide alternative istdiostream.
Browse files Browse the repository at this point in the history
    This has been tested with Sun WorkShop 4.2 C++ which does not
    contain class istdiostream.
  • Loading branch information
Sascha Schumann committed Sep 28, 1999
1 parent 74bc24d commit 7ed68c0
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Zend/acconfig.h
@@ -1,3 +1,5 @@
#undef HAVE_CLASS_ISTDIOSTREAM

#define ZEND_API

@TOP@
Expand Down
20 changes: 20 additions & 0 deletions Zend/configure.in
Expand Up @@ -32,6 +32,7 @@ AC_PROG_CC_C_O
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
Expand Down Expand Up @@ -159,6 +160,25 @@ if test "$enable_thread_safety" = "yes" ; then
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)
Expand Down
12 changes: 11 additions & 1 deletion Zend/zend-scanner.l
Expand Up @@ -85,6 +85,16 @@
# 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) \
Expand Down Expand Up @@ -193,7 +203,7 @@ ZEND_API void zend_close_file_handle(zend_file_handle *file_handle CLS_DC)
}


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) {
Expand Down

0 comments on commit 7ed68c0

Please sign in to comment.