summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2023-10-13 23:12:00 +0200
committerMoonchild <moonchild@palemoon.org>2023-11-05 13:15:26 +0100
commitb886cfadff9f7f33e4b61232577950ca3b94d81a (patch)
treeb4facf7a7ad8aed11ec4725c1806c6e8bee652ea
parent73169b686304ed93a766f59536ff7042e0d06d39 (diff)
downloaduxp-b886cfadff9f7f33e4b61232577950ca3b94d81a.tar.gz
Issue #2281 - Mark mozalloc new() as noexcept to aligh with what the VC
runtime expects. Currently spams warnings but may actually error out if not fixed, or result in undefined behaviour if mismatching signatures are treated as redeclarations with different exception specifications.
-rw-r--r--memory/mozalloc/mozalloc.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/memory/mozalloc/mozalloc.h b/memory/mozalloc/mozalloc.h
index de8c549b31..8c224472c4 100644
--- a/memory/mozalloc/mozalloc.h
+++ b/memory/mozalloc/mozalloc.h
@@ -152,14 +152,11 @@ MFBT_API void* moz_xvalloc(size_t size)
#if defined(_MSC_VER)
/*
- * Suppress build warning spam (bug 578546).
+ * Suppress build warning spam (issue #2281).
*/
-#define MOZALLOC_THROW_IF_HAS_EXCEPTIONS
-#define MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS
+#define MOZALLOC_THROW_IF_HAS_EXCEPTIONS noexcept(true)
+#define MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS noexcept(false)
#elif __cplusplus >= 201103
-/*
- * C++11 has deprecated exception-specifications in favour of |noexcept|.
- */
#define MOZALLOC_THROW_IF_HAS_EXCEPTIONS noexcept(true)
#define MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS noexcept(false)
#else