aboutsummaryrefslogtreecommitdiff
path: root/libphobos/src/std/outbuffer.d
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gcc.gnu.org>2019-04-22 13:46:25 +0000
committerIain Buclaw <ibuclaw@gcc.gnu.org>2019-04-22 13:46:25 +0000
commit105d4c85f3c0591d0f67e84df23c3518c9a313e3 (patch)
treeb6beb42c9cb6dcfabd7f57846c7d9fc4f157055e /libphobos/src/std/outbuffer.d
parenteb5f748a81eafb8014de39e60884c1617d60eb79 (diff)
downloadgcc-105d4c85f3c0591d0f67e84df23c3518c9a313e3.zip
gcc-105d4c85f3c0591d0f67e84df23c3518c9a313e3.tar.gz
gcc-105d4c85f3c0591d0f67e84df23c3518c9a313e3.tar.bz2
libphobos: Merge upstream phobos b538f758a
Fixes endian bugs in std.uni, and corrects unit-tests that failed on version(BigEndian) targets. Initial patch by Robin Dapp. Reviewed-on: https://github.com/dlang/phobos/pull/6975 From-SVN: r270491
Diffstat (limited to 'libphobos/src/std/outbuffer.d')
-rw-r--r--libphobos/src/std/outbuffer.d10
1 files changed, 8 insertions, 2 deletions
diff --git a/libphobos/src/std/outbuffer.d b/libphobos/src/std/outbuffer.d
index 1d59498..d76ead2 100644
--- a/libphobos/src/std/outbuffer.d
+++ b/libphobos/src/std/outbuffer.d
@@ -408,11 +408,17 @@ class OutBuffer
{
OutBuffer buf = new OutBuffer();
"hello"w.copy(buf);
- assert(buf.toBytes() == "h\x00e\x00l\x00l\x00o\x00");
+ version (LittleEndian)
+ assert(buf.toBytes() == "h\x00e\x00l\x00l\x00o\x00");
+ version (BigEndian)
+ assert(buf.toBytes() == "\x00h\x00e\x00l\x00l\x00o");
}
{
OutBuffer buf = new OutBuffer();
"hello"d.copy(buf);
- assert(buf.toBytes() == "h\x00\x00\x00e\x00\x00\x00l\x00\x00\x00l\x00\x00\x00o\x00\x00\x00");
+ version (LittleEndian)
+ assert(buf.toBytes() == "h\x00\x00\x00e\x00\x00\x00l\x00\x00\x00l\x00\x00\x00o\x00\x00\x00");
+ version (BigEndian)
+ assert(buf.toBytes() == "\x00\x00\x00h\x00\x00\x00e\x00\x00\x00l\x00\x00\x00l\x00\x00\x00o");
}
}