# HG changeset patch # User Frank Benoit # Date 1222523902 -7200 # Node ID ffb904674b524271bce23fbc5ba8a78a50a6bcac # Parent f516317c1e8947d6cedcff2b3a6635973bb0ce93 Fixes for LLVMDC diff -r f516317c1e89 -r ffb904674b52 dwt/accessibility/AccessibleObject.d --- a/dwt/accessibility/AccessibleObject.d Fri Sep 19 22:29:59 2008 +0200 +++ b/dwt/accessibility/AccessibleObject.d Sat Sep 27 15:58:22 2008 +0200 @@ -1224,7 +1224,7 @@ return result !is null ? result : new AccessibleTextListener [0]; } - private static extern(C) void gObjectClass_finalize (GObject* atkObject) { + package static extern(C) void gObjectClass_finalize (GObject* atkObject) { auto superType = ATK.g_type_class_peek_parent (ATK.G_OBJECT_GET_CLASS (cast(GTypeInstance*)atkObject)); auto objectClassStruct = cast(GObjectClass*)ATK.G_OBJECT_CLASS (cast(GTypeClass*)superType); objectClassStruct.finalize(atkObject); diff -r f516317c1e89 -r ffb904674b52 dwt/internal/accessibility/gtk/ATK.d --- a/dwt/internal/accessibility/gtk/ATK.d Fri Sep 19 22:29:59 2008 +0200 +++ b/dwt/internal/accessibility/gtk/ATK.d Sat Sep 27 15:58:22 2008 +0200 @@ -60,12 +60,17 @@ } - - template NameOfFunc(alias f) { // Note: highly dependent on the .stringof formatting // the value begins with "& " which is why the first two chars are cut off - const String NameOfFunc = (&f).stringof[2 .. $]; + version( LLVMDC ){ + // stringof in LLVMDC is "&foobar" + const char[] NameOfFunc = (&f).stringof[1 .. $]; + } + else{ + // stringof in DMD is "& foobar" + const char[] NameOfFunc = (&f).stringof[2 .. $]; + } } template ForwardGtkAtkCFunc( alias cFunc ) { diff -r f516317c1e89 -r ffb904674b52 dwt/internal/cairo/Cairo.d --- a/dwt/internal/cairo/Cairo.d Fri Sep 19 22:29:59 2008 +0200 +++ b/dwt/internal/cairo/Cairo.d Sat Sep 27 15:58:22 2008 +0200 @@ -63,7 +63,14 @@ template NameOfFunc(alias f) { // Note: highly dependent on the .stringof formatting // the value begins with "& " which is why the first two chars are cut off - const String NameOfFunc = (&f).stringof[2 .. $]; + version( LLVMDC ){ + // stringof in LLVMDC is "&foobar" + const char[] NameOfFunc = (&f).stringof[1 .. $]; + } + else{ + // stringof in DMD is "& foobar" + const char[] NameOfFunc = (&f).stringof[2 .. $]; + } } template ForwardGtkCairoCFunc( alias cFunc ) { diff -r f516317c1e89 -r ffb904674b52 dwt/internal/gtk/OS.d --- a/dwt/internal/gtk/OS.d Fri Sep 19 22:29:59 2008 +0200 +++ b/dwt/internal/gtk/OS.d Sat Sep 27 15:58:22 2008 +0200 @@ -616,7 +616,14 @@ template NameOfFunc(alias f) { // Note: highly dependent on the .stringof formatting // the value begins with "& " which is why the first two chars are cut off - const char[] NameOfFunc = (&f).stringof[2 .. $]; + version( LLVMDC ){ + // stringof in LLVMDC is "&foobar" + const char[] NameOfFunc = (&f).stringof[1 .. $]; + } + else{ + // stringof in DMD is "& foobar" + const char[] NameOfFunc = (&f).stringof[2 .. $]; + } } template ForwardGtkOsCFunc( alias cFunc ) { diff -r f516317c1e89 -r ffb904674b52 dwt/widgets/Display.d --- a/dwt/widgets/Display.d Fri Sep 19 22:29:59 2008 +0200 +++ b/dwt/widgets/Display.d Sat Sep 27 15:58:22 2008 +0200 @@ -3649,7 +3649,7 @@ OS.gtk_container_forall (cast(GtkContainer*)widget, cast(GtkCallback)&setDirectionProcFunc, &setDirectionProcCallbackData); } -private static extern(C) int /*long*/ setDirectionProcFunc (GtkWidget* widget, void* data) { +package static extern(C) int /*long*/ setDirectionProcFunc (GtkWidget* widget, void* data) { version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; CallbackData* cbdata = cast(CallbackData*)data; return cbdata.display.setDirectionProc( widget, cast(int)cbdata.data );