1 /** 2 * Implementation of exception handling support routines. 3 * 4 * Copyright: Copyright Digital Mars 1999 - 2013. 5 * License: Distributed under the 6 * $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0). 7 * (See accompanying file LICENSE) 8 * Authors: Walter Bright 9 * Source: $(DRUNTIMESRC src/rt/deh.d) 10 */ 11 12 /* NOTE: This file has been patched from the original DMD distribution to 13 * work with the GDC compiler. 14 */ 15 module rt.deh; 16 17 extern (C) 18 { 19 Throwable.TraceInfo _d_traceContext(void* ptr = null); _d_createTrace(Object o,void * context)20 void _d_createTrace(Object o, void* context) 21 { 22 auto t = cast(Throwable) o; 23 24 if (t !is null && t.info is null && 25 cast(byte*) t !is typeid(t).initializer.ptr) 26 { 27 t.info = _d_traceContext(context); 28 } 29 } 30 } 31 32 version (GNU) 33 public import gcc.deh; 34 else version (Win32) 35 public import rt.deh_win32; 36 else version (Win64) 37 public import rt.deh_win64_posix; 38 else version (Posix) 39 public import rt.deh_win64_posix; 40 else 41 static assert (0, "Unsupported architecture"); 42 43