diff options
author | Ian Lance Taylor <iant@google.com> | 2007-11-30 22:38:01 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2007-11-30 22:38:01 +0000 |
commit | b589a5bc294547c756aa853b21fc2852f00e7687 (patch) | |
tree | f8c60bceaff13606b0385895834ac0533bf0dfe5 | |
parent | a6b151f18761ed51bf9bfc7460a6e4023dd63449 (diff) | |
download | gdb-b589a5bc294547c756aa853b21fc2852f00e7687.zip gdb-b589a5bc294547c756aa853b21fc2852f00e7687.tar.gz gdb-b589a5bc294547c756aa853b21fc2852f00e7687.tar.bz2 |
From Cary Coutant: Avoid compilation warnings if no zlib.h.
-rw-r--r-- | gold/compressed_output.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gold/compressed_output.cc b/gold/compressed_output.cc index 1006ac8..bf5f640 100644 --- a/gold/compressed_output.cc +++ b/gold/compressed_output.cc @@ -38,13 +38,12 @@ namespace gold // true, it allocates memory for the compressed data using new, and // sets *COMPRESSED_DATA and *COMPRESSED_SIZE to appropriate values. +#ifdef HAVE_ZLIB_H + static bool zlib_compress(const char* uncompressed_data, unsigned long uncompressed_size, char** compressed_data, unsigned long* compressed_size) { -#ifndef HAVE_ZLIB_H - return false; -#else *compressed_size = uncompressed_size + uncompressed_size / 1000 + 128; *compressed_data = new char[*compressed_size]; @@ -67,9 +66,18 @@ zlib_compress(const char* uncompressed_data, unsigned long uncompressed_size, *compressed_data = NULL; return false; } -#endif // #ifdef HAVE_ZLIB_H } +#else // !defined(HAVE_ZLIB_H) + +static bool +zlib_compress(const char*, unsigned long, char**, unsigned long*) +{ + return false; +} + +#endif // !defined(HAVE_ZLIB_H) + // After compressing an output section, we rename it from foo to // foo.zlib.nnnn, where nnnn is the uncompressed size of the section. |