summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/mozjs/mozjs-115/1849070.patch
blob: c19a32690df60cbf1b4c8ecfa8ed962ae8399700 (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
Bug 1849070 - Avoid using char_traits<unsigned char>. r=spidermonkey-reviewers,anba

It is not guaranteed to exist by the standard, and is actively being
removed from libc++ in LLVM 18.

Differential Revision: https://phabricator.services.mozilla.com/D186421

Upstream-Status: Backport [https://hg.mozilla.org/mozilla-central/rev/68ff4d3f7338248b4d67cf03aade5a73f8d396b2]
Signed-off-by: Khem Raj <raj.khem@gmail.com>

--- a/js/src/builtin/intl/Locale.cpp
+++ b/js/src/builtin/intl/Locale.cpp
@@ -802,8 +802,10 @@ static inline auto FindUnicodeExtensionT
                                             UnicodeKey key) {
   JS::AutoCheckCannotGC nogc;
   return unicodeExtension->hasLatin1Chars()
-             ? FindUnicodeExtensionType(unicodeExtension->latin1Chars(nogc),
-                                        unicodeExtension->length(), key)
+             ? FindUnicodeExtensionType(
+                   reinterpret_cast<const char*>(
+                       unicodeExtension->latin1Chars(nogc)),
+                   unicodeExtension->length(), key)
              : FindUnicodeExtensionType(unicodeExtension->twoByteChars(nogc),
                                         unicodeExtension->length(), key);
 }
@@ -920,7 +922,9 @@ static BaseNamePartsResult BaseNameParts
 static inline auto BaseNameParts(JSLinearString* baseName) {
   JS::AutoCheckCannotGC nogc;
   return baseName->hasLatin1Chars()
-             ? BaseNameParts(baseName->latin1Chars(nogc), baseName->length())
+             ? BaseNameParts(
+                   reinterpret_cast<const char*>(baseName->latin1Chars(nogc)),
+                   baseName->length())
              : BaseNameParts(baseName->twoByteChars(nogc), baseName->length());
 }