summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--lib/Exceptions.cc2
-rw-r--r--lib/Input.cc2
-rw-r--r--lib/Output.cc4
4 files changed, 9 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 16554f4..04b9d60 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,6 +77,8 @@ else
AC_MSG_ERROR([no zlib found in the system.])
fi
+AC_DEFINE([HOOK_STDS], 1, [Hook the standard input/outputs])
+
if test x$ac_cv_wd_gzwrite != xyes ; then
AC_MSG_WARN([You have a broken zconf.h.]
[You should patch this using]
diff --git a/lib/Exceptions.cc b/lib/Exceptions.cc
index e9c5861..43b77f1 100644
--- a/lib/Exceptions.cc
+++ b/lib/Exceptions.cc
@@ -197,7 +197,7 @@ void * Base::calloc(size_t n, size_t s) {
void * Base::operator new(size_t s) {
#ifdef DEBUG
- cerr << "Operator new(s) called. Allocating memory.\n";
+ std::cerr << "Operator new(s) called. Allocating memory.\n";
#endif
return xmalloc(s);
}
diff --git a/lib/Input.cc b/lib/Input.cc
index ee36ded..999ebab 100644
--- a/lib/Input.cc
+++ b/lib/Input.cc
@@ -85,7 +85,9 @@ off_t Input::seek(off_t offset, int whence) throw (GeneralException) {
return itell;
}
+#ifdef HOOK_STDS
Stdin_t::Stdin_t() { }
+#endif
bool Stdin_t::CanSeek() const {
return 0;
diff --git a/lib/Output.cc b/lib/Output.cc
index 296510d..e9016f9 100644
--- a/lib/Output.cc
+++ b/lib/Output.cc
@@ -76,7 +76,9 @@ String Output::GetName() const {
return n;
}
+#ifdef HOOK_STDS
Stdout_t::Stdout_t() {}
+#endif
bool Stdout_t::CanSeek() const {
return 0;
@@ -86,7 +88,9 @@ String Stdout_t::GetName() const {
return "Stdout";
}
+#ifdef HOOK_STDS
Stderr_t::Stderr_t() : Handle(dup(2)) {}
+#endif
bool Stderr_t::CanWrite() const {
return 1;