Changeset 80

Show
Ignore:
Timestamp:
04/11/09 20:54:18 (3 years ago)
Author:
Chris Miller
Message:

Update to DMD 2.028

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/win32/dfl/application.d

    r74 r80  
    177177    void enableVisualStyles() 
    178178    { 
    179         const Dstring MANIFEST = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>` \r\n 
    180             `<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">` \r\n 
    181                 `<description>DFL manifest</description>` \r\n 
    182                 `<dependency>` \r\n 
    183                     `<dependentAssembly>` \r\n 
     179        const Dstring MANIFEST = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>` "\r\n" 
     180            `<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">` "\r\n" 
     181                `<description>DFL manifest</description>` "\r\n" 
     182                `<dependency>` "\r\n" 
     183                    `<dependentAssembly>` "\r\n" 
    184184                        `<assemblyIdentity ` 
    185185                            `type="win32" ` 
     
    189189                            `publicKeyToken="6595b64144ccf1df" ` 
    190190                            `language="*" ` 
    191                         `/>` \r\n 
    192                     `</dependentAssembly>` \r\n 
    193                 `</dependency>` \r\n 
    194             `</assembly>` \r\n
     191                        `/>` "\r\n" 
     192                    `</dependentAssembly>` "\r\n" 
     193                `</dependency>` "\r\n" 
     194            `</assembly>` "\r\n"
    195195         
    196196        HMODULE kernel32; 
  • trunk/win32/dfl/data.d

    r74 r80  
    459459        { 
    460460            // Unicode string. 
    461             //return data.getUnicodeText() ~ cast(Dwstring)\0
    462             //return cast(void[])(data.getUnicodeText() ~ cast(Dwstring)\0); // Needed in D2. Not guaranteed safe. 
    463             return (data.getUnicodeText() ~ cast(Dwstring)\0).dup; // Needed in D2. 
     461            //return data.getUnicodeText() ~ cast(Dwstring)"\0"
     462            //return cast(void[])(data.getUnicodeText() ~ cast(Dwstring)"\0"); // Needed in D2. Not guaranteed safe. 
     463            return (data.getUnicodeText() ~ cast(Dwstring)"\0").dup; // Needed in D2. 
    464464        } 
    465465        else if(data.info == typeid(Ddstring)) 
    466466        { 
    467             //return (*cast(Ddstring*)data.value) ~ \0
    468             //return cast(void[])((*cast(Ddstring*)data.value) ~ \0); // Needed in D2. Not guaranteed safe. 
    469             return ((*cast(Ddstring*)data.value) ~ \0).dup; // Needed in D2. 
     467            //return (*cast(Ddstring*)data.value) ~ "\0"
     468            //return cast(void[])((*cast(Ddstring*)data.value) ~ "\0"); // Needed in D2. Not guaranteed safe. 
     469            return ((*cast(Ddstring*)data.value) ~ "\0").dup; // Needed in D2. 
    470470        } 
    471471        else if(CF_HDROP == id) 
  • trunk/win32/dfl/drawing.d

    r77 r80  
    457457     
    458458     
     459    Color* Dthisptr(Color* t) { return t; } 
     460    Color* Dthisptr(ref Color t) { return &t; } 
     461    Color Dthisval(Color* t) { return *t; } 
     462    Color Dthisval(Color t) { return t; } 
     463     
     464     
    459465    deprecated static Color opCall(COLORREF argb) 
    460466    { 
     
    547553    Color blendColor(Color wc) 
    548554    { 
    549         if(*this == Color.empty) 
     555        if(Dthisval(this) == Color.empty) 
    550556            return wc; 
    551557        if(wc == Color.empty) 
    552             return *this
     558            return Dthisval(this)
    553559         
    554560        validateColor(); 
     
    570576        //if(0x7F == this.color.alpha) 
    571577        //  return blendColor(backColor); 
    572         //if(*this == Color.empty) // Checked if(0 == this.color.alpha) 
     578        //if(Dthisval(this) == Color.empty) // Checked if(0 == this.color.alpha) 
    573579        //  return backColor; 
    574580        if(0 == this.color.alpha) 
    575581            return backColor; 
    576582        if(backColor == Color.empty) 
    577             return *this
     583            return Dthisval(this)
    578584        if(0xFF == this.color.alpha) 
    579             return *this
     585            return Dthisval(this)
    580586         
    581587        validateColor(); 
  • trunk/win32/dfl/internal/dlib.d

    r76 r80  
    11/* 
    2     Copyright (C) 2007-2008 Christopher E. Miller 
     2    Copyright (C) 2007-2009 Christopher E. Miller 
    33     
    44    This software is provided 'as-is', without any express or implied 
     
    3434 
    3535 
    36 version(DFL_NO_D2_AND_ABOVE) 
    37 
     36version(D_Version2) 
     37
     38    version = DFL_D2; 
     39    version = DFL_D2_AND_ABOVE; 
     40
     41else version(D_Version3) 
     42
     43    version = DFL_D3; 
     44    version = DFL_D3_AND_ABOVE; 
     45    version = DFL_D2_AND_ABOVE; 
     46
     47else version(D_Version4) 
     48
     49    version = DFL_D4; 
     50    version = DFL_D4_AND_ABOVE; 
     51    version = DFL_D3_AND_ABOVE; 
     52    version = DFL_D2_AND_ABOVE; 
    3853} 
    3954else 
    4055{ 
    41     version(D_Version2) 
    42     { 
    43         version = DFL_D2_AND_ABOVE; 
    44     } 
    45     else version(D_Version3) 
    46     { 
    47         version = DFL_D3_AND_ABOVE; 
    48         version = DFL_D2_AND_ABOVE; 
    49     } 
    50 
    51  
    52  
    53 version(DFL_DMD2020) 
    54 
    55     version = DFL_USE_CORE_MEMORY; 
    56     version = DFL_USE_CORE_EXCEPTION_OUTOFMEMORY; 
    57 
    58  
    59  
    60 version(DFL_USE_CORE_MEMORY) 
    61 
    62     version = DFL_USE_CORE_EXCEPTION_OUTOFMEMORY; 
     56    version = DFL_D1; 
     57
     58//version = DFL_D1_AND_ABOVE; 
     59 
     60 
     61version(DFL_D1) 
     62
     63    version(DFL_USE_CORE_MEMORY) 
     64    { 
     65    } 
     66    else 
     67    { 
     68        version = DFL_NO_USE_CORE_MEMORY; 
     69        version = _DFL_NO_USE_CORE_EXCEPTION_OUTOFMEMORY_EXCEPTION; 
     70    } 
     71
     72 
     73 
     74version(DFL_D2_AND_ABOVE) 
     75
     76    version(DFL_beforeDMD2020) 
     77    { 
     78        version = DFL_NO_USE_CORE_MEMORY; 
     79        version = _DFL_NO_USE_CORE_EXCEPTION_OUTOFMEMORY_EXCEPTION; 
     80        version = _DFL_NO_USE_CORE_EXCEPTION_OUTOFMEMORY_ERROR; 
     81    } 
     82     
     83    version(DFL_beforeDMD2021) 
     84    { 
     85        version = _DFL_NO_USE_CORE_EXCEPTION_OUTOFMEMORY_ERROR; 
     86    } 
     87
     88 
     89 
     90version(DFL_NO_USE_CORE_MEMORY) 
     91
     92    version = _DFL_NO_USE_CORE_EXCEPTION_OUTOFMEMORY_EXCEPTION; 
    6393} 
    6494 
     
    282312     
    283313     
    284     version(DFL_USE_CORE_EXCEPTION_OUTOFMEMORY
    285     { 
    286         private import core.exception; 
    287          
    288         class OomException: core.exception.OutOfMemoryException 
     314    version(_DFL_NO_USE_CORE_EXCEPTION_OUTOFMEMORY_EXCEPTION
     315    { 
     316        private import tango.core.Exception; 
     317         
     318        class OomException: tango.core.Exception.OutOfMemoryException 
    289319        { 
    290320            this() 
     
    296326    else 
    297327    { 
    298         private import tango.core.Exception; 
    299          
    300         class OomException: tango.core.Exception.OutOfMemoryException 
     328        private import core.exception; 
     329         
     330        class OomException: core.exception.OutOfMemoryException 
    301331        { 
    302332            this() 
     
    512542     
    513543     
    514     version(DFL_USE_CORE_MEMORY) 
    515     { 
    516         private import core.memory; 
     544    version(DFL_NO_USE_CORE_MEMORY) 
     545    { 
     546        private import std.gc; // If you get "module gc cannot read file 'core\memory.d'" then use -version=DFL_NO_USE_CORE_MEMORY <http://wiki.dprogramming.com/Dfl/CompileVersions> 
    517547         
    518548        void gcPin(void* p) { } 
    519549        void gcUnpin(void* p) { } 
    520550         
    521         deprecated void gcGenCollect() 
    522         { 
    523             core.memory.GC.collect(); 
    524         } 
    525          
    526         void gcFullCollect() 
    527         { 
    528             core.memory.GC.collect(); 
    529         } 
    530     } 
    531     else 
    532     { 
    533         private import std.gc; // If you get "module gc cannot read file 'std\gc.d'" then use -version=DFL_USE_CORE_MEMORY <http://wiki.dprogramming.com/Dfl/CompileVersions> 
     551        deprecated alias std.gc.genCollect gcGenCollect; 
     552         
     553        alias std.gc.fullCollect gcFullCollect; 
     554    } 
     555    else 
     556    { 
     557        private import core.memory; // If you get "module gc cannot read file 'std\gc.d'" then use -version=DFL_USE_CORE_MEMORY <http://wiki.dprogramming.com/Dfl/CompileVersions> 
    534558         
    535559        void gcPin(void* p) { } 
    536560        void gcUnpin(void* p) { } 
    537561         
    538         deprecated alias std.gc.genCollect gcGenCollect; 
    539          
    540         alias std.gc.fullCollect gcFullCollect; 
     562        deprecated void gcGenCollect() 
     563        { 
     564            core.memory.GC.collect(); 
     565        } 
     566         
     567        void gcFullCollect() 
     568        { 
     569            core.memory.GC.collect(); 
     570        } 
    541571    } 
    542572     
     
    575605     
    576606     
    577     version(DFL_USE_CORE_EXCEPTION_OUTOFMEMORY) 
     607    version(_DFL_NO_USE_CORE_EXCEPTION_OUTOFMEMORY_EXCEPTION) 
     608    { 
     609        private import std.outofmemory; 
     610         
     611        alias std.outofmemory.OutOfMemoryException OomException; 
     612    } 
     613    else 
    578614    { 
    579615        private import core.exception; 
    580616         
    581         class OomException: core.exception.OutOfMemoryException 
    582         { 
    583             this() 
     617        version(_DFL_NO_USE_CORE_EXCEPTION_OUTOFMEMORY_ERROR) 
     618        { 
     619            class OomException: core.exception.OutOfMemoryException 
    584620            { 
    585                 super(null, 0); 
     621                this() 
     622                { 
     623                    super(null, 0); 
     624                } 
    586625            } 
    587626        } 
    588     } 
    589     else 
    590     { 
    591         private import std.outofmemory; 
    592          
    593         alias std.outofmemory.OutOfMemoryException OomException; 
     627        else 
     628        { 
     629            class OomException: core.exception.OutOfMemoryError 
     630            { 
     631                this() 
     632                { 
     633                    super(null, 0); 
     634                } 
     635            } 
     636        } 
    594637    } 
    595638     
  • trunk/win32/dfl/messagebox.d

    r54 r80  
    6161DialogResult msgBox(Dstring txt) // docmain 
    6262{ 
    63     return cast(DialogResult)dfl.internal.utf.messageBox(GetActiveWindow(), txt, \0, MB_OK); 
     63    return cast(DialogResult)dfl.internal.utf.messageBox(GetActiveWindow(), txt, "\0", MB_OK); 
    6464} 
    6565 
     
    6868{ 
    6969    return cast(DialogResult)dfl.internal.utf.messageBox(owner ? owner.handle : GetActiveWindow(), 
    70         txt, \0, MB_OK); 
     70        txt, "\0", MB_OK); 
    7171} 
    7272 
  • trunk/win32/dfl/registry.d

    r72 r80  
    251251        foreach(Dstring str; value) 
    252252        { 
    253             result ~= str ~ \r\n
     253            result ~= str ~ "\r\n"
    254254        } 
    255255        if(result.length) 
  • trunk/win32/dfl/textbox.d

    r74 r80  
    112112        foreach(Dstring s; lns) 
    113113        { 
    114             result ~= s ~ \r\n
     114            result ~= s ~ "\r\n"
    115115        } 
    116116        if(result.length) // Remove last \r\n.