summaryrefslogtreecommitdiffstats
path: root/media/ffvpx/libavutil_visibility.h
diff options
context:
space:
mode:
authortrav90 <travawine@protonmail.ch>2018-04-26 16:52:38 -0500
committertrav90 <travawine@protonmail.ch>2018-04-26 16:52:38 -0500
commit0676e749b884903a7cda54186ee8c9a193327468 (patch)
tree975835aa74cc7a3e5534ccc70385c18c073561b6 /media/ffvpx/libavutil_visibility.h
parentf4906f9a851c7056fe04d143f4aea2300cd9ba24 (diff)
downloadUXP-0676e749b884903a7cda54186ee8c9a193327468.tar
UXP-0676e749b884903a7cda54186ee8c9a193327468.tar.gz
UXP-0676e749b884903a7cda54186ee8c9a193327468.tar.lz
UXP-0676e749b884903a7cda54186ee8c9a193327468.tar.xz
UXP-0676e749b884903a7cda54186ee8c9a193327468.zip
[FFmpeg] Add a preemptive stdlib.h include in our libavutil_visibility.h hackaround file
Diffstat (limited to 'media/ffvpx/libavutil_visibility.h')
-rw-r--r--media/ffvpx/libavutil_visibility.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/media/ffvpx/libavutil_visibility.h b/media/ffvpx/libavutil_visibility.h
index a5cce0844..706aacdf3 100644
--- a/media/ffvpx/libavutil_visibility.h
+++ b/media/ffvpx/libavutil_visibility.h
@@ -9,6 +9,15 @@
#ifndef MOZILLA_AVUTIL_VISIBILITY_H
#define MOZILLA_AVUTIL_VISIBILITY_H
+// We need to preemptively include <stdlib.h> before anyone[1] has a chance
+// to include <limits.h>. We do this to avoid a Linux clang build error, in
+// -ffreestanding mode, which happens when limits.h defines MB_LEN_MAX to some
+// value that is different from what stdlib.h expects. If we include stdlib.h
+// before limits.h, then they don't get a chance to interact badly.
+//
+// [1] (e.g. libavutil/common.h, which is indirectly included by log.h below.)
+#include <stdlib.h>
+
#pragma GCC visibility push(default)
#include "libavutil/cpu.h"