Package: faac / 1.29.9.2-2

0005-Fix-compilation-with-GCC-4.6.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From c8f26d7e0db0458e158b06ccaef0d79d3f34adb6 Mon Sep 17 00:00:00 2001
From: Takashi Yoshi <takashi@yoshi.email>
Date: Tue, 26 Dec 2017 13:03:58 +0100
Subject: [PATCH 5/7] Fix compilation with GCC < 4.6

Older versions of GCC (< 4.6) consider calls to log10() and sqrt()
non-constant and as a result compilation fails.

GCC >= 4.6 < 6 will compile but print a warning about the non-constant
initialization.

This switch will use the "constant" expression on older versions of GCC.
---
 libfaac/quantize.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libfaac/quantize.c b/libfaac/quantize.c
index 847edb5..ee76073 100644
--- a/libfaac/quantize.c
+++ b/libfaac/quantize.c
@@ -40,6 +40,12 @@
 # define bit_SSE2 (1 << 26)
 #endif
 
+#ifdef __GNUC__
+#define GCC_VERSION (__GNUC__ * 10000 \
+                     + __GNUC_MINOR__ * 100 \
+                     + __GNUC_PATCHLEVEL__)
+#endif
+
 #define MAGIC_NUMBER  0.4054
 #define NOISEFLOOR 0.4
 
@@ -147,7 +153,7 @@ static void qlevel(CoderInfo *coderInfo,
                   )
 {
     int sb, cnt;
-#ifndef __clang__
+#if !defined(__clang__) && (!defined(__GNUC__) || GCC_VERSION >= 40600)
     /* 2^0.25 (1.50515 dB) step from AAC specs */
     static const double sfstep = 1.0 / log10(sqrt(sqrt(2.0)));
 #else
-- 
2.18.0