]> granicus.if.org Git - php/commitdiff
Provide alternative istdiostream.
authorSascha Schumann <sas@php.net>
Tue, 28 Sep 1999 11:54:02 +0000 (11:54 +0000)
committerSascha Schumann <sas@php.net>
Tue, 28 Sep 1999 11:54:02 +0000 (11:54 +0000)
    This has been tested with Sun WorkShop 4.2 C++ which does not
    contain class istdiostream.

Zend/acconfig.h
Zend/configure.in
Zend/zend-scanner.l

index 76cb26f3f44563f701f74e3bbd6a9848dfd5e633..9a5e3a5c0d40f722fb8b06e9d3a5d90a124da038 100644 (file)
@@ -1,3 +1,5 @@
+#undef HAVE_CLASS_ISTDIOSTREAM
+
 #define ZEND_API
 
 @TOP@
index 670d263aeb2a55bf2fbda21bd4f0b8d18859c0c3..f02ddcbe8ef9fe782762200c70b0324a37eb0b9b 100644 (file)
@@ -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)
index d113c3d520e3d143a15edd6fc07bd386988ccb15..7ff84863437fb36c934c9d4c864b2340662be400 100644 (file)
 #  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) {