Skip to content

Commit 8906f18

Browse files
authored
[libheif] Fix compilation errors using gcc8 (microsoft#42869)
1 parent 89b92ea commit 8906f18

File tree

5 files changed

+41
-2
lines changed

5 files changed

+41
-2
lines changed

ports/libheif/fix-gcc8.patch

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
diff --git a/libheif/bitstream.cc b/libheif/bitstream.cc
2+
index 9063718..f459fcc 100644
3+
--- a/libheif/bitstream.cc
4+
+++ b/libheif/bitstream.cc
5+
@@ -25,6 +25,12 @@
6+
#include <cassert>
7+
#include <bit>
8+
9+
+#if ((defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__PGI)) && __GNUC__ < 9) || (defined(__clang__) && __clang_major__ < 10)
10+
+#include <type_traits>
11+
+#else
12+
+#include <bit>
13+
+#endif
14+
+
15+
#define MAX_UVLC_LEADING_ZEROS 20
16+
17+
#define AVOID_FUZZER_FALSE_POSITIVE 0
18+
diff --git a/libheif/codecs/uncompressed/decoder_abstract.cc b/libheif/codecs/uncompressed/decoder_abstract.cc
19+
index bbe4692..3c9aacd 100644
20+
--- a/libheif/codecs/uncompressed/decoder_abstract.cc
21+
+++ b/libheif/codecs/uncompressed/decoder_abstract.cc
22+
@@ -35,6 +35,11 @@
23+
#include "unc_codec.h"
24+
#include "decoder_abstract.h"
25+
26+
+#if ((defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__PGI)) && __GNUC__ < 9) || (defined(__clang__) && __clang_major__ < 10)
27+
+#include <type_traits>
28+
+#else
29+
+#include <bit>
30+
+#endif
31+
32+
AbstractDecoder::AbstractDecoder(uint32_t width, uint32_t height, const std::shared_ptr<Box_cmpd> cmpd, const std::shared_ptr<Box_uncC> uncC) :
33+
m_width(width),

ports/libheif/portfile.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ vcpkg_from_github(
66
HEAD_REF master
77
PATCHES
88
gdk-pixbuf.patch
9+
fix-gcc8.patch
910
)
1011

1112
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS

ports/libheif/vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "libheif",
33
"version": "1.19.5",
4-
"port-version": 1,
4+
"port-version": 2,
55
"description": "libheif is an HEIF and AVIF file format decoder and encoder.",
66
"homepage": "http://www.libheif.org/",
77
"license": "LGPL-3.0-only",

versions/baseline.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4658,7 +4658,7 @@
46584658
},
46594659
"libheif": {
46604660
"baseline": "1.19.5",
4661-
"port-version": 1
4661+
"port-version": 2
46624662
},
46634663
"libhsplasma": {
46644664
"baseline": "2024-03-07",

versions/l-/libheif.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"versions": [
3+
{
4+
"git-tree": "ecd6b2d082b2b4c294587aaabb0c53b7e1d87f5c",
5+
"version": "1.19.5",
6+
"port-version": 2
7+
},
38
{
49
"git-tree": "b714664a4550bae5edc9fbe655f0ce057ac9e67e",
510
"version": "1.19.5",

0 commit comments

Comments
 (0)