Index: runtime/platform/utils_macos.h |
=================================================================== |
--- runtime/platform/utils_macos.h (revision 21569) |
+++ runtime/platform/utils_macos.h (working copy) |
@@ -5,6 +5,8 @@ |
#ifndef PLATFORM_UTILS_MACOS_H_ |
#define PLATFORM_UTILS_MACOS_H_ |
+#include <libkern/OSByteOrder.h> // NOLINT |
+ |
namespace dart { |
inline int Utils::CountTrailingZeros(uword x) { |
@@ -17,6 +19,36 @@ |
#endif |
}; |
+ |
+inline uint16_t Utils::HostToBigEndian16(uint16_t value) { |
+ return OSSwapHostToBigInt16(value); |
+} |
+ |
+ |
+inline uint32_t Utils::HostToBigEndian32(uint32_t value) { |
+ return OSSwapHostToBigInt32(value); |
+} |
+ |
+ |
+inline uint64_t Utils::HostToBigEndian64(uint64_t value) { |
+ return OSSwapHostToBigInt64(value); |
+} |
+ |
+ |
+inline uint16_t Utils::HostToLittleEndian16(uint16_t value) { |
+ return OSSwapHostToLittleInt16(value); |
+} |
+ |
+ |
+inline uint32_t Utils::HostToLittleEndian32(uint32_t value) { |
+ return OSSwapHostToLittleInt32(value); |
+} |
+ |
+ |
+inline uint64_t Utils::HostToLittleEndian64(uint64_t value) { |
+ return OSSwapHostToLittleInt64(value); |
+} |
+ |
} // namespace dart |
#endif // PLATFORM_UTILS_MACOS_H_ |