From 7a26ff040e7b1d93e364010ac44f4b4797de778c Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 9 Jul 2019 09:41:39 +0200 Subject: [PATCH] Remove usage of ZSTD_CLEVEL_DEFAULT define. 2019-07-09 Martin Liska * lto-compress.c (lto_normalized_zstd_level): Do not use ZSTD_CLEVEL_DEFAULT as it is not default in old releases of libzstd. One can use 0 as a default compression level. From-SVN: r273263 --- gcc/ChangeLog | 6 ++++++ gcc/lto-compress.c | 11 ++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1b7bfb676f4..a3c7971d643 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-07-09 Martin Liska + + * lto-compress.c (lto_normalized_zstd_level): Do not use + ZSTD_CLEVEL_DEFAULT as it is not default in old releases + of libzstd. One can use 0 as a default compression level. + 2019-07-09 Martin Liska * doc/invoke.texi: Add link from -fprofile-dir option. diff --git a/gcc/lto-compress.c b/gcc/lto-compress.c index b925363ac71..c5c37dbcbfc 100644 --- a/gcc/lto-compress.c +++ b/gcc/lto-compress.c @@ -115,13 +115,10 @@ lto_normalized_zstd_level (void) { int level = flag_lto_compression_level; - if (level != ZSTD_CLEVEL_DEFAULT) - { - if (level < 1) - level = 1; - else if (level > ZSTD_maxCLevel ()) - level = ZSTD_maxCLevel (); - } + if (level < 0) + level = 0; + else if (level > ZSTD_maxCLevel ()) + level = ZSTD_maxCLevel (); return level; } -- 2.30.2