From 63aac72328874d38b753bbb12bde9853a662533d Mon Sep 17 00:00:00 2001 From: Emanuel Hoogeveen Date: Thu, 27 Jun 2013 16:25:42 -0700 Subject: [PATCH] Bug 887465 - Rewrite double-conversion's assertions in terms of the MOZ_* assertions, and keep wtf (Yarr) from redefining them. r=jwalden --HG-- extra : rebase_source : 3cdadf85f6bc471f065d570cb03d2441886d3738 --- js/src/assembler/wtf/Assertions.h | 2 ++ mfbt/double-conversion/update.sh | 1 + .../use-mozilla-assertions.patch | 23 +++++++++++++++++++ mfbt/double-conversion/utils.h | 8 +++---- 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 mfbt/double-conversion/use-mozilla-assertions.patch diff --git a/js/src/assembler/wtf/Assertions.h b/js/src/assembler/wtf/Assertions.h index eb0744e746e..69ff59a0a9e 100644 --- a/js/src/assembler/wtf/Assertions.h +++ b/js/src/assembler/wtf/Assertions.h @@ -37,7 +37,9 @@ # define ASSERT_DISABLED 1 #endif +#ifndef ASSERT #define ASSERT(assertion) MOZ_ASSERT(assertion) +#endif #define ASSERT_UNUSED(variable, assertion) do { \ (void)variable; \ ASSERT(assertion); \ diff --git a/mfbt/double-conversion/update.sh b/mfbt/double-conversion/update.sh index 7bb417c3364..5cbd18cec8f 100755 --- a/mfbt/double-conversion/update.sh +++ b/mfbt/double-conversion/update.sh @@ -18,3 +18,4 @@ cp $1/src/*.cc ./ patch -p3 < add-mfbt-api-markers.patch patch -p3 < use-StandardInteger.patch +patch -p3 < use-mozilla-assertions.patch diff --git a/mfbt/double-conversion/use-mozilla-assertions.patch b/mfbt/double-conversion/use-mozilla-assertions.patch new file mode 100644 index 00000000000..c98565f655d --- /dev/null +++ b/mfbt/double-conversion/use-mozilla-assertions.patch @@ -0,0 +1,23 @@ +diff --git a/mfbt/double-conversion/utils.h b/mfbt/double-conversion/utils.h +--- a/mfbt/double-conversion/utils.h ++++ b/mfbt/double-conversion/utils.h +@@ -31,15 +31,15 @@ + #include + #include + +-#include ++#include "mozilla/Assertions.h" + #ifndef ASSERT +-#define ASSERT(condition) (assert(condition)) ++#define ASSERT(condition) MOZ_ASSERT(condition) + #endif + #ifndef UNIMPLEMENTED +-#define UNIMPLEMENTED() (abort()) ++#define UNIMPLEMENTED() MOZ_CRASH() + #endif + #ifndef UNREACHABLE +-#define UNREACHABLE() (abort()) ++#define UNREACHABLE() MOZ_CRASH() + #endif + + // Double operations detection based on target architecture. diff --git a/mfbt/double-conversion/utils.h b/mfbt/double-conversion/utils.h index 6d67729b23f..6d2c27f00be 100644 --- a/mfbt/double-conversion/utils.h +++ b/mfbt/double-conversion/utils.h @@ -31,15 +31,15 @@ #include #include -#include +#include "mozilla/Assertions.h" #ifndef ASSERT -#define ASSERT(condition) (assert(condition)) +#define ASSERT(condition) MOZ_ASSERT(condition) #endif #ifndef UNIMPLEMENTED -#define UNIMPLEMENTED() (abort()) +#define UNIMPLEMENTED() MOZ_CRASH() #endif #ifndef UNREACHABLE -#define UNREACHABLE() (abort()) +#define UNREACHABLE() MOZ_CRASH() #endif // Double operations detection based on target architecture.