-SG_USING_STD(streambuf);
-SG_USING_STD(ios_base);
-SG_USING_STD(streampos);
-SG_USING_STD(streamoff);
-
-#else
-
-# ifdef SG_HAVE_STREAMBUF
-# include <streambuf.h>
-# include <istream.h>
-# else
-# include <iostream.h>
-# endif
-
-//# define ios_openmode ios::open_mode
-# define ios_openmode int
-# define ios_in ios::in
-# define ios_out ios::out
-# define ios_app ios::app
-
-#if defined(__GNUC__) && __GNUC_MINOR__ < 8
-# define ios_binary ios::bin
-#elif defined( SG_HAVE_NATIVE_SGI_COMPILERS )
-# define ios_binary 0
+/**
+ * A C++ I/O streams interface to the zlib gz* functions.
+ */
+#ifdef SG_NEED_STREAMBUF_HACK
+class gzfilebuf : public __streambuf {
+ typedef __streambuf parent;