Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1224)

Unified Diff: runtime/platform/assert.cc

Issue 10968027: Fix Android build breaks (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/platform/assert_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/assert.cc
diff --git a/runtime/platform/assert.cc b/runtime/platform/assert.cc
deleted file mode 100644
index 2ea934965eb53437d05705ac9f73987982c421b9..0000000000000000000000000000000000000000
--- a/runtime/platform/assert.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-#include "platform/assert.h"
-
-#include <cstdlib>
cshapiro 2012/09/21 03:14:54 I think the only reason to use the c++ include ins
-#include <sstream>
-#include <string>
-
-#include "platform/globals.h"
-
-namespace dart {
-
-// Exit with a failure code when we miss an EXPECT check.
-static void failed_exit(void) {
- exit(255);
-}
-
-void DynamicAssertionHelper::Fail(const char* format, ...) {
- std::ostringstream stream;
- stream << file_ << ":" << line_ << ": error: ";
-
- va_list arguments;
- va_start(arguments, format);
- char buffer[2 * KB];
- vsnprintf(buffer, sizeof(buffer), format, arguments);
- va_end(arguments);
- stream << buffer << std::endl;
-
- // Get the message from the string stream and dump it on stderr.
- std::string message = stream.str();
- fprintf(stderr, "%s", message.c_str());
-
- // In case of failed assertions, abort right away. Otherwise, wait
- // until the program is exiting before producing a non-zero exit
- // code through abort.
- // TODO(5411324): replace std::abort with OS::Abort so that we can handle
- // restoring of signal handlers before aborting.
- if (kind_ == ASSERT) {
- std::abort();
- }
- static bool failed = false;
- if (!failed) {
- std::atexit(&failed_exit);
- }
- failed = true;
-}
-
-} // namespace dart
« no previous file with comments | « no previous file | runtime/platform/assert_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698