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

Unified Diff: runtime/third_party/double-conversion/src/utils.h

Issue 8725003: Integrate double-conversion into build-process. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 9 years, 1 month 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 | « runtime/third_party/double-conversion/src/double-conversion.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/third_party/double-conversion/src/utils.h
diff --git a/runtime/third_party/double-conversion/src/utils.h b/runtime/third_party/double-conversion/src/utils.h
index 710fd7fbb72d7647fda8c2fc4cfe8999d6c1110d..cd3e330061dfda3cd81ed62d34c7b8a4f5fab7ea 100644
--- a/runtime/third_party/double-conversion/src/utils.h
+++ b/runtime/third_party/double-conversion/src/utils.h
@@ -32,9 +32,15 @@
#include <string.h>
#include <assert.h>
+#ifndef ASSERT
#define ASSERT(condition) (assert(condition))
+#endif
+#ifndef UNIMPLEMENTED
#define UNIMPLEMENTED() (abort())
+#endif
+#ifndef UNREACHABLE
#define UNREACHABLE() (abort())
+#endif
// Double operations detection based on target architecture.
// Linux uses a 80bit wide floating point stack on x86. This induces double
@@ -90,15 +96,19 @@ typedef unsigned __int64 uint64_t;
// size_t which represents the number of elements of the given
// array. You should only use ARRAY_SIZE on statically allocated
// arrays.
+#ifndef ARRAY_SIZE
#define ARRAY_SIZE(a) \
((sizeof(a) / sizeof(*(a))) / \
static_cast<size_t>(!(sizeof(a) % sizeof(*(a)))))
+#endif
// A macro to disallow the evil copy constructor and operator= functions
// This should be used in the private: declarations for a class
+#ifndef DISALLOW_COPY_AND_ASSIGN
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&); \
void operator=(const TypeName&)
+#endif
// A macro to disallow all the implicit constructors, namely the
// default constructor, copy constructor and operator= functions.
@@ -106,9 +116,11 @@ typedef unsigned __int64 uint64_t;
// This should be used in the private: declarations for a class
// that wants to prevent anyone from instantiating it. This is
// especially useful for classes containing only static methods.
+#ifndef DISALLOW_IMPLICIT_CONSTRUCTORS
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
TypeName(); \
DISALLOW_COPY_AND_ASSIGN(TypeName)
+#endif
namespace double_conversion {
@@ -218,7 +230,7 @@ class StringBuilder {
void AddSubstring(const char* s, int n) {
ASSERT(!is_finalized() && position_ + n < buffer_.length());
ASSERT(static_cast<size_t>(n) <= strlen(s));
- memcpy(&buffer_[position_], s, n * kCharSize);
+ memmove(&buffer_[position_], s, n * kCharSize);
position_ += n;
}
@@ -283,7 +295,7 @@ inline Dest BitCast(const Source& source) {
typedef char VerifySizesAreEqual[sizeof(Dest) == sizeof(Source) ? 1 : -1];
Dest dest;
- memcpy(&dest, &source, sizeof(dest));
+ memmove(&dest, &source, sizeof(dest));
return dest;
}
« no previous file with comments | « runtime/third_party/double-conversion/src/double-conversion.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698