Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 1 | From 30e2ef302a329850ba55c7c458c98cbf396186ec Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Thu, 31 Dec 2015 21:47:34 +0000 |
| 4 | Subject: [PATCH] Fix build with non-glibc libraries on linux |
| 5 | |
| 6 | qualify isnan() calls with std namespace |
| 7 | malloc_trim is glibc specific API so guard it with __GLIBC__ |
| 8 | let ctype be used on non-glibc ( musl ) C library |
| 9 | |
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 11 | --- |
| 12 | Upstream-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 | |
| 19 | diff --git a/Source/JavaScriptCore/runtime/Options.cpp b/Source/JavaScriptCore/runtime/Options.cpp |
| 20 | index 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: |
| 32 | diff --git a/Source/WTF/wtf/DisallowCType.h b/Source/WTF/wtf/DisallowCType.h |
| 33 | index 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 | |
| 45 | diff --git a/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp b/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp |
| 46 | index 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 | -- |
| 60 | 2.6.4 |
| 61 | |