Mercurial > projects > ldc
diff lphobos/internal/arrays.d @ 40:8b0e809563df trunk
[svn r44] Lots of bug fixes.
New array literal support
New array ~= operator support (for single element)
New with statement support
More...
author | lindquist |
---|---|
date | Fri, 19 Oct 2007 07:43:21 +0200 |
parents | c53b6e3fe49a |
children | 0c77619e803b |
line wrap: on
line diff
--- a/lphobos/internal/arrays.d Wed Oct 10 06:21:31 2007 +0200 +++ b/lphobos/internal/arrays.d Fri Oct 19 07:43:21 2007 +0200 @@ -2,6 +2,8 @@ extern(C): +// per-element array init routines + void _d_array_init_i1(bool* a, size_t n, bool v) { auto p = a; @@ -65,3 +67,21 @@ while (p !is end) *p++ = v; } + +// array comparison routines +int memcmp(void*,void*,size_t); + +bool _d_static_array_eq(void* lhs, void* rhs, size_t bytesize) +{ + if (lhs is rhs) + return true; + return memcmp(lhs,rhs,bytesize) == 0; +} + +bool _d_static_array_neq(void* lhs, void* rhs, size_t bytesize) +{ + if (lhs is rhs) + return false; + return memcmp(lhs,rhs,bytesize) != 0; +} +