blob: 77ebf37efacb03a2f9acd66f702f6c9b6be83ef6 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001From 30e2ef302a329850ba55c7c458c98cbf396186ec Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 31 Dec 2015 21:47:34 +0000
4Subject: [PATCH] Fix build with non-glibc libraries on linux
5
6qualify isnan() calls with std namespace
7malloc_trim is glibc specific API so guard it with __GLIBC__
8let ctype be used on non-glibc ( musl ) C library
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12Upstream-Status: Accepted
13
14 Source/JavaScriptCore/runtime/Options.cpp | 2 +-
15 Source/WTF/wtf/DisallowCType.h | 2 +-
16 Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp | 2 ++
17 3 files changed, 4 insertions(+), 2 deletions(-)
18
19diff --git a/Source/JavaScriptCore/runtime/Options.cpp b/Source/JavaScriptCore/runtime/Options.cpp
20index fe830b4..c49aade 100644
21--- a/Source/JavaScriptCore/runtime/Options.cpp
22+++ b/Source/JavaScriptCore/runtime/Options.cpp
23@@ -610,7 +610,7 @@ bool Option::operator==(const Option& other) const
24 case Options::Type::unsignedType:
25 return m_entry.unsignedVal == other.m_entry.unsignedVal;
26 case Options::Type::doubleType:
27- return (m_entry.doubleVal == other.m_entry.doubleVal) || (isnan(m_entry.doubleVal) && isnan(other.m_entry.doubleVal));
28+ return (m_entry.doubleVal == other.m_entry.doubleVal) || (std::isnan(m_entry.doubleVal) && std::isnan(other.m_entry.doubleVal));
29 case Options::Type::int32Type:
30 return m_entry.int32Val == other.m_entry.int32Val;
31 case Options::Type::optionRangeType:
32diff --git a/Source/WTF/wtf/DisallowCType.h b/Source/WTF/wtf/DisallowCType.h
33index d85e767..dc6bcab 100644
34--- a/Source/WTF/wtf/DisallowCType.h
35+++ b/Source/WTF/wtf/DisallowCType.h
36@@ -40,7 +40,7 @@
37 // are used from wx headers. On GTK+ for Mac many GTK+ files include <libintl.h>
38 // or <glib/gi18n-lib.h>, which in turn include <xlocale/_ctype.h> which uses
39 // isacii().
40-#if !(OS(DARWIN) && PLATFORM(GTK)) && !PLATFORM(EFL) && !defined(_LIBCPP_VERSION)
41+#if !(OS(DARWIN) && PLATFORM(GTK)) && !PLATFORM(EFL) && !defined(_LIBCPP_VERSION) && defined(__GLIBC__)
42
43 #include <ctype.h>
44
45diff --git a/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp b/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp
46index ea61909..1495642 100644
47--- a/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp
48+++ b/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp
49@@ -202,7 +202,9 @@ void MemoryPressureHandler::respondToMemoryPressure(Critical critical, Synchrono
50 void MemoryPressureHandler::platformReleaseMemory(Critical)
51 {
52 ReliefLogger log("Run malloc_trim");
53+#ifdef __GLIBC__
54 malloc_trim(0);
55+#endif
56 }
57
58 void MemoryPressureHandler::ReliefLogger::platformLog()
59--
602.6.4
61