summaryrefslogtreecommitdiff
path: root/www-client/chromium/files/chromium-78-gcc-enum-range.patch
blob: 9c15e954b4ea80dd53dd0b0ec35bd980411a5b9b (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
From 9662ec844017690d5fd56bf0f05ef6a540dd29c1 Mon Sep 17 00:00:00 2001
From: Tom Anderson <thomasanderson@chromium.org>
Date: Mon, 09 Sep 2019 19:06:01 +0000
Subject: [PATCH] Fix GCC build error

Fixes this error:
[  375s] In file included from ../../base/task/common/intrusive_heap.h:8,
[  375s]                  from ../../base/task/thread_pool/task_source.h:17,
[  375s]                  from ../../base/task/thread_pool/task_tracker.h:27,
[  375s]                  from ./../../base/task/thread_pool/service_thread.cc:14,
[  375s]                  from gen/base/base_jumbo_28.cc:5:
[  375s] ../../base/containers/intrusive_heap.h:152:36: error: enumerator value
         '-1' is outside the range of underlying type 'size_t' {aka 'long unsigned int'}
[  375s]   152 |   enum : size_t { kInvalidIndex = -1 };
[  375s]       |

Change-Id: I6044fb704931b2f8416f6b19a247ae297cd7b0d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1792763
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#694853}
---

diff --git a/base/containers/intrusive_heap.h b/base/containers/intrusive_heap.h
index 53d3909..d7626bb 100644
--- a/base/containers/intrusive_heap.h
+++ b/base/containers/intrusive_heap.h
@@ -131,6 +131,7 @@
 
 #include <algorithm>
 #include <functional>
+#include <limits>
 #include <type_traits>
 #include <utility>
 #include <vector>
@@ -149,7 +150,7 @@
 // in place.
 class BASE_EXPORT HeapHandle {
  public:
-  enum : size_t { kInvalidIndex = -1 };
+  enum : size_t { kInvalidIndex = std::numeric_limits<size_t>::max() };
 
   constexpr HeapHandle() = default;
   constexpr HeapHandle(const HeapHandle& other) = default;