aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorBryon Leung <teslaslegacy@gmail.com>2015-10-07 13:47:57 -0400
committerBen Noordhuis <info@bnoordhuis.nl>2015-11-24 15:26:23 +0100
commit2ccde01980f8577fbe36130689e6a85653989f51 (patch)
tree0f72ecc8fc6247be68177ebe15a0baa03c7a634b /src/util.h
parent8bc80386879538de63cd6f2aef288f59324eb004 (diff)
downloadandroid-node-v8-2ccde01980f8577fbe36130689e6a85653989f51.tar.gz
android-node-v8-2ccde01980f8577fbe36130689e6a85653989f51.tar.bz2
android-node-v8-2ccde01980f8577fbe36130689e6a85653989f51.zip
src: add BE support to StringBytes::Encode()
Versions of Node.js after v0.12 have relocated byte-swapping away from the StringBytes::Encode function, thereby causing a nan test (which accesses this function directly) to fail on big-endian machines. This change re-introduces byte swapping in StringBytes::Encode, done via a call to a function in util-inl. Another change in NodeBuffer::StringSlice was necessary to avoid double byte swapping in big-endian function calls to StringSlice. PR-URL: https://github.com/nodejs/node/pull/3410 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 20cd54758c..7b2bc0f1a2 100644
--- a/src/util.h
+++ b/src/util.h
@@ -176,6 +176,8 @@ inline void ClearWrap(v8::Local<v8::Object> object);
template <typename TypeName>
inline TypeName* Unwrap(v8::Local<v8::Object> object);
+inline void SwapBytes(uint16_t* dst, const uint16_t* src, size_t buflen);
+
class Utf8Value {
public:
explicit Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> value);