diff options
author | Sascha Schumann <sas@php.net> | 1999-09-28 11:54:02 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 1999-09-28 11:54:02 +0000 |
commit | 7ed68c0f5300a6d0345818d170780cf457e524ca (patch) | |
tree | 260bb665f0f71797892e001415203fd3956269cf /Zend | |
parent | 74bc24d9d5d196a947aa2daabbc0d4874daf7e4e (diff) | |
download | php-git-7ed68c0f5300a6d0345818d170780cf457e524ca.tar.gz |
Provide alternative istdiostream.
This has been tested with Sun WorkShop 4.2 C++ which does not
contain class istdiostream.
Diffstat (limited to 'Zend')
-rw-r--r-- | Zend/acconfig.h | 2 | ||||
-rw-r--r-- | Zend/configure.in | 20 | ||||
-rw-r--r-- | Zend/zend-scanner.l | 12 |
3 files changed, 33 insertions, 1 deletions
diff --git a/Zend/acconfig.h b/Zend/acconfig.h index 76cb26f3f4..9a5e3a5c0d 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 670d263aeb..f02ddcbe8e 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 <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) diff --git a/Zend/zend-scanner.l b/Zend/zend-scanner.l index d113c3d520..7ff8486343 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) { |