webkit-gtk2 patches for clang/libc++
Stefan Farfeleder
stefanf at FreeBSD.org
Wed Sep 11 09:13:45 UTC 2013
It seems my attached patches were eaten. Here they are again, this time
inline.
patch-Source_JavaScriptCore_wtf_Atomics.h:
--- Source/JavaScriptCore/wtf/Atomics.h.orig 2012-08-20 18:26:04.000000000 +0200
+++ Source/JavaScriptCore/wtf/Atomics.h 2013-09-10 12:03:55.000000000 +0200
@@ -65,18 +65,10 @@
#if OS(WINDOWS)
#include <windows.h>
-#elif OS(DARWIN)
-#include <libkern/OSAtomic.h>
#elif OS(QNX)
#include <atomic.h>
#elif OS(ANDROID)
#include <sys/atomics.h>
-#elif COMPILER(GCC)
-#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2))
-#include <ext/atomicity.h>
-#else
-#include <bits/atomicity.h>
-#endif
#endif
namespace WTF {
@@ -113,8 +105,8 @@
#elif COMPILER(GCC) && !CPU(SPARC64) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc
#define WTF_USE_LOCKFREE_THREADSAFEREFCOUNTED 1
-inline int atomicIncrement(int volatile* addend) { return __gnu_cxx::__exchange_and_add(addend, 1) + 1; }
-inline int atomicDecrement(int volatile* addend) { return __gnu_cxx::__exchange_and_add(addend, -1) - 1; }
+inline int atomicIncrement(int volatile* addend) { return __sync_add_and_fetch(addend, 1); }
+inline int atomicDecrement(int volatile* addend) { return __sync_sub_and_fetch(addend, 1); }
#endif
patch-Source_JavaScriptCore_wtf_DisallowCType.h:
--- Source/JavaScriptCore/wtf/DisallowCType.h.orig 2013-09-10 12:27:15.000000000 +0200
+++ Source/JavaScriptCore/wtf/DisallowCType.h 2013-09-10 12:28:32.000000000 +0200
@@ -35,6 +35,13 @@
// ASCII-specific functions instead. This header makes sure we get a compile-time
// error if we use one of the <ctype.h> functions by accident.
+// Include inlined functions using <ctype.h> first to avoid compilation errors
+#ifdef __cplusplus
+#include <cwchar>
+#include <cwctype>
+#include <string>
+#endif
+
#include <ctype.h>
#undef isalnum
patch-Tools_DumpRenderTree_gtk_DumpRenderTree.cpp:
--- Tools/DumpRenderTree/gtk/DumpRenderTree.cpp.orig 2013-09-10 13:19:16.000000000 +0200
+++ Tools/DumpRenderTree/gtk/DumpRenderTree.cpp 2013-09-10 13:19:47.000000000 +0200
@@ -48,6 +48,7 @@
#include "WorkQueueItem.h"
#include <JavaScriptCore/JavaScript.h>
#include <cassert>
+#include <clocale>
#include <cstdlib>
#include <cstring>
#include <getopt.h>
patch-Tools_DumpRenderTree_gtk_ImageDiff.cpp:
--- Tools/DumpRenderTree/gtk/ImageDiff.cpp.orig 2013-09-10 13:16:33.000000000 +0200
+++ Tools/DumpRenderTree/gtk/ImageDiff.cpp 2013-09-10 13:16:39.000000000 +0200
@@ -30,6 +30,7 @@
#include <algorithm>
#include <cmath>
#include <cstdio>
+#include <cstdlib>
#include <cstring>
#include <gdk/gdk.h>
More information about the freebsd-gnome
mailing list