zzxxpp1011239740 / webp

Automatically exported from code.google.com/p/webp
0 stars 0 forks source link

log2() not defined in histogram.c with Visual Studio <math.h> #120

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
% ack log2 src/enc

histogram.c
90:    const double log2sum = log2(sum);
93:        output[i] = log2sum;
95:        output[i] = log2sum - log2(population_counts[i]);

log2() is not even C99 standard, and is also not supported by MS Visual Studio 
<math.h>, result is a compilation error building libwebp.

Original issue reported on code.google.com by noel@chromium.org on 28 May 2012 at 9:05

GoogleCodeExporter commented 9 years ago
Yes this was a problem in src/utils/alpha.c (since deleted), which had a 
wrapper. This will get sorted out before the next release.

Original comment by jz...@google.com on 31 May 2012 at 2:44

GoogleCodeExporter commented 9 years ago
https://gerrit.chromium.org/gerrit/#change,24470

Adds a wrapper.
There may be further cleanup around log2/FastLog2/BitsLog2, etc., but with this 
and
https://gerrit.chromium.org/gerrit/#change,24468
(no stdint.h), visual studio should build now.

Original comment by jz...@google.com on 5 Jun 2012 at 7:14