FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

latest compilers

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
lurker



Joined: 18 Apr 2008
Posts: 4
Location: Internet

PostPosted: Tue Mar 24, 2009 3:45 am    Post subject: latest compilers Reply with quote

hi,

will there be compilable versions for the latest 2.x and 1.x compiler?
getting desperate for 2.026

thanks
Back to top
View user's profile Send private message
haru-s



Joined: 28 Mar 2009
Posts: 8
Location: Japan

PostPosted: Sat Mar 28, 2009 11:59 am    Post subject: Re: latest compilers Reply with quote

lurker wrote:
hi,

will there be compilable versions for the latest 2.x and 1.x compiler?
getting desperate for 2.026

thanks


Hi.
For dmd 2.026 and DFL rev78 on Windows, rewrite DFL source like this:

Code:
diff -U 1 -r dfl/application.d dfl2021/application.d
--- dfl/application.d   Sun Mar 29 02:17:08 2009
+++ dfl2021/application.d   Sun Mar 29 01:39:58 2009
@@ -178,7 +178,7 @@
    {
-      const Dstring MANIFEST = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>` \r\n
-         `<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">` \r\n
-            `<description>DFL manifest</description>` \r\n
-            `<dependency>` \r\n
-               `<dependentAssembly>` \r\n
+      const Dstring MANIFEST = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>` "\r\n"
+         `<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">` "\r\n"
+            `<description>DFL manifest</description>` "\r\n"
+            `<dependency>` "\r\n"
+               `<dependentAssembly>` "\r\n"
                   `<assemblyIdentity `
@@ -190,6 +190,6 @@
                      `language="*" `
-                  `/>` \r\n
-               `</dependentAssembly>` \r\n
-            `</dependency>` \r\n
-         `</assembly>` \r\n;
+                  `/>` "\r\n"
+               `</dependentAssembly>` "\r\n"
+            `</dependency>` "\r\n"
+         `</assembly>` "\r\n";
       
diff -U 1 -r dfl/data.d dfl2021/data.d
--- dfl/data.d   Sun Mar 29 02:17:08 2009
+++ dfl2021/data.d   Sun Mar 29 01:40:38 2009
@@ -462,3 +462,3 @@
          //return cast(void[])(data.getUnicodeText() ~ cast(Dwstring)\0); // Needed in D2. Not guaranteed safe.
-         return (data.getUnicodeText() ~ cast(Dwstring)\0).dup; // Needed in D2.
+         return (data.getUnicodeText() ~ cast(Dwstring)"\0").dup; // Needed in D2.
       }
@@ -468,3 +468,3 @@
          //return cast(void[])((*cast(Ddstring*)data.value) ~ \0); // Needed in D2. Not guaranteed safe.
-         return ((*cast(Ddstring*)data.value) ~ \0).dup; // Needed in D2.
+         return ((*cast(Ddstring*)data.value) ~ "\0").dup; // Needed in D2.
       }
Only in dfl: dflcompile.info
diff -U 1 -r dfl/drawing.d dfl2021/drawing.d
--- dfl/drawing.d   Sun Mar 29 02:17:08 2009
+++ dfl2021/drawing.d   Sun Mar 29 02:00:29 2009
@@ -548,6 +548,16 @@
    {
-      if(*this == Color.empty)
-         return wc;
-      if(wc == Color.empty)
-         return *this;
+      version(DFL_DMD2021)
+      {
+         if(this == Color.empty)
+            return wc;
+         if(wc == Color.empty)
+            return this;
+      }
+      else
+      {
+         if(*this == Color.empty)
+            return wc;
+         if(wc == Color.empty)
+            return *this;
+      }
       
@@ -575,6 +585,16 @@
          return backColor;
-      if(backColor == Color.empty)
-         return *this;
-      if(0xFF == this.color.alpha)
-         return *this;
+      version(DFL_DMD2021)
+      {
+         if(backColor == Color.empty)
+            return this;
+         if(0xFF == this.color.alpha)
+            return this;
+      }
+      else
+      {
+         if(backColor == Color.empty)
+            return *this;
+         if(0xFF == this.color.alpha)
+            return *this;
+      }
       
diff -U 1 -r dfl/internal/dlib.d dfl2021/internal/dlib.d
--- dfl/internal/dlib.d   Sun Mar 29 02:17:08 2009
+++ dfl2021/internal/dlib.d   Sun Mar 29 02:01:36 2009
@@ -57,2 +57,7 @@
 }
+version(DFL_DMD2021)
+{
+   version = DFL_USE_CORE_MEMORY;
+   version = DFL_USE_CORE_ERROR_OUTOFMEMORY;
+}
 
@@ -580,7 +585,20 @@
       
-      class OomException: core.exception.OutOfMemoryException
+      version(DFL_DMD2021)
       {
-         this()
+         class OomException: core.exception.OutOfMemoryError
          {
-            super(null, 0);
+            this()
+            {
+               super(null, 0);
+            }
+         }
+      }
+      else
+      {
+         class OomException: core.exception.OutOfMemoryException
+         {
+            this()
+            {
+               super(null, 0);
+            }
          }
diff -U 1 -r dfl/messagebox.d dfl2021/messagebox.d
--- dfl/messagebox.d   Sun Mar 29 02:17:08 2009
+++ dfl2021/messagebox.d   Sun Mar 29 01:40:48 2009
@@ -62,3 +62,3 @@
 {
-   return cast(DialogResult)dfl.internal.utf.messageBox(GetActiveWindow(), txt, \0, MB_OK);
+   return cast(DialogResult)dfl.internal.utf.messageBox(GetActiveWindow(), txt, "\0", MB_OK);
 }
@@ -69,3 +69,3 @@
    return cast(DialogResult)dfl.internal.utf.messageBox(owner ? owner.handle : GetActiveWindow(),
-      txt, \0, MB_OK);
+      txt, "\0", MB_OK);
 }
diff -U 1 -r dfl/registry.d dfl2021/registry.d
--- dfl/registry.d   Sun Mar 29 02:17:08 2009
+++ dfl2021/registry.d   Sun Mar 29 01:40:55 2009
@@ -252,3 +252,3 @@
       {
-         result ~= str ~ \r\n;
+         result ~= str ~ "\r\n";
       }
diff -U 1 -r dfl/textbox.d dfl2021/textbox.d
--- dfl/textbox.d   Sun Mar 29 02:17:08 2009
+++ dfl2021/textbox.d   Sun Mar 29 01:40:30 2009
@@ -113,3 +113,3 @@
       {
-         result ~= s ~ \r\n;
+         result ~= s ~ "\r\n";
       }


After that,

Code:
set dfl_flags=-version=DFL_DMD2021
set dmd_path=c:\d\dmd\windows

cd c:\d\dmd\src\dfl
makelib.bat

copy *.lib c:\d\dmd\windows\lib


sample:

bud treeview.d -full -Ic:\d\dmd\src -version=Unicode -version=DFL_DMD2021

good luck!
Back to top
View user's profile Send private message
lurker



Joined: 18 Apr 2008
Posts: 4
Location: Internet

PostPosted: Sat Mar 28, 2009 3:44 pm    Post subject: Reply with quote

THANKS javascript:emoticon('Razz')
THANKS javascript:emoticon('Razz')
THANKS javascript:emoticon('Razz')
too bad that it is not updated
Back to top
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Fri Apr 03, 2009 12:57 pm    Post subject: Reply with quote

Thanks! I'll try to get it updated this weekend
Back to top
View user's profile Send private message
haru-s



Joined: 28 Mar 2009
Posts: 8
Location: Japan

PostPosted: Wed Apr 15, 2009 9:21 am    Post subject: Reply with quote

Chris Miller wrote:
Thanks! I'll try to get it updated this weekend


Thank you for your good job!
Back to top
View user's profile Send private message
haru-s



Joined: 28 Mar 2009
Posts: 8
Location: Japan

PostPosted: Wed Jul 08, 2009 6:04 am    Post subject: Reply with quote

I made a interim patch for dmd 2.031 + dfl rev80,

http://rayerd.plala.jp/pukiwiki/ingwiki/index.php?plugin=attach&refer=DFL&openfile=patch_dfl_rev80_dmd2031.zip

Have fun!
Back to top
View user's profile Send private message
Trass3r



Joined: 29 Feb 2008
Posts: 66
Location: Germany

PostPosted: Tue Jul 14, 2009 11:09 am    Post subject: Reply with quote

The following isn't good cause it destroys compatibility with D1, remember that Phobos1 doesn't have the to!(...) templates:

Code:
-   alias std.string.toString stringFromStringz;
-   
+   //alias std.string.toString stringFromStringz;
+   Dstring stringFromStringz(in char* sz)
+   {
+      return to!(Dstring)(sz);
+   }
    alias std.string.split stringSplit;
    
-   alias std.string.toString intToString;
+   //alias std.string.toString intToString;
+   Dstring intToString(int i)
+   {
+      return to!(Dstring)(i);
+   }
    
    alias std.string.find charFindInString;
    
@@ -659,9 +666,9 @@
    
    private import std.conv;
    
-   alias std.conv.toInt stringToInt;
+   //alias std.conv.toInt stringToInt;
+   int stringToInt(Dstring s){ return std.conv.to!int(s); }

I personally use:
Code:

version(D_Version2)
   alias std.conv.to!(Dstring, Dstringz) stringFromStringz;
else
   alias std.string.toString stringFromStringz;
...
version(D_Version2)
{
   Dstring intToString(int i)
   {
      return to!(Dstring)(i);
   }
}
else
   alias std.string.toString intToString;
...
version (D_Version2)
   alias std.conv.to!(int, Dstring) stringToInt;
else
   alias std.conv.toInt stringToInt;


Oh and while I'm on it, here's another proposal. I needed a function to select a specific index in a listview, so I created the following, don't know if there is a better/easier/neater way to do it:
Code:
///
final void selectedIndex(int idx) // setter
{
   if (created)
   {
      // only stateMask and state members are used by the system
      LVITEMA item;
      item.stateMask = LVIS_SELECTED;
      prevwproc(LVM_SETITEMSTATE, -1, cast(LPARAM) &item); // deselect all
      item.state = LVIS_SELECTED;
      prevwproc(LVM_SETITEMSTATE, idx, cast(LPARAM) &item); // select idx
      ensureVisible(idx);
   }
}


Last edited by Trass3r on Wed Jul 15, 2009 7:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
Trass3r



Joined: 29 Feb 2008
Posts: 66
Location: Germany

PostPosted: Wed Jul 15, 2009 7:06 pm    Post subject: Reply with quote

Ok, I created a new patch file.
Incorporates haru's changes and some more from me.

http://ul.to/th1jb2
Back to top
View user's profile Send private message
haru-s



Joined: 28 Mar 2009
Posts: 8
Location: Japan

PostPosted: Fri Jul 17, 2009 5:48 pm    Post subject: Reply with quote

Trass3r wrote:
Ok, I created a new patch file.
Incorporates haru's changes and some more from me.

http://ul.to/th1jb2


Thanks for your good job!

By the way, I think that cast(WORD) is truer than cast(ubyte) and cast(ushort) for changes within MAKELPARAM.
Maybe, it is my mistake.
Embarassed
Back to top
View user's profile Send private message
Trass3r



Joined: 29 Feb 2008
Posts: 66
Location: Germany

PostPosted: Wed Jul 22, 2009 4:02 pm    Post subject: Reply with quote

You're welcome, hopefully Chris folds it in Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group