aboutsummaryrefslogtreecommitdiffstats
path: root/community/chromium/chromium-libjpeg-r0.patch
blob: 93bd305df836329b5ff687294215e12bfc845741 (plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
From c6b0194f7a4d9f494b2d51f46d2c332e2e5f4050 Mon Sep 17 00:00:00 2001
From: Daniel Bratell <bratell@opera.com>
Date: Mon, 28 May 2018 13:13:01 +0000
Subject: [PATCH] Use the same libjpeg in all of blink/platform

The normal libjpeg renames some symbols with macros so if its
headers are included together with libjpeg-turbo's headers
in the same translation unit, there will be an inconsistent
renaming of libjpeg symbols. This happened in some extreme
jumbo configuration and resulted in confising linker errors.

This patch changes an include so that jpeglib.h becomes included
the same way everywhere.

Change-Id: I7f122d0919d58371bb40dc0097a766b857b9815e
Reviewed-on: https://chromium-review.googlesource.com/1073423
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#562243}
---
 .../renderer/platform/image-encoders/image_encoder.cc | 11 +++++++++++
 .../renderer/platform/image-encoders/image_encoder.h  |  2 --
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/third_party/blink/renderer/platform/image-encoders/image_encoder.cc b/third_party/blink/renderer/platform/image-encoders/image_encoder.cc
index 0c7f14c7c0e4..4c450f5d6783 100644
--- ./third_party/blink/renderer/platform/image-encoders/image_encoder.cc
+++ ./third_party/blink/renderer/platform/image-encoders/image_encoder.cc
@@ -4,6 +4,17 @@
 
 #include "third_party/blink/renderer/platform/image-encoders/image_encoder.h"
 
+#include "build/build_config.h"
+
+#if defined(OS_WIN)
+#include <basetsd.h>  // Included before jpeglib.h because of INT32 clash
+#endif                // OS_WIN
+#include <stdio.h>    // Needed by jpeglib.h
+
+#include "jpeglib.h"  // for JPEG_MAX_DIMENSION
+
+#include "third_party/libwebp/src/webp/encode.h"  // for WEBP_MAX_DIMENSION
+
 namespace blink {
 
 bool ImageEncoder::Encode(Vector<unsigned char>* dst,
diff --git a/third_party/blink/renderer/platform/image-encoders/image_encoder.h b/third_party/blink/renderer/platform/image-encoders/image_encoder.h
index 0d1460f34827..40306097d507 100644
--- ./third_party/blink/renderer/platform/image-encoders/image_encoder.h
+++ ./third_party/blink/renderer/platform/image-encoders/image_encoder.h
@@ -7,8 +7,6 @@
 
 #include "third_party/blink/renderer/platform/platform_export.h"
 #include "third_party/blink/renderer/platform/wtf/vector.h"
-#include "third_party/libjpeg/jpeglib.h"          // for JPEG_MAX_DIMENSION
-#include "third_party/libwebp/src/webp/encode.h"  // for WEBP_MAX_DIMENSION
 #include "third_party/skia/include/core/SkStream.h"
 #include "third_party/skia/include/encode/SkJpegEncoder.h"
 #include "third_party/skia/include/encode/SkPngEncoder.h"
-- 
2.17.1