Changeset 1476
- Timestamp:
- 04/01/10 16:55:46 (2 years ago)
- Files:
-
- trunk/docsrc/changelog.dd (modified) (3 diffs)
- trunk/docsrc/dcompiler.dd (modified) (2 diffs)
- trunk/docsrc/declaration.dd (modified) (1 diff)
- trunk/docsrc/dll.dd (modified) (6 diffs)
- trunk/docsrc/dstyle.dd (modified) (2 diffs)
- trunk/docsrc/index.dd (modified) (1 diff)
- trunk/docsrc/style.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/docsrc/changelog.dd
r1457 r1476 4 4 5 5 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) 23 26 ) 24 27 ) … … 26 29 <div id=version> 27 30 $(UL 31 $(NEW 043) 28 32 $(NEW 042) 29 33 $(NEW 041) … … 78 82 ) 79 83 </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 ) 80 104 81 105 $(VERSION 041, Mar 7, 2010, =================================================, trunk/docsrc/dcompiler.dd
r1424 r1476 46 46 ) 47 47 $(LINUX 48 $(LI 32 bit x86 Linux operating system )48 $(LI 32 bit x86 Linux operating system (will work on 64 bit Linux)) 49 49 50 50 $(LI Gnu C compiler (gcc)) … … 296 296 ) 297 297 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 304 sudo 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 311 sudo 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 319 sudo 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 298 328 <h2>Example</h2> 299 329 trunk/docsrc/declaration.dd
r1423 r1476 283 283 auto y = 4u; // y is type uint 284 284 $(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)[]) 286 286 287 287 class C { ... } trunk/docsrc/dll.dd
r989 r1476 35 35 36 36 -------------------------------- 37 import core.runtime;38 37 import std.c.windows.windows; 39 HINSTANCE g_hInst; 38 import core.dll_helper; 39 40 __gshared HINSTANCE g_hInst; 40 41 41 42 extern (Windows) 42 BOOL $(B DllMain)(HINSTANCE hInstance, ULONG ulReason, LPVOID pvReserved)43 BOOL DllMain(HINSTANCE hInstance, ULONG ulReason, LPVOID pvReserved) 43 44 { 44 45 switch (ulReason) 45 46 { 46 47 case DLL_PROCESS_ATTACH: 47 Runtime.initialize(); 48 g_hInst = hInstance; 49 dll_process_attach( hInstance, true ); 48 50 break; 49 51 50 52 case DLL_PROCESS_DETACH: 51 Runtime.terminate();53 dll_process_detach( hInstance, true ); 52 54 break; 53 55 54 56 case DLL_THREAD_ATTACH: 57 dll_thread_attach( true, true ); 58 break; 59 55 60 case DLL_THREAD_DETACH: 56 // Multiple threads not supported yet57 return false;61 dll_thread_detach( true, true ); 62 break; 58 63 } 59 g_hInst=hInstance;60 64 return true; 61 65 } 66 62 67 ------------------------------- 63 68 64 69 $(P Notes:) 65 70 $(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.) 66 79 $(LI The presence of $(TT DllMain()) is recognized by the compiler 67 80 causing it to emit a reference to … … 80 93 EXETYPE NT 81 94 CODE PRELOAD DISCARDABLE 82 DATA PRELOAD SINGLE95 DATA WRITE 83 96 84 97 EXPORTS … … 97 110 ) 98 111 99 <h4>mydll 2.d:</h4>112 <h4>mydll.d:</h4> 100 113 ------------------------------- 101 114 module mydll; 115 import std.c.stdio; 102 116 export void dllprint() { printf("hello dll world\n"); } 103 117 ------------------------------- … … 124 138 125 139 $(CONSOLE 126 C:>dmd -ofmydll.dll mydll2.d dll.d mydll.def 127 C:>implib/system mydll.lib mydll.dll 140 C:>dmd -ofmydll.dll -L/IMPLIB mydll.d dll.d mydll.def 128 141 C:> 129 142 ) … … 144 157 ------------------------------- 145 158 146 $(P Create a clone of mydll2.dthat 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> 149 162 ------------------------------- 150 163 export void dllprint(); … … 189 202 it. Establish a protocol where the caller informs the D DLL when it is 190 203 safe to free the data.) 204 205 $(LI Notify the GC about external references to a memory block by 206 calling GC.addRange.) 191 207 192 208 $(LI Use operating system primitives like VirtualAlloc() to allocate trunk/docsrc/dstyle.dd
r1257 r1476 23 23 $(LI One statement per line.) 24 24 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.) 28 26 29 27 $(LI Each indentation level will be four columns.) … … 70 68 } 71 69 ------------------------------- 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 72 84 ) 73 85 trunk/docsrc/index.dd
r1457 r1476 15 15 ) 16 16 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) 19 by Kris Bell, Lars Ivar Igesund, Sean Kelly and Michael Parker is now out. 20 ) 21 ) 22 23 $(COMMENT 24 The second 24 25 $(LINK2 http://d.puremagic.com/conference2008/, D Programming Language Conference) 25 will take place in Seattle at Amazon, Aug 4..6, 2008. )26 will take place in Seattle at Amazon, Aug 4..6, 2008. 26 27 27 28 $(P The first 28 29 $(LINK2 http://d.puremagic.com/conference2007/, D Programming Language Conference) 29 30 took place in Seattle at Amazon, Aug 23..24, 2007.) 31 ) 30 32 31 33 $(P trunk/docsrc/style.css
r1457 r1476 235 235 { 236 236 font-size: larger; 237 text-align:center;237 /*text-align:center;*/ 238 238 } 239 239
