[llvm-commits] CVS: llvm/lib/Support/Compressor.cpp
Reid Spencer
reid at x10sys.com
Fri Nov 19 07:56:39 PST 2004
Changes in directory llvm/lib/Support:
Compressor.cpp updated: 1.6 -> 1.7
---
Log message:
Allow this to compile even on machines that HAVE the bzlib library but do
NOT have the bzlib.h header file. Go figure.
---
Diffs of the changes: (+11 -5)
Index: llvm/lib/Support/Compressor.cpp
diff -u llvm/lib/Support/Compressor.cpp:1.6 llvm/lib/Support/Compressor.cpp:1.7
--- llvm/lib/Support/Compressor.cpp:1.6 Sun Nov 14 16:04:46 2004
+++ llvm/lib/Support/Compressor.cpp Fri Nov 19 09:56:28 2004
@@ -19,11 +19,17 @@
#include <string>
#ifdef HAVE_BZIP2
+#ifdef HAVE_BZLIB_H
#include <bzlib.h>
-#endif
+#define BZIP2_GOOD
+#endif
+#endif
#ifdef HAVE_ZLIB
+#ifdef HAVE_ZLIB_H
#include <zlib.h>
+#define ZLIB_GOOD
+#endif
#endif
namespace {
@@ -250,7 +256,7 @@
switch (hint) {
case COMP_TYPE_BZIP2: {
-#if defined(HAVE_BZIP2)
+#if defined(BZIP2_GOOD)
// Set up the bz_stream
bz_stream bzdata;
bzdata.bzalloc = 0;
@@ -307,7 +313,7 @@
}
case COMP_TYPE_ZLIB: {
-#if defined(HAVE_ZLIB)
+#if defined(ZLIB_GOOD)
z_stream zdata;
zdata.zalloc = Z_NULL;
zdata.zfree = Z_NULL;
@@ -414,7 +420,7 @@
switch (*in++) {
case COMP_TYPE_BZIP2: {
-#if !defined(HAVE_BZIP2)
+#if !defined(BZIP2_GOOD)
throw std::string("Can't decompress BZIP2 data");
#else
// Set up the bz_stream
@@ -469,7 +475,7 @@
}
case COMP_TYPE_ZLIB: {
-#if !defined(HAVE_ZLIB)
+#if !defined(ZLIB_GOOD)
throw std::string("Can't decompress ZLIB data");
#else
z_stream zdata;
More information about the llvm-commits
mailing list