summaryrefslogtreecommitdiff
path: root/generic/Handle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'generic/Handle.cpp')
-rw-r--r--generic/Handle.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/generic/Handle.cpp b/generic/Handle.cpp
index 6390a6d..29b4816 100644
--- a/generic/Handle.cpp
+++ b/generic/Handle.cpp
@@ -149,6 +149,7 @@ void Handle::close() throw (GeneralException) {
}
if (h >= 0) {
+#ifdef HAVE_ZLIB
if (z) {
// cerr << "Performing gzclose on handle " << h << endl;
int err = gzclose(zfile);
@@ -161,6 +162,9 @@ void Handle::close() throw (GeneralException) {
}
}
} else {
+#else
+ {
+#endif
int err = ::close(h);
if (err) {
throw GeneralException(String(_("Error during close: ")) + strerror(errno));
@@ -204,6 +208,7 @@ void Handle::Dup(const Handle & H) {
}
}
+#ifdef HAVE_ZLIB
void Handle::SetZ(int az) throw (GeneralException) {
if (z) {
throw GeneralException(_("Can't SetZ a Handle twice."));
@@ -229,8 +234,10 @@ void Handle::SetZ(int az) throw (GeneralException) {
z = az;
}
}
+#endif
ssize_t Handle::uwrite(const void * buf, size_t count) throw (GeneralException) {
+#ifdef HAVE_ZLIB
if (z) {
itell += count;
// cerr << "Performing gzwrite of " << count << " byte for handle " << h << endl;
@@ -246,12 +253,16 @@ ssize_t Handle::uwrite(const void * buf, size_t count) throw (GeneralException)
}
return err;
} else {
+#else
+ {
+#endif
itell += count = ::write(h, buf, count);
return count;
}
}
ssize_t Handle::uread(void * buf, size_t count) {
+#ifdef HAVE_ZLIB
if (z) {
itell += count;
// cerr << "Performing gzread of " << count << " byte for handle " << h << endl;
@@ -267,6 +278,9 @@ ssize_t Handle::uread(void * buf, size_t count) {
}
return err;
} else {
+#else
+ {
+#endif
itell += count = ::read(h, buf, count);
return count;
}