On Friday, 12 March 2021 at 05:53:40 UTC, Preetpal wrote:
In the portability section of the language spec, they talk
about endianness
(https://dlang.org/spec/portability.html#endianness) which
refers "to the order in which multibyte types are stored." IMO
if you wanted to actually be sure you
On Friday, 12 March 2021 at 10:26:55 UTC, Dennis wrote:
```
version(BigEndian) {
private enum bigEndian = true;
} else {
private enum bigEndian = false;
}
int parse(in ubyte[] data) {
if (__ctfe || bigEndian) {
// Portable code
} else {
// Little-endian optimized
On Friday, 12 March 2021 at 05:53:40 UTC, Preetpal wrote:
This is not an important issue to me but I was just curious to
see if anyone actually tests for portability issues related to
endianness by compiling their D Lang code for a big endian
architecture and actually running it on that system.
In the portability section of the language spec, they talk about
endianness (https://dlang.org/spec/portability.html#endianness)
which refers "to the order in which multibyte types are stored."
IMO if you wanted to actually be sure your code is portable
across both big endian and little endian