From 7ed68c0f5300a6d0345818d170780cf457e524ca Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Tue, 28 Sep 1999 11:54:02 +0000 Subject: [PATCH] Provide alternative istdiostream. This has been tested with Sun WorkShop 4.2 C++ which does not contain class istdiostream. --- Zend/acconfig.h | 2 ++ Zend/configure.in | 20 ++++++++++++++++++++ Zend/zend-scanner.l | 12 +++++++++++- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/Zend/acconfig.h b/Zend/acconfig.h index 76cb26f3f4456..9a5e3a5c0d40f 100644 --- a/Zend/acconfig.h +++ b/Zend/acconfig.h @@ -1,3 +1,5 @@ +#undef HAVE_CLASS_ISTDIOSTREAM + #define ZEND_API @TOP@ diff --git a/Zend/configure.in b/Zend/configure.in index 670d263aeb2a5..f02ddcbe8ef9f 100644 --- a/Zend/configure.in +++ b/Zend/configure.in @@ -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 @@ -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 +#include +#include +#include +],[ +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) diff --git a/Zend/zend-scanner.l b/Zend/zend-scanner.l index d113c3d520e3d..7ff84863437fb 100644 --- a/Zend/zend-scanner.l +++ b/Zend/zend-scanner.l @@ -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) \ @@ -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) {