Changeset 1476

Show
Ignore:
Timestamp:
04/01/10 16:55:46 (2 years ago)
Author:
walter
Message:

lots of minor edits

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/docsrc/changelog.dd

    r1457 r1476  
    44 
    55 
    6 $(VERSION 042, Mar 15, 2010, =================================================, 
    7  
    8     $(WHATSNEW 
    9     ) 
    10     $(BUGSFIXED 
    11     $(LI Add base class destruction to clear() in object.d) 
    12     $(LI $(BUGZILLA 3842): ICE(expression.c) using pointer in CTFE) 
    13     $(LI $(BUGZILLA 3885): No multithread support for Windows DLL) 
    14     $(LI $(BUGZILLA 3899): CTFE: poor error message for use of uninitialized variable) 
    15     $(LI $(BUGZILLA 3900): CTFE: Wrong return value for array.var assignment) 
    16     $(LI $(BUGZILLA 3901): PATCH: Nested struct assignment for CTFE) 
    17     $(LI $(BUGZILLA 3902): Definition of opCmp) 
    18     $(LI $(BUGZILLA 3912): pure static nested functions are not recognized as pure) 
    19     $(LI $(BUGZILLA 3914): Struct as argument that fits in register has member accessed wrong) 
    20     $(LI $(BUGZILLA 3919): ICE(expression.c, 9944): * or / with typedef ireal) 
    21     $(LI $(BUGZILLA 3920): Assertion failure: '0' on line 10018 in file 'expression.c') 
    22     $(LI $(BUGZILLA 3930): AAs horribly broken) 
     6$(VERSION 043, Mar 24, 2010, =================================================, 
     7 
     8    $(WHATSNEW 
     9    $(LI $(B .init) property for static arrays is now an array literal.) 
     10    ) 
     11    $(BUGSFIXED 
     12    $(LI $(BUGZILLA 3808): Assertion Failure : Assertion failure: 'classinfo->structsize == CLASSINFO_SIZE' on line 870 in file 'toobj.c') 
     13    $(LI $(BUGZILLA 3884): Segfault: defining a typedef with an invalid object.d) 
     14    $(LI $(BUGZILLA 3958): mixin(non-static method) crashes compiler) 
     15    $(LI $(BUGZILLA 3972): Regarding module with name different from its file name) 
     16    $(LI $(BUGZILLA 3984): Segfault(interpret.c): CTFE using struct constructor on a local static variable) 
     17    $(LI $(BUGZILLA 3986): Struct constructors bypass default initialization of member variables) 
     18    $(LI $(BUGZILLA 4002): dmd.conf and binary path in dmd -v output) 
     19    $(LI $(BUGZILLA 4004): DMD 2.042 CTFE regression with functions taking ref parameters) 
     20    $(LI $(BUGZILLA 4005): std.c.stdlib.exit in CTFE and more) 
     21    $(LI $(BUGZILLA 4011): Incorrect function overloading using mixins) 
     22    $(LI $(BUGZILLA 4019): [CTFE] Adding an item to an empty AA) 
     23    $(LI $(BUGZILLA 4020): [ICE][CTFE] struct postblit in CTFE) 
     24    $(LI $(BUGZILLA 4027): Closures in CTFE generate wrong code) 
     25    $(LI $(BUGZILLA 4029): CTFE: cannot invoke delegate returned from function) 
    2326    ) 
    2427) 
     
    2629<div id=version> 
    2730$(UL 
     31    $(NEW 043) 
    2832    $(NEW 042) 
    2933    $(NEW 041) 
     
    7882) 
    7983</div> 
     84 
     85$(VERSION 042, Mar 19, 2010, =================================================, 
     86 
     87    $(WHATSNEW 
     88    ) 
     89    $(BUGSFIXED 
     90    $(LI Add base class destruction to clear() in object.d) 
     91    $(LI $(BUGZILLA 3842): ICE(expression.c) using pointer in CTFE) 
     92    $(LI $(BUGZILLA 3885): No multithread support for Windows DLL) 
     93    $(LI $(BUGZILLA 3899): CTFE: poor error message for use of uninitialized variable) 
     94    $(LI $(BUGZILLA 3900): CTFE: Wrong return value for array.var assignment) 
     95    $(LI $(BUGZILLA 3901): PATCH: Nested struct assignment for CTFE) 
     96    $(LI $(BUGZILLA 3902): Definition of opCmp) 
     97    $(LI $(BUGZILLA 3912): pure static nested functions are not recognized as pure) 
     98    $(LI $(BUGZILLA 3914): Struct as argument that fits in register has member accessed wrong) 
     99    $(LI $(BUGZILLA 3919): ICE(expression.c, 9944): * or / with typedef ireal) 
     100    $(LI $(BUGZILLA 3920): Assertion failure: '0' on line 10018 in file 'expression.c') 
     101    $(LI $(BUGZILLA 3930): AAs horribly broken) 
     102    ) 
     103) 
    80104 
    81105$(VERSION 041, Mar 7, 2010, =================================================, 
  • trunk/docsrc/dcompiler.dd

    r1424 r1476  
    4646    ) 
    4747    $(LINUX 
    48     $(LI 32 bit x86 Linux operating system
     48    $(LI 32 bit x86 Linux operating system (will work on 64 bit Linux)
    4949 
    5050    $(LI Gnu C compiler (gcc)) 
     
    296296    ) 
    297297 
     298$(LINUX 
     299<h3>Installing dmd on 64 bit Linux</h3> 
     300 
     301    $(P Since dmd is a 32 bit compiler, the 32 bit gnu libraries must be installed:) 
     302 
     303$(CONSOLE 
     304sudo apt-get install gcc-multilib g++-multilib libc6-i386 libc6-dev-i386 
     305) 
     306 
     307    $(P The $(TT ia32-libs) package has more 32 bit libraries, and may 
     308    optionally also be installed:) 
     309 
     310$(CONSOLE 
     311sudo apt-get install ia32-libs 
     312) 
     313 
     314    $(P If you are using the .deb package for one-click install, it may 
     315    give you an error about it being only for i386. To force it to install: 
     316    ) 
     317 
     318$(CONSOLE 
     319sudo dpkg -i --force-architecture dmd_X.XXX-0_i386.deb 
     320) 
     321 
     322    $(P where X.XXX is the version number of the package. 
     323    ) 
     324 
     325) 
     326 
     327 
    298328<h2>Example</h2> 
    299329 
  • trunk/docsrc/declaration.dd

    r1423 r1476  
    283283auto y = 4u;       // y is type uint 
    284284$(V1 auto s = "string"; // s is type char[6]) 
    285 $(V2 auto s = "string"; // s is type immutable(char)[6]) 
     285$(V2 auto s = "string"; // s is type immutable(char)[]) 
    286286 
    287287class C { ... } 
  • trunk/docsrc/dll.dd

    r989 r1476  
    3535 
    3636-------------------------------- 
    37 import core.runtime; 
    3837import std.c.windows.windows; 
    39 HINSTANCE g_hInst; 
     38import core.dll_helper; 
     39 
     40__gshared HINSTANCE g_hInst; 
    4041 
    4142extern (Windows) 
    42 BOOL $(B DllMain)(HINSTANCE hInstance, ULONG ulReason, LPVOID pvReserved) 
     43BOOL DllMain(HINSTANCE hInstance, ULONG ulReason, LPVOID pvReserved) 
    4344{ 
    4445    switch (ulReason) 
    4546    { 
    4647    case DLL_PROCESS_ATTACH: 
    47         Runtime.initialize(); 
     48        g_hInst = hInstance; 
     49        dll_process_attach( hInstance, true ); 
    4850        break; 
    4951 
    5052    case DLL_PROCESS_DETACH: 
    51         Runtime.terminate(); 
     53        dll_process_detach( hInstance, true ); 
    5254        break; 
    5355 
    5456    case DLL_THREAD_ATTACH: 
     57        dll_thread_attach( true, true ); 
     58        break; 
     59 
    5560    case DLL_THREAD_DETACH: 
    56         // Multiple threads not supported yet 
    57         return false
     61        dll_thread_detach( true, true ); 
     62        break
    5863    } 
    59     g_hInst=hInstance; 
    6064    return true; 
    6165} 
     66 
    6267------------------------------- 
    6368 
    6469    $(P Notes:) 
    6570    $(UL  
     71    $(LI DllMain simply forwards to the appropriate helper functions. These setup 
     72         the runtime, create thread objects for interaction with the garbage collector 
     73         and initialize thread local storage data.) 
     74    $(LI The DLL does not share its runtime or memory with other DLLs.) 
     75    $(LI The first boolean argument to the dll-helper functions specify whether all threads 
     76         should be controlled by the garbage collector. You might need more control over 
     77         this behaviour if there are threads in the process that must not be suspended. 
     78         In this case pass false to disable the automatic handling of all threads.) 
    6679    $(LI The presence of $(TT DllMain()) is recognized by the compiler 
    6780        causing it to emit a reference to 
     
    8093EXETYPE     NT 
    8194CODE            PRELOAD DISCARDABLE 
    82 DATA            PRELOAD SINGL
     95DATA            WRIT
    8396 
    8497EXPORTS 
     
    97110    ) 
    98111 
    99     <h4>mydll2.d:</h4> 
     112    <h4>mydll.d:</h4> 
    100113------------------------------- 
    101114module mydll; 
     115import std.c.stdio; 
    102116export void dllprint() { printf("hello dll world\n"); } 
    103117------------------------------- 
     
    124138 
    125139$(CONSOLE 
    126 C:>dmd -ofmydll.dll mydll2.d dll.d mydll.def 
    127 C:>implib/system mydll.lib mydll.dll 
     140C:>dmd -ofmydll.dll -L/IMPLIB mydll.d dll.d mydll.def 
    128141C:> 
    129142) 
     
    144157------------------------------- 
    145158 
    146     $(P Create a clone of mydll2.d that doesn't have the function bodies:) 
    147  
    148     <h4>mydll.d:</h4> 
     159    $(P Create an interface file mydll.di that doesn't have the function bodies:) 
     160 
     161    <h4>mydll.di:</h4> 
    149162------------------------------- 
    150163export void dllprint(); 
     
    189202    it. Establish a protocol where the caller informs the D DLL when it is 
    190203    safe to free the data.) 
     204 
     205    $(LI Notify the GC about external references to a memory block by 
     206    calling GC.addRange.) 
    191207 
    192208    $(LI Use operating system primitives like VirtualAlloc() to allocate 
  • trunk/docsrc/dstyle.dd

    r1257 r1476  
    2323    $(LI One statement per line.) 
    2424 
    25     $(LI Hardware tabs are at 8 column increments. Avoid using 
    26     hardware tabs if they are set at a different value. 
    27     Using spaces instead of tabs is preferred.) 
     25    $(LI Use spaces instead of hardware tabs.) 
    2826 
    2927    $(LI Each indentation level will be four columns.) 
     
    7068  } 
    7169------------------------------- 
     70 
     71    It can be turned on with $(CODE version(all)): 
     72 
     73------------------------------- 
     74  version (all) 
     75  { 
     76    /* comment 
     77     * comment 
     78     */ 
     79     statement; 
     80     statement; 
     81  } 
     82------------------------------- 
     83 
    7284    ) 
    7385 
  • trunk/docsrc/index.dd

    r1457 r1476  
    1515) 
    1616 
    17 $(P The D book 
    18     <a href="http://www.amazon.com/gp/product/1590599608?ie=UTF8&tag=classicempire&linkCode=as2&camp=1789&creative=9325&creativeASIN=1590599608">Learn to Tango with D</a><img src="http://www.assoc-amazon.com/e/ir?t=classicempire&l=as2&o=1&a=1590599608" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> 
    19     by Kris Bell, Lars Ivar Igesund, Sean Kelly and Michael Parker 
    20     is now out. 
    21 
    22  
    23 $(COMMENT The second 
     17$(V1 
     18$(P The D book $(AMAZONLINK 1590599608, Learn to Tango with D) 
     19by Kris Bell, Lars Ivar Igesund, Sean Kelly and Michael Parker is now out. 
     20
     21
     22 
     23$(COMMENT 
     24The second 
    2425$(LINK2 http://d.puremagic.com/conference2008/, D Programming Language Conference) 
    25 will take place in Seattle at Amazon, Aug 4..6, 2008.) 
     26will take place in Seattle at Amazon, Aug 4..6, 2008. 
    2627 
    2728$(P The first 
    2829$(LINK2 http://d.puremagic.com/conference2007/, D Programming Language Conference) 
    2930took place in Seattle at Amazon, Aug 23..24, 2007.) 
     31) 
    3032 
    3133$(P 
  • trunk/docsrc/style.css

    r1457 r1476  
    235235{ 
    236236    font-size: larger; 
    237     text-align:center; 
     237    /*text-align:center;*/ 
    238238} 
    239239