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

Unified Diff: runtime/vm/os_android.cc

Issue 14299008: Add utilities for converting from Host endianity to big endian and little endian formats for the va… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 | « runtime/platform/utils_win.h ('k') | runtime/vm/utils_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/os_android.cc
===================================================================
--- runtime/vm/os_android.cc (revision 21569)
+++ runtime/vm/os_android.cc (working copy)
@@ -8,6 +8,7 @@
#include "vm/os.h"
#include <android/log.h> // NOLINT
+#include <endian.h> // NOLINT
#include <errno.h> // NOLINT
#include <limits.h> // NOLINT
#include <malloc.h> // NOLINT
@@ -323,6 +324,36 @@
}
+uint16_t HostToBigEndian16(uint16_t value) {
+ return htobe16(value);
+}
+
+
+uint32_t HostToBigEndian32(uint32_t value) {
+ return htobe32(value);
+}
+
+
+uint64_t HostToBigEndian64(uint64_t value) {
+ return htobe64(value);
+}
+
+
+uint16_t HostToLittleEndian16(uint16_t value) {
+ return htole16(value);
+}
+
+
+uint32_t HostToLittleEndian32(uint32_t value) {
+ return htole32(value);
+}
+
+
+uint64_t HostToLittleEndian64(uint64_t value) {
+ return htole64(value);
+}
+
+
void OS::Print(const char* format, ...) {
va_list args;
va_start(args, format);
« no previous file with comments | « runtime/platform/utils_win.h ('k') | runtime/vm/utils_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698