diff options
author | joerg <joerg@pkgsrc.org> | 2013-11-29 13:00:32 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2013-11-29 13:00:32 +0000 |
commit | c533f80ae079b5f00b981fcfdd5fa2a605712875 (patch) | |
tree | abcddd74752e16e4097465fa0e6b1ce6da174411 | |
parent | a87c9b8f983f25c8eb4cea88efa27a9952fc56c9 (diff) | |
download | pkgsrc-c533f80ae079b5f00b981fcfdd5fa2a605712875.tar.gz |
ISO C++ says that replacement operators new/delete must be global.
-rw-r--r-- | www/firefox/distinfo | 5 | ||||
-rw-r--r-- | www/firefox/patches/patch-memory_mozalloc_fallible.h | 28 | ||||
-rw-r--r-- | www/firefox/patches/patch-memory_mozalloc_mozalloc.cpp | 83 | ||||
-rw-r--r-- | www/firefox/patches/patch-memory_mozalloc_mozalloc.h | 156 |
4 files changed, 271 insertions, 1 deletions
diff --git a/www/firefox/distinfo b/www/firefox/distinfo index 7a936e6cb30..4a1a8714e21 100644 --- a/www/firefox/distinfo +++ b/www/firefox/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.125 2013/11/21 15:24:38 ryoon Exp $ +$NetBSD: distinfo,v 1.126 2013/11/29 13:00:32 joerg Exp $ SHA1 (firefox-25.0.1.source.tar.bz2) = 592ebd242c4839ef0e18707a7e959d8bed2a98f3 RMD160 (firefox-25.0.1.source.tar.bz2) = a1868d0299f6670b7fd8d7b92af7006ecefbc891 @@ -95,6 +95,9 @@ SHA1 (patch-media_webrtc_trunk_webrtc_modules_video__capture_video__capture__fac SHA1 (patch-media_webrtc_trunk_webrtc_system__wrappers_source_condition__variable.cc) = f4e7dd4356499589eaad642c875ad0c9e4b4cab5 SHA1 (patch-media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spreadsort.hpp) = 853b178ca1b95c6907ca2fc2de9865807661a8f5 SHA1 (patch-media_webrtc_trunk_webrtc_system__wrappers_source_thread__posix.cc) = cde91cf030a827aca9de8ad31c2e724a183678d1 +SHA1 (patch-memory_mozalloc_fallible.h) = 8a60151465a07570db9636313f504004d73941d5 +SHA1 (patch-memory_mozalloc_mozalloc.cpp) = 802af1da05f60fcf8c206568c2adc396e3bb0e06 +SHA1 (patch-memory_mozalloc_mozalloc.h) = f2d9fd333ec28c075dfde8a6ee414b67b7f2cd26 SHA1 (patch-memory_mozalloc_mozalloc__abort.cpp) = 9d9036ddd28c7b8ce37860e0120df2997a3a0c59 SHA1 (patch-mfbt_Atomics.h) = 1a1df4189cf8da1182baa5c2e9909f9add6d2451 SHA1 (patch-mfbt_Poison.cpp) = b582943c02f57835451c9eecd004c9912d42ce84 diff --git a/www/firefox/patches/patch-memory_mozalloc_fallible.h b/www/firefox/patches/patch-memory_mozalloc_fallible.h new file mode 100644 index 00000000000..66dc8849a2a --- /dev/null +++ b/www/firefox/patches/patch-memory_mozalloc_fallible.h @@ -0,0 +1,28 @@ +$NetBSD: patch-memory_mozalloc_fallible.h,v 1.1 2013/11/29 13:00:32 joerg Exp $ + +--- memory/mozalloc/fallible.h.orig 2013-11-18 16:22:30.000000000 +0000 ++++ memory/mozalloc/fallible.h +@@ -5,9 +5,22 @@ + #ifndef mozilla_fallible_h + #define mozilla_fallible_h + ++#if defined(MOZALLOC_EXPORT) ++/* do nothing: it's been defined to __declspec(dllexport) by ++ * mozalloc*.cpp on platforms where that's required. */ ++#elif defined(XP_WIN) || (defined(XP_OS2) && defined(__declspec)) ++# define MOZALLOC_EXPORT __declspec(dllimport) ++#elif defined(HAVE_VISIBILITY_ATTRIBUTE) ++/* Make sure symbols are still exported even if we're wrapped in a ++ * |visibility push(hidden)| blanket. */ ++# define MOZALLOC_EXPORT __attribute__ ((visibility ("default"))) ++#else ++# define MOZALLOC_EXPORT ++#endif ++ + namespace mozilla { + +-struct fallible_t { }; ++struct MOZALLOC_EXPORT fallible_t { }; + + } // namespace mozilla + diff --git a/www/firefox/patches/patch-memory_mozalloc_mozalloc.cpp b/www/firefox/patches/patch-memory_mozalloc_mozalloc.cpp new file mode 100644 index 00000000000..236f7e99fb2 --- /dev/null +++ b/www/firefox/patches/patch-memory_mozalloc_mozalloc.cpp @@ -0,0 +1,83 @@ +$NetBSD: patch-memory_mozalloc_mozalloc.cpp,v 1.1 2013/11/29 13:00:32 joerg Exp $ + +https://bugzilla.mozilla.org/show_bug.cgi?id=928808 + +--- memory/mozalloc/mozalloc.cpp.orig 2013-10-25 22:27:35.000000000 +0000 ++++ memory/mozalloc/mozalloc.cpp +@@ -229,3 +229,76 @@ namespace mozilla { + const fallible_t fallible = fallible_t(); + + } // namespace mozilla ++ ++ ++MOZALLOC_EXPORT ++void* operator new(size_t size) MOZALLOC_THROW_BAD_ALLOC ++{ ++ return moz_xmalloc(size); ++} ++ ++MOZALLOC_EXPORT ++void* operator new(size_t size, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ return moz_malloc(size); ++} ++ ++MOZALLOC_EXPORT ++void* operator new[](size_t size) MOZALLOC_THROW_BAD_ALLOC ++{ ++ return moz_xmalloc(size); ++} ++ ++MOZALLOC_EXPORT ++void* operator new[](size_t size, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ return moz_malloc(size); ++} ++ ++MOZALLOC_EXPORT ++void operator delete(void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ return moz_free(ptr); ++} ++ ++MOZALLOC_EXPORT ++void operator delete(void* ptr, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ return moz_free(ptr); ++} ++ ++MOZALLOC_EXPORT ++void operator delete[](void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ return moz_free(ptr); ++} ++ ++MOZALLOC_EXPORT ++void operator delete[](void* ptr, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ return moz_free(ptr); ++} ++ ++MOZALLOC_EXPORT ++void* operator new(size_t size, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ return moz_malloc(size); ++} ++ ++MOZALLOC_EXPORT ++void* operator new[](size_t size, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ return moz_malloc(size); ++} ++ ++MOZALLOC_EXPORT ++void operator delete(void* ptr, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ moz_free(ptr); ++} ++ ++MOZALLOC_EXPORT ++void operator delete[](void* ptr, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ moz_free(ptr); ++} diff --git a/www/firefox/patches/patch-memory_mozalloc_mozalloc.h b/www/firefox/patches/patch-memory_mozalloc_mozalloc.h new file mode 100644 index 00000000000..24e6b4a5bfa --- /dev/null +++ b/www/firefox/patches/patch-memory_mozalloc_mozalloc.h @@ -0,0 +1,156 @@ +$NetBSD: patch-memory_mozalloc_mozalloc.h,v 1.1 2013/11/29 13:00:32 joerg Exp $ + +https://bugzilla.mozilla.org/show_bug.cgi?id=928808 + +--- memory/mozalloc/mozalloc.h.orig 2013-10-25 22:27:35.000000000 +0000 ++++ memory/mozalloc/mozalloc.h +@@ -39,15 +39,6 @@ + # define MOZALLOC_EXPORT + #endif + +- +-#if defined(MOZ_ALWAYS_INLINE_EVEN_DEBUG) +-# define MOZALLOC_INLINE MOZ_ALWAYS_INLINE_EVEN_DEBUG +-#elif defined(HAVE_FORCEINLINE) +-# define MOZALLOC_INLINE __forceinline +-#else +-# define MOZALLOC_INLINE inline +-#endif +- + /* Workaround build problem with Sun Studio 12 */ + #if defined(__SUNPRO_C) || defined(__SUNPRO_CC) + # undef NS_WARN_UNUSED_RESULT +@@ -171,15 +162,6 @@ MOZALLOC_EXPORT void* moz_valloc(size_t + * that |::operator new() throw(std::bad_alloc)| will never return NULL. + */ + +-/* NB: This is defined just to silence vacuous warnings about symbol +- * visibility on OS X/gcc. These symbols are force-inline and not +- * exported. */ +-#if defined(XP_MACOSX) +-# define MOZALLOC_EXPORT_NEW MOZALLOC_EXPORT +-#else +-# define MOZALLOC_EXPORT_NEW +-#endif +- + #if defined(ANDROID) || defined(_MSC_VER) + /* + * Android doesn't fully support exceptions, so its <new> header +@@ -195,53 +177,29 @@ MOZALLOC_EXPORT void* moz_valloc(size_t + + #define MOZALLOC_THROW_BAD_ALLOC MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS + +-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE +-void* operator new(size_t size) MOZALLOC_THROW_BAD_ALLOC +-{ +- return moz_xmalloc(size); +-} +- +-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE +-void* operator new(size_t size, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- return moz_malloc(size); +-} +- +-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE +-void* operator new[](size_t size) MOZALLOC_THROW_BAD_ALLOC +-{ +- return moz_xmalloc(size); +-} +- +-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE +-void* operator new[](size_t size, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- return moz_malloc(size); +-} +- +-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE +-void operator delete(void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- return moz_free(ptr); +-} +- +-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE +-void operator delete(void* ptr, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- return moz_free(ptr); +-} +- +-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE +-void operator delete[](void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- return moz_free(ptr); +-} +- +-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE +-void operator delete[](void* ptr, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- return moz_free(ptr); +-} ++MOZALLOC_EXPORT ++void* operator new(size_t size) MOZALLOC_THROW_BAD_ALLOC; ++ ++MOZALLOC_EXPORT ++void* operator new(size_t size, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; ++ ++MOZALLOC_EXPORT ++void* operator new[](size_t size) MOZALLOC_THROW_BAD_ALLOC; ++ ++MOZALLOC_EXPORT ++void* operator new[](size_t size, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; ++ ++MOZALLOC_EXPORT ++void operator delete(void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; ++ ++MOZALLOC_EXPORT ++void operator delete(void* ptr, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; ++ ++MOZALLOC_EXPORT ++void operator delete[](void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; ++ ++MOZALLOC_EXPORT ++void operator delete[](void* ptr, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; + + + /* +@@ -263,29 +221,17 @@ void operator delete[](void* ptr, const + * (4) the matching system |operator delete(void*) throw(std::bad_alloc)| + */ + +-MOZALLOC_INLINE +-void* operator new(size_t size, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- return moz_malloc(size); +-} +- +-MOZALLOC_INLINE +-void* operator new[](size_t size, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- return moz_malloc(size); +-} +- +-MOZALLOC_INLINE +-void operator delete(void* ptr, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- moz_free(ptr); +-} +- +-MOZALLOC_INLINE +-void operator delete[](void* ptr, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- moz_free(ptr); +-} ++MOZALLOC_EXPORT ++void* operator new(size_t size, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; ++ ++MOZALLOC_EXPORT ++void* operator new[](size_t size, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; ++ ++MOZALLOC_EXPORT ++void operator delete(void* ptr, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; ++ ++MOZALLOC_EXPORT ++void operator delete[](void* ptr, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; + + #endif /* ifdef __cplusplus */ + |