changeset 321:ffb904674b52

Fixes for LLVMDC
author Frank Benoit <benoit@tionex.de>
date Sat, 27 Sep 2008 15:58:22 +0200
parents f516317c1e89
children 96b14a31d9b3
files dwt/accessibility/AccessibleObject.d dwt/internal/accessibility/gtk/ATK.d dwt/internal/cairo/Cairo.d dwt/internal/gtk/OS.d dwt/widgets/Display.d
diffstat 5 files changed, 26 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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);
--- 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 ) {
--- 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 ) {
--- 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 ) {
--- 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 );