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
This commit is contained in:
Emanuel Hoogeveen 2013-06-27 16:25:42 -07:00
parent d622fa5cdc
commit 63aac72328
4 changed files with 30 additions and 4 deletions

View File

@ -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); \

View File

@ -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

View File

@ -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 <stdlib.h>
#include <string.h>
-#include <assert.h>
+#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.

View File

@ -31,15 +31,15 @@
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#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.