ref: 764ddc7685376c05b737919ac4b6f0c2c13c9204
parent: a9f67bf89328abbbe7d8f6026f826d812e1165f4
parent: a06702ebb8ba6076be47abd071492701f3478e0f
author: Krzysztof Nikiel <knik0@users.noreply.github.com>
date: Sun Jun 3 10:03:08 EDT 2018
Merge pull request #13 from sideeffect42/old-gcc-and-bigendian-fix Fix compilation with older versions of GCC (and on big-endian systems)
--- a/frontend/mp4write.c
+++ b/frontend/mp4write.c
@@ -17,6 +17,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
--- 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 @@
)
{
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