comparison qt/d2/qt/Signal.d @ 188:7dd099050621

initial commit for D2 support
author eldar
date Sun, 12 Jul 2009 18:58:03 +0000
parents 6faf3d3cb95e
children a1b48a630f73
comparison
equal deleted inserted replaced
187:34fe79a9915b 188:7dd099050621
15 public import std.metastrings; 15 public import std.metastrings;
16 import core.stdc.stdlib : crealloc = realloc, cfree = free; 16 import core.stdc.stdlib : crealloc = realloc, cfree = free;
17 import core.stdc.string : memmove; 17 import core.stdc.string : memmove;
18 import 18 import
19 std.traits, 19 std.traits,
20 core.thread; 20 core.thread,
21 core.exception;
21 22
22 23
23 24
24 debug import std.stdio; 25 debug import std.stdio;
25 26
33 34
34 void realloc(T)(ref T[] a, size_t length) 35 void realloc(T)(ref T[] a, size_t length)
35 { 36 {
36 a = (cast(T*)crealloc(a.ptr, length * T.sizeof))[0..length]; 37 a = (cast(T*)crealloc(a.ptr, length * T.sizeof))[0..length];
37 if (!a.ptr) 38 if (!a.ptr)
38 new OutOfMemoryException(__FILE__, __LINE__); 39 new OutOfMemoryError(__FILE__, __LINE__);
39 } 40 }
40 41
41 unittest 42 unittest
42 { 43 {
43 int[] a; 44 int[] a;