Changeset 853
- Timestamp:
- 10/10/08 20:56:40 (9 months ago)
- Files:
-
- trunk/phobos/etc/gamma.d (modified) (15 diffs)
- trunk/phobos/gcstats.d (deleted)
- trunk/phobos/internal (deleted)
- trunk/phobos/linux.mak (modified) (7 diffs)
- trunk/phobos/object.d (deleted)
- trunk/phobos/std/array.d (deleted)
- trunk/phobos/std/asserterror.d (deleted)
- trunk/phobos/std/c/stdio.d (modified) (1 diff)
- trunk/phobos/std/encoding.d (modified) (2 diffs)
- trunk/phobos/std/file.d (modified) (4 diffs)
- trunk/phobos/std/gc.d (deleted)
- trunk/phobos/std/hiddenfunc.d (deleted)
- trunk/phobos/std/md5.d (modified) (1 diff)
- trunk/phobos/std/moduleinit.d (deleted)
- trunk/phobos/std/outbuffer.d (modified) (2 diffs)
- trunk/phobos/std/outofmemory.d (deleted)
- trunk/phobos/std/path.d (modified) (2 diffs)
- trunk/phobos/std/random.d (modified) (17 diffs)
- trunk/phobos/std/signals.d (modified) (7 diffs)
- trunk/phobos/std/socket.d (modified) (107 diffs)
- trunk/phobos/std/stdio.d (modified) (6 diffs)
- trunk/phobos/std/string.d (modified) (4 diffs)
- trunk/phobos/std/switcherr.d (deleted)
- trunk/phobos/std/synchro.d (deleted)
- trunk/phobos/std/thread.d (deleted)
- trunk/phobos/std/typeinfo (deleted)
- trunk/phobos/std/variant.d (modified) (1 diff)
- trunk/phobos/unittest.d (modified) (4 diffs)
- trunk/phobos/win32.mak (modified) (24 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/phobos/etc/gamma.d
r697 r853 184 184 * interval (2,3). Large arguments are handled by Stirling's 185 185 * formula. Large negative arguments are made positive using 186 * a reflection formula. 187 */ 186 * a reflection formula. 187 */ 188 188 189 189 real q, z; … … 197 197 if (x == 0) 198 198 return 1.0 / x; // +- infinity depending on sign of x, create an exception. 199 199 200 200 q = fabs(x); 201 201 202 202 if ( q > 13.0L ) 203 203 { 204 204 // Large arguments are handled by Stirling's 205 205 // formula. Large negative arguments are made positive using 206 // the reflection formula. 206 // the reflection formula. 207 207 208 208 if ( x < 0.0L ) … … 230 230 return gammaStirling(x); 231 231 } 232 232 233 233 // Arguments |x| <= 13 are reduced by recurrence and the function 234 234 // approximated by a rational function of degree 7/8 in the … … 241 241 z *= x; 242 242 } 243 243 244 244 while ( x < -0.03125L ) 245 245 { … … 247 247 x += 1.0L; 248 248 } 249 249 250 250 if ( x <= 0.03125L ) 251 251 { … … 262 262 } 263 263 } 264 264 265 265 while ( x < 2.0L ) 266 266 { … … 270 270 if ( x == 2.0L ) 271 271 return z; 272 272 273 273 x -= 2.0L; 274 274 return z * poly( x, GammaNumeratorCoeffs ) / poly( x, GammaDenominatorCoeffs ); … … 315 315 * <tr> <td> ±∞ <td> +∞ <td> no 316 316 * </table> 317 * 317 * 318 318 */ 319 319 real lgamma(real x) … … 330 330 */ 331 331 real q, w, z, f, nx; 332 332 333 333 if (isnan(x)) 334 334 return x; 335 335 if (fabs(x) == x.infinity) 336 336 return x.infinity; 337 337 338 338 if ( x < -34.0L ) 339 339 { … … 386 386 q = z / (x * poly( x, GammaSmallCoeffs)); 387 387 return log( fabs(q) ); 388 } 388 } 389 389 z /= nx + f; 390 390 nx += 1.0L; … … 398 398 return ( log(z) + p ); 399 399 } 400 400 401 401 //const real MAXLGM = 1.04848146839019521116e+4928L; 402 402 //if ( x > MAXLGM ) return sgngaml * real.infinity; … … 404 404 /* log( sqrt( 2*pi ) ) */ 405 405 const real LOGSQRT2PI = 0.91893853320467274178L; 406 406 407 407 q = ( x - 0.5L ) * log(x) - x + LOGSQRT2PI; 408 408 if (x > 1.0e10L) return q; … … 415 415 { 416 416 // return true if x is +0.0 417 b itisPosZero(real x)417 bool isPosZero(real x) 418 418 { 419 419 return (x==0) && (signbit(x)==0); … … 426 426 assert(isPosZero(lgamma(1.0L))); 427 427 assert(isPosZero(lgamma(2.0L))); 428 428 429 429 // x, correct loggamma(x), correct d/dx loggamma(x). 430 430 static real[] testpoints = 431 [ 431 [ 432 432 8.0L, 8.525146484375L + 1.48766904143001655310E-5, 2.01564147795560999654E0L, 433 433 8.99993896484375e-1L, 6.6375732421875e-2L + 5.11505711292524166220E-6L, -7.54938684259372234258E-1, … … 481 481 } 482 482 483 483 trunk/phobos/linux.mak
r829 r853 35 35 CFLAGS = 36 36 DFLAGS = 37 LDFLAGS = 37 LDFLAGS = 38 38 else 39 39 OBJDIR = obj/linux 40 40 OBJEXT = o 41 41 LIBEXT = a 42 EXEEXT = 42 EXEEXT = 43 43 CC = gcc 44 44 DMD = dmd … … 91 91 92 92 ifneq (none,$(OBJDIR)) 93 DUMMY := $(shell mkdir --parents $(OBJDIR) $(OBJDIR)/etc/c/zlib \ 94 $(OBJDIR)/internal $(OBJDIR)/internal/gc) 93 DUMMY := $(shell mkdir --parents $(OBJDIR) $(OBJDIR)/etc/c/zlib) 95 94 endif 96 95 … … 139 138 for m in $(STD_MODULES); do echo public import std.$$m\;; done > $@ 140 139 141 INTERNAL_MODULES = aApply aApplyR aaA adi alloca arraycast arraycat \ 142 cast cmath2 deh2 dmain2 invariant llmath memset monitor obj \ 143 object qsort switch trace arrayassign \ 144 arrayfloat arraydouble arrayreal \ 145 arraybyte arrayshort arrayint 146 INTERNAL_CMODULES = complex critical 147 INTERNAL_CMODULES_NOTBUILT = deh 148 INTERNAL_EXTRAFILES = internal/mars.h internal/minit.asm 149 150 INTERNAL_GC_MODULES = gc gcold gcx gcbits gclinux 151 INTERNAL_GC_EXTRAFILES = \ 152 internal/gc/gcstub.d \ 153 internal/gc/win32.d \ 154 internal/gc/testgc.d \ 155 internal/gc/win32.mak \ 156 internal/gc/linux.mak 157 158 STD_MODULES = algorithm array asserterror atomics base64 bigint bind bitarray \ 140 STD_MODULES = algorithm atomics base64 bigint bind bitarray \ 159 141 bitmanip boxer compiler complex contracts conv cover cpuid \ 160 142 cstream ctype date dateparse demangle encoding file format \ 161 functional getopt hiddenfunc intrinsic iterator loader math\162 md5 metastrings mmfile moduleinit numeric openrj outbuffer\163 outofmemory path perf process random regexp signals socket\164 socketstream stdint stdio stream string s witcherr syserror\165 sy nchro system thread traits typecons typetuple uni uri utf\143 functional getopt intrinsic iterator loader math \ 144 md5 metastrings mmfile numeric openrj outbuffer \ 145 path perf process random regexp signals socket \ 146 socketstream stdint stdio stream string syserror \ 147 system traits typecons typetuple uni uri utf \ 166 148 variant xml zip zlib 167 STD_MODULES_NOTBUILT = stdarg gc149 STD_MODULES_NOTBUILT = stdarg 168 150 169 151 STD_C_MODULES = stdarg stdio … … 192 174 ETC_C_MODULES = zlib 193 175 194 SRC = errno.c object.d unittest.d crc32.d 176 SRC = errno.c object.d unittest.d crc32.d 195 177 196 178 SRC_ZLIB = ChangeLog README adler32.c algorithm.txt compress.c crc32.c \ … … 208 190 209 191 SRC_RELEASEZIP = linux.mak win32.mak phoboslicense.txt $(SRC) \ 210 $(SRC_ZLIB) $(INTERNAL_EXTRAFILES) $(INTERNAL_GC_EXTRAFILES) \ 211 $(addprefix internal/,$(addsuffix .c, \ 212 $(INTERNAL_CMODULES_NOTBUILT))) $(addprefix internal/, \ 213 $(addsuffix .c, $(INTERNAL_CMODULES))) $(addprefix internal/, \ 214 $(addsuffix .d, $(INTERNAL_MODULES))) $(addprefix \ 215 internal/gc/, $(addsuffix .d, $(INTERNAL_GC_MODULES))) \ 216 $(addprefix std/, $(addsuffix .d, $(STD_MODULES) \ 192 $(SRC_ZLIB) $(addprefix std/, $(addsuffix .d, $(STD_MODULES) \ 217 193 $(STD_MODULES_NOTBUILT))) $(addprefix std/c/, $(addsuffix .d, \ 218 194 $(STD_C_MODULES) $(STD_C_MODULES_NOTBUILT))) $(addprefix \ … … 220 196 $(STD_C_LINUX_MODULES_NOTBUILT))) $(addprefix std/c/windows/, \ 221 197 $(addsuffix .d, $(STD_C_WINDOWS_MODULES_NOTBUILT))) \ 222 $(addprefix std/typeinfo/, $(addsuffix .d, \ 223 $(TYPEINFO_MODULES))) $(addprefix std/windows/, $(addsuffix \ 198 $(addprefix std/windows/, $(addsuffix \ 224 199 .d, $(STD_WINDOWS_MODULES_NOTBUILT))) $(addprefix etc/, \ 225 200 $(addsuffix .d, $(ETC_MODULES_NOTBUILT))) $(addprefix etc/c/, \ 226 201 $(addsuffix .d, $(ETC_C_MODULES))) 227 202 228 OBJS = errno $(addprefix internal/, $(INTERNAL_MODULES) \ 229 $(INTERNAL_CMODULES)) $(addprefix internal/gc/, \ 230 $(INTERNAL_GC_MODULES)) $(addprefix etc/c/zlib/, \ 231 $(ZLIB_CMODULES)) 203 OBJS = errno 232 204 233 205 OBJS := $(addsuffix .$(OBJEXT),$(addprefix $(OBJDIR)/,$(OBJS))) 234 206 235 SRC2LIB = crc32 gcstats $(addprefix std/, $(STD_MODULES)) $(addprefix \ 236 std/typeinfo/, $(TYPEINFO_MODULES)) $(addprefix std/c/, \ 207 SRC2LIB = crc32 $(addprefix std/, $(STD_MODULES)) $(addprefix std/c/, \ 237 208 $(STD_C_MODULES)) $(addprefix std/c/linux/, $(STD_C_LINUX_MODULES)) \ 238 209 $(addprefix etc/c/, $(ETC_C_MODULES)) … … 275 246 276 247 HEADERDIR = include 277 HEADERS = object.d \ 278 $(addprefix std/,$(addsuffix .d,$(STD_MODULES))) \ 248 HEADERS = $(addprefix std/,$(addsuffix .d,$(STD_MODULES))) \ 279 249 $(addprefix std/,$(addsuffix .d,$(STD_MODULES_NOTBUILT))) \ 280 250 $(addprefix std/c/,$(addsuffix .d,$(STD_C_MODULES))) \ 281 251 $(addprefix std/c/,$(addsuffix .d,$(STD_C_MODULES_NOTBUILT))) \ 282 252 $(addprefix std/c/linux/,$(addsuffix .d,$(STD_C_LINUX_MODULES))) \ 283 $(addprefix std/c/linux/,$(addsuffix .d,$(STD_C_LINUX_MODULES_NOTBUILT))) 253 $(addprefix std/c/linux/,$(addsuffix .d,$(STD_C_LINUX_MODULES_NOTBUILT))) 284 254 285 255 HEADERS := $(addprefix $(HEADERDIR)/,$(HEADERS)) trunk/phobos/std/c/stdio.d
r689 r853 196 196 size_t fread(void *,size_t,size_t,FILE *); /// 197 197 size_t fwrite(in void *,size_t,size_t,FILE *); /// 198 //int printf(in char *,...); ///198 int printf(in char *,...); /// 199 199 int fprintf(FILE *,in char *,...); /// 200 200 int vfprintf(FILE *,in char *,va_list); /// trunk/phobos/std/encoding.d
r693 r853 2074 2074 static void register(string className) 2075 2075 { 2076 auto scheme = cast(EncodingScheme) Object.factory(className);2076 auto scheme = cast(EncodingScheme)ClassInfo.find(className).create(); 2077 2077 if (scheme is null) 2078 2078 throw new EncodingException("Unable to create class "~className); … … 2101 2101 throw new EncodingException("Unrecognized Encoding: "~encodingName); 2102 2102 string className = *p; 2103 auto scheme = cast(EncodingScheme) Object.factory(className);2103 auto scheme = cast(EncodingScheme)ClassInfo.find(className).create(); 2104 2104 if (scheme is null) throw new EncodingException("Unable to create class "~className); 2105 2105 return scheme; trunk/phobos/std/file.d
r840 r853 38 38 module std.file; 39 39 40 private import memory; 40 41 private import std.c.stdio; 41 42 private import std.c.stdlib; … … 43 44 private import std.string; 44 45 private import std.regexp; 45 private import std.gc;46 46 private import std.c.string; 47 47 private import std.traits; … … 132 132 goto err2; 133 133 134 auto buf = std.gc.malloc(size); 135 if (buf) 136 std.gc.hasNoPointers(buf.ptr); 134 auto buf = GC.malloc(size, GC.BlkAttr.NO_SCAN)[0 .. size]; 137 135 138 136 if (ReadFile(h,buf.ptr,size,&numread,null) != 1) … … 955 953 invariant size = statbuf.st_size; 956 954 if (!size) return null; 957 auto buf = std.gc.malloc(size);955 auto buf = GC.malloc(size, GC.BlkAttr.NO_SCAN); 958 956 enforce(buf, "Out of memory"); 959 957 scope(failure) delete buf; 960 std.gc.hasNoPointers(buf.ptr);961 958 962 959 cenforce(std.c.linux.linux.read(fd, buf.ptr, size) == size, name); trunk/phobos/std/md5.d
r689 r853 89 89 import std.string; 90 90 import std.contracts; 91 import std.c.stdio : printf; 91 92 92 93 /*************************************** trunk/phobos/std/outbuffer.d
r689 r853 19 19 private 20 20 { 21 import memory; 21 22 import std.string; 22 import std.gc;23 23 import std.c.stdio; 24 24 import std.c.stdlib; … … 81 81 { 82 82 data.length = (offset + nbytes) * 2; 83 std.gc.hasPointers(data.ptr);83 GC.clrAttr(data.ptr, GC.BlkAttr.NO_SCAN); 84 84 } 85 85 } trunk/phobos/std/path.d
r849 r853 35 35 private import std.c.stdlib; 36 36 private import std.c.linux.linux; 37 private import std.outofmemory;37 private import exception : onOutOfMemoryError; 38 38 } 39 39 … … 1258 1258 if (extra_memory) 1259 1259 std.c.stdlib.free(extra_memory); 1260 _d_OutOfMemory();1260 onOutOfMemoryError(); 1261 1261 return null; 1262 1262 } trunk/phobos/std/random.d
r846 r853 20 20 Random) for whichever generator it finds the most fit for the target 21 21 environment. 22 22 23 23 Example: 24 24 … … 66 66 // Work derived from: 67 67 68 /* 68 /* 69 69 A C-program for MT19937, with initialization improved 2002/1/26. 70 70 Coded by Takuji Nishimura and Makoto Matsumoto. 71 71 72 Before using, initialize the state by using init_genrand(seed) 72 Before using, initialize the state by using init_genrand(seed) 73 73 or init_by_array(init_key, key_length). 74 74 75 75 Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, 76 All rights reserved. 76 All rights reserved. 77 77 78 78 Redistribution and use in source and binary forms, with or without … … 87 87 documentation and/or other materials provided with the distribution. 88 88 89 3. The names of its contributors may not be used to endorse or promote 90 products derived from this software without specific prior written 89 3. The names of its contributors may not be used to endorse or promote 90 products derived from this software without specific prior written 91 91 permission. 92 92 … … 146 146 modulus = m; 147 147 } 148 148 149 149 static assert(isIntegral!(UIntType)); 150 150 static assert(m == 0 || a < m); … … 181 181 UIntType next() 182 182 { 183 static if (m) 183 static if (m) 184 184 _x = cast(UIntType) ((cast(ulong) a * _x + c) % m); 185 185 else … … 203 203 return _x == rhs._x; 204 204 } 205 205 206 206 private UIntType _x = 1; 207 207 }; … … 318 318 return result; 319 319 } 320 320 321 321 /** 322 322 Constructs a MersenneTwisterEngine object … … 334 334 } 335 335 for (mti = 1; mti < n; ++mti) { 336 mt[mti] = 336 mt[mti] = 337 337 cast(UIntType) 338 (1812433253UL * (mt[mti-1] ^ (mt[mti-1] >> (w - 2))) + mti); 338 (1812433253UL * (mt[mti-1] ^ (mt[mti-1] >> (w - 2))) + mti); 339 339 /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */ 340 340 /* In the previous versions, MSBs of the seed affect */ … … 364 364 if (mti == n + 1) /* if init_genrand() has not been called, */ 365 365 seed(5489UL); /* a default initial seed is used */ 366 367 int kk = 0; 366 367 int kk = 0; 368 368 for (; kk < n - m; ++kk) 369 369 { … … 381 381 mt[n - 1] = cast(UIntType) (mt[m - 1] ^ (y >> 1) 382 382 ^ mag01[cast(UIntType) y & 0x1U]); 383 383 384 384 mti = 0; 385 385 } 386 386 387 387 y = mt[mti++]; 388 388 389 389 /* Tempering */ 390 390 y ^= (y >> temperingU); … … 392 392 y ^= (y << temperingT) & temperingC; 393 393 y ^= (y >> temperingL); 394 394 395 395 return cast(UIntType) y; 396 396 } … … 459 459 auto n = rnd.next; 460 460 ... 461 ---- 461 ---- 462 462 */ 463 463 … … 467 467 static MinstdRand0 rand; 468 468 if (!seeded) { 469 rand.seed(getpid ^ getUTCtime);469 rand.seed(getpid ^ cast(uint)getUTCtime); 470 470 seeded = true; 471 471 } … … 503 503 auto percentages = UniformDistribution!(double, "$(LPAREN)]")(0.0, 100.0); 504 504 // Get a digit in ['0', '9'] 505 auto digit = digits.next(gen); 505 auto digit = digits.next(gen); 506 506 // Get a number in $(LPAREN)0.0, 100.0] 507 507 auto p = percentages.next(gen); … … 545 545 /** 546 546 Returns the the right bound of the random value generated. 547 */ 547 */ 548 548 ResultType b() { return rightLim == ']' ? _b : nextLarger(_b); } 549 549 … … 585 585 } 586 586 } 587 588 private: 587 588 private: 589 589 NumberType _a = 0, _b = NumberType.max; 590 590 … … 739 739 Note: This is more random, but slower, than C's $(D rand()) function. 740 740 To use C's $(D rand()) instead, import $(D std.c.stdlib). 741 741 742 742 BUGS: Shares a global single state, not multithreaded. SCHEDULED FOR 743 743 DEPRECATION. trunk/phobos/std/signals.d
r464 r853 59 59 import std.stdio; 60 60 import std.c.stdlib : calloc, realloc, free; 61 import std.outofmemory : _d_OutOfMemory;61 import exception : onOutOfMemoryError; 62 62 63 63 // Special function for internal use only. … … 66 66 extern (C) Object _d_toObject(void* p); 67 67 68 // Used in place of Object.notifyRegister and Object.notifyUnRegister. 69 alias void delegate(Object) DisposeEvt; 70 extern (C) void rt_attachDisposeEvent( Object obj, DisposeEvt evt ); 71 extern (C) void rt_detachDisposeEvent( Object obj, DisposeEvt evt ); 68 72 //debug=signal; 69 73 … … 171 175 auto p = std.signals.calloc(slot_t.sizeof, len); 172 176 if (!p) 173 std.signals._d_OutOfMemory();177 onOutOfMemoryError(); 174 178 slots = (cast(slot_t*)p)[0 .. len]; 175 179 } … … 179 183 auto p = std.signals.realloc(slots.ptr, slot_t.sizeof * len); 180 184 if (!p) 181 std.signals._d_OutOfMemory();185 onOutOfMemoryError(); 182 186 slots = (cast(slot_t*)p)[0 .. len]; 183 187 slots[slots_idx + 1 .. length] = null; … … 188 192 L1: 189 193 Object o = _d_toObject(slot.ptr); 190 o.notifyRegister(&unhook);194 rt_attachDisposeEvent(o, &unhook); 191 195 } 192 196 … … 205 209 206 210 Object o = _d_toObject(slot.ptr); 207 o.notifyUnRegister(&unhook);211 rt_detachDisposeEvent(o, &unhook); 208 212 } 209 213 else … … 248 252 if (slot) 249 253 { Object o = _d_toObject(slot.ptr); 250 o.notifyUnRegister(&unhook);254 rt_detachDisposeEvent(o, &unhook); 251 255 } 252 256 } trunk/phobos/std/socket.d
r851 r853 3 3 /* 4 4 Copyright (C) 2004-2005 Christopher E. Miller 5 5 6 6 This software is provided 'as-is', without any express or implied 7 7 warranty. In no event will the authors be held liable for any damages 8 8 arising from the use of this software. 9 9 10 10 Permission is granted to anyone to use this software for any purpose, 11 11 including commercial applications, and to alter it and redistribute it 12 12 freely, subject to the following restrictions: 13 13 14 14 1. The origin of this software must not be misrepresented; you must not 15 15 claim that you wrote the original software. If you use this software … … 20 20 3. This notice may not be removed or altered from any source 21 21 distribution. 22 22 23 23 socket.d 1.3 24 24 Jan 2005 25 25 26 26 Thanks to Benjamin Herr for his assistance. 27 27 */ 28 28 29 29 /** 30 * Notes: For Win32 systems, link with ws2_32.lib. 30 * Notes: For Win32 systems, link with ws2_32.lib. 31 31 * Example: See /dmd/samples/d/listener.d. 32 * Authors: Christopher E. Miller 32 * Authors: Christopher E. Miller 33 33 * Macros: 34 34 * WIKI=Phobos/StdSocket … … 39 39 private import std.string, std.stdint, std.c.string, std.c.stdlib; 40 40 41 version(unittest) 42 { 43 private import std.c.stdio : printf; 44 } 45 41 46 42 47 version(linux) … … 53 58 private import std.c.windows.windows, std.c.windows.winsock; 54 59 private alias std.c.windows.winsock.timeval _ctimeval; 55 60 56 61 typedef SOCKET socket_t = INVALID_SOCKET; 57 62 private const int _SOCKET_ERROR = SOCKET_ERROR; 58 59 63 64 60 65 private int _lasterr() 61 66 { … … 70 75 private alias std.c.linux.linux.timeval _ctimeval; 71 76 } 72 77 73 78 typedef int32_t socket_t = -1; 74 79 private const int _SOCKET_ERROR = -1; 75 76 80 81 77 82 private int _lasterr() 78 83 { … … 90 95 { 91 96 int errorCode; /// Platform-specific error code. 92 97 93 98 this(string msg, int err = 0) 94 99 { 95 100 errorCode = err; 96 101 97 102 version(linux) 98 103 { … … 102 107 auto cs = strerror_r(errorCode, buf.ptr, buf.length); 103 108 auto len = strlen(cs); 104 109 105 110 if(cs[len - 1] == '\n') 106 111 len--; … … 110 115 } 111 116 } 112 117 113 118 super(msg); 114 119 } … … 121 126 { 122 127 WSADATA wd; 123 128 124 129 // Winsock will still load if an older version is present. 125 130 // The version is just a request. … … 192 197 string name; /// ditto 193 198 string[] aliases; /// ditto 194 195 199 200 196 201 void populate(protoent* proto) 197 202 { 198 203 type = cast(ProtocolType)proto.p_proto; 199 204 name = std.string.toString(proto.p_name).idup; 200 205 201 206 int i; 202 207 for(i = 0;; i++) … … 205 210 break; 206 211 } 207 212 208 213 if(i) 209 214 { … … 220 225 } 221 226 } 222 227 223 228 /** Returns false on failure */ 224 229 bool getProtocolByName(string name) … … 231 236 return true; 232 237 } 233 234 238 239 235 240 /** Returns false on failure */ 236 241 // Same as getprotobynumber(). … … 269 274 ushort port; /// ditto 270 275 string protocolName; /// ditto 271 272 276 277 273 278 void populate(servent* serv) 274 279 { … … 276 281 port = ntohs(cast(ushort)serv.s_port); 277 282 protocolName = std.string.toString(serv.s_proto).idup; 278 283 279 284 int i; 280 285 for(i = 0;; i++) … … 283 288 break; 284 289 } 285 290 286 291 if(i) 287 292 { … … 298 303 } 299 304 } 300 305 301 306 /** 302 307 * If a protocol name is omitted, any protocol will be matched. … … 312 317 return true; 313 318 } 314 315 319 320 316 321 // Any protocol name will be matched. 317 322 /// ditto … … 325 330 return true; 326 331 } 327 328 332 333 329 334 /// ditto 330 335 bool getServiceByPort(ushort port, string protocolName) … … 337 342 return true; 338 343 } 339 340 344 345 341 346 // Any protocol name will be matched. 342 347 /// ditto … … 378 383 { 379 384 int errorCode; /// Platform-specific error code. 380 381 385 386 382 387 this(string msg, int err = 0) 383 388 { … … 396 401 string[] aliases; /// ditto 397 402 uint32_t[] addrList; /// ditto 398 399 403 404 400 405 void validHostent(hostent* he) 401 406 { … … 403 408 throw new HostException("Address family mismatch", _lasterr()); 404 409 } 405 406 410 411 407 412 void populate(hostent* he) 408 413 { 409 414 int i; 410 415 char* p; 411 416 412 417 name = std.string.toString(he.h_name).idup; 413 418 414 419 for(i = 0;; i++) 415 420 { … … 418 423 break; 419 424 } 420 425 421 426 if(i) 422 427 { … … 432 437 aliases = null; 433 438 } 434 439 435 440 for(i = 0;; i++) 436 441 { … … 439 444 break; 440 445 } 441 446 442 447 if(i) 443 448 { … … 453 458 } 454 459 } 455 460 456 461 /** 457 462 * Resolve host name. Returns false if unable to resolve. 458 */ 463 */ 459 464 bool getHostByName(string name) 460 465 { … … 467 472 return true; 468 473 } 469 470 474 475 471 476 /** 472 477 * Resolve IPv4 address number. Returns false if unable to resolve. 473 */ 478 */ 474 479 bool getHostByAddr(uint addr) 475 480 { … … 483 488 return true; 484 489 } 485 486 490 491 487 492 /** 488 493 * Same as previous, but addr is an IPv4 address string in the 489 494 * dotted-decimal form $(I a.b.c.d). 490 495 * Returns false if unable to resolve. 491 */ 496 */ 492 497 bool getHostByAddr(string addr) 493 498 { … … 517 522 printf("aliases[%d] = %.*s\n", i, s); 518 523 } 519 524 520 525 printf("---\n"); 521 526 522 527 assert(ih.getHostByAddr(ih.addrList[0])); 523 528 printf("name = %.*s\n", ih.name); … … 559 564 protected: 560 565 sockaddr sa; 561 562 566 567 563 568 override sockaddr* name() 564 569 { 565 570 return &sa; 566 571 } 567 568 572 573 569 574 override int nameLen() 570 575 { 571 576 return sa.sizeof; 572 577 } 573 574 578 579 575 580 public: 576 581 override AddressFamily addressFamily() … … 578 583 return cast(AddressFamily)sa.sa_family; 579 584 } 580 581 585 586 582 587 override string toString() 583 588 { … … 601 606 return cast(sockaddr*)&sin; 602 607 } 603 604 608 609 605 610 override int nameLen() 606 611 { 607 612 return sin.sizeof; 608 613 } 609 610 614 615 611 616 this() 612 617 { 613 618 } 614 615 619 620 616 621 public: 617 622 const uint ADDR_ANY = INADDR_ANY; /// Any IPv4 address number. 618 623 const uint ADDR_NONE = INADDR_NONE; /// An invalid IPv4 address number. 619 624 const ushort PORT_ANY = 0; /// Any IPv4 port number. 620 625 621 626 /// Overridden to return AddressFamily.INET. 622 627 override AddressFamily addressFamily() … … 624 629 return cast(AddressFamily)AddressFamily.INET; 625 630 } 626 631 627 632 /// Returns the IPv4 port number. 628 633 ushort port() … … 630 635 return ntohs(sin.sin_port); 631 636 } 632 637 633 638 /// Returns the IPv4 address number. 634 639 uint addr() … … 636 641 return ntohl(sin.sin_addr.s_addr); 637 642 } 638 643 639 644 /** 640 645 * Params: … … 659 664 sin.sin_port = htons(port); 660 665 } 661 666 662 667 /** 663 668 * Construct a new Address. addr may be ADDR_ANY (default) and port may … … 670 675 sin.sin_port = htons(port); 671 676 } 672 673 /// ditto 677 678 /// ditto 674 679 this(ushort port) 675 680 { … … 677 682 sin.sin_port = htons(port); 678 683 } 679 680 /// Human readable string representing the IPv4 address in dotted-decimal form. 684 685 /// Human readable string representing the IPv4 address in dotted-decimal form. 681 686 string toAddrString() 682 687 { 683 688 return std.string.toString(inet_ntoa(sin.sin_addr)).idup; 684 689 } 685 690 686 691 /// Human readable string representing the IPv4 port. 687 692 string toPortString() … … 689 694 return std.string.toString(port()); 690 695 } 691 696 692 697 /// Human readable string representing the IPv4 address and port in the form $(I a.b.c.d:e). 693 698 override string toString() … … 695 700 return toAddrString() ~ ":" ~ toPortString(); 696 701 } 697 702 698 703 /** 699 704 * Parse an IPv4 address string in the dotted-decimal form $(I a.b.c.d) … … 737 742 enum SocketFlags: int 738 743 { 739 NONE = 0, /// no flags specified 740 744 NONE = 0, /// no flags specified 745 741 746 OOB = MSG_OOB, /// out-of-band stream data 742 747 PEEK = MSG_PEEK, /// peek at incoming data without removing it from the queue, only for receiving … … 752 757 int seconds; /// Number of seconds. 753 758 int microseconds; /// Number of additional microseconds. 754 759 755 760 // C interface 756 761 deprecated … … 768 773 uint maxsockets; /// max desired sockets, the fd_set might be capable of holding more 769 774 fd_set set; 770 771 775 776 772 777 version(Win32) 773 778 { … … 782 787 uint count; 783 788 } 784 785 789 790 786 791 public: 787 792 … … 792 797 reset(); 793 798 } 794 799 795 800 /// Uses the default maximum for the system. 796 801 this() … … 798 803 this(FD_SETSIZE); 799 804 } 800 801 /// Reset the SocketSet so that there are 0 Sockets in the collection. 805 806 /// Reset the SocketSet so that there are 0 Sockets in the collection. 802 807 void reset() 803 808 { 804 809 FD_ZERO(&set); 805 810 806 811 version(BsdSockets) 807 812 { … … 810 815 } 811 816 } 812 813 817 818 814 819 void add(socket_t s) 815 820 in … … 825 830 { 826 831 FD_SET(s, &set); 827 832 828 833 version(BsdSockets) 829 834 { … … 833 838 } 834 839 } 835 840 836 841 /// Add a Socket to the collection. Adding more than the maximum has dangerous side affects. 837 842 void add(Socket s) … … 839 844 add(s.sock); 840 845 } 841 846 842 847 void remove(socket_t s) 843 848 { … … 849 854 } 850 855 } 851 852 856 857 853 858 /// Remove this Socket from the collection. 854 859 void remove(Socket s) … … 856 861 remove(s.sock); 857 862 } 858 863 859 864 int isSet(socket_t s) 860 865 { 861 866 return FD_ISSET(s, &set); 862 867 } 863 864 868 869 865 870 /// Returns nonzero if this Socket is in the collection. 866 871 int isSet(Socket s) … … 868 873 return isSet(s.sock); 869 874 } 870 875 871 876 872 877 /// Return maximum amount of sockets that can be added, like FD_SETSIZE. … … 875 880 return maxsockets; 876 881 } 877 878 882 883 879 884 fd_set* toFd_set() 880 885 { 881 886 return &set; 882 887 } 883 884 888 889 885 890 int selectn() 886 891 { … … 926 931 int32_t time; 927 932 } 928 933 929 934 // C interface 930 935 deprecated … … 947 952 RCVBUF = SO_RCVBUF, /// receive buffer size 948 953 DONTROUTE = SO_DONTROUTE, /// do not route 949 954 950 955 // SocketOptionLevel.TCP: 951 956 TCP_NODELAY = .TCP_NODELAY, /// disable the Nagle algorithm for send coalescing 952 957 953 958 // SocketOptionLevel.IPV6: 954 959 IPV6_UNICAST_HOPS = .IPV6_UNICAST_HOPS, /// … … 969 974 socket_t sock; 970 975 AddressFamily _family; 971 976 972 977 version(Win32) 973 978 bool _blocking = false; /// Property to get or set whether the socket is blocking or nonblocking. 974 975 979 980 976 981 // For use with accepting(). 977 982 protected this() 978 983 { 979 984 } 980 981 985 986 982 987 public: 983 988 … … 994 999 _family = af; 995 1000 } 996 997 1001 1002 998 1003 // A single protocol exists to support this socket type within the 999 1004 // protocol family, so the ProtocolType is assumed. … … 1003 1008 this(af, type, cast(ProtocolType)0); // Pseudo protocol number. 1004 1009 } 1005 1006 1010 1011 1007 1012 /// ditto 1008 1013 this(AddressFamily af, SocketType type, string protocolName) … … 1014 1019 this(af, type, cast(ProtocolType)proto.p_proto); 1015 1020 } 1016 1017 1021 1022 1018 1023 ~this() 1019 1024 { 1020 1025 close(); 1021 1026 } 1022 1023 1027 1028 1024 1029 /// Get underlying socket handle. 1025 1030 socket_t handle() … … 1033 1038 * When a socket is blocking, calls to receive(), accept(), and send() 1034 1039 * will block and wait for data/action. 1035 * A non-blocking socket will immediately return instead of blocking. 1040 * A non-blocking socket will immediately return instead of blocking. 1036 1041 */ 1037 1042 bool blocking() … … 1046 1051 } 1047 1052 } 1048 1053 1049 1054 /// ditto 1050 1055 void blocking(bool byes) … … 1070 1075 } 1071 1076 return; // Success. 1072 1077 1073 1078 err: 1074 1079 throw new SocketException("Unable to set socket blocking", _lasterr()); 1075 1080 } 1076 1077 1078 /// Get the socket's address family. 1081 1082 1083 /// Get the socket's address family. 1079 1084 AddressFamily addressFamily() // getter 1080 1085 { 1081 1086 return _family; 1082 1087 } 1083 1088 1084 1089 /// Property that indicates if this is a valid, alive socket. 1085 1090 bool isAlive() // getter … … 1088 1093 return !getsockopt(sock, SOL_SOCKET, SO_TYPE, cast(char*)&type, &typesize); 1089 1094 } 1090 1095 1091 1096 /// Associate a local address with this socket. 1092 1097 void bind(Address addr) … … 1095 1100 throw new SocketException("Unable to bind socket", _lasterr()); 1096 1101 } 1097 1102 1098 1103 /** 1099 1104 * Establish a connection. If the socket is blocking, connect waits for … … 1107 1112 int err; 1108 1113 err = _lasterr(); 1109 1114 1110 1115 if(!blocking) 1111 1116 { … … 1128 1133 } 1129 1134 } 1130 1135 1131 1136 /** 1132 1137 * Listen for an incoming connection. bind must be called before you can … … 1139 1144 throw new SocketException("Unable to listen on socket", _lasterr()); 1140 1145 } 1141 1146 1142 1147 /** 1143 1148 * Called by accept when a new Socket must be created for a new … … 1152 1157 return new Socket; 1153 1158 } 1154 1159 1155 1160 /** 1156 1161 * Accept an incoming connection. If the socket is blocking, accept … … 1166 1171 if(socket_t.init == newsock) 1167 1172 throw new SocketAcceptException("Unable to accept socket connection", _lasterr()); 1168 1173 1169 1174 Socket newSocket; 1170 1175 try … … 1172 1177 newSocket = accepting(); 1173 1178 assert(newSocket.sock == socket_t.init); 1174 1179 1175 1180 newSocket.sock = newsock; 1176 1181 version(Win32) … … 1183 1188 throw o; 1184 1189 } 1185 1190 1186 1191 return newSocket; 1187 1192 } 1188 1193 1189 1194 /// Disables sends and/or receives. 1190 1195 void shutdown(SocketShutdown how) … … 1192 1197 .shutdown(sock, cast(int)how); 1193 1198 } 1194 1195 1199 1200 1196 1201 private static void _close(socket_t sock) 1197 1202 { … … 1205 1210 } 1206 1211 } 1207 1212 1208 1213 1209 1214 /** … … 1219 1224 sock = socket_t.init; 1220 1225 } 1221 1222 1226 1227 1223 1228 private Address newFamilyObject() 1224 1229 { … … 1229 1234 result = new InternetAddress; 1230 1235 break; 1231 1236 1232 1237 default: 1233 1238 result = new UnknownAddress; … … 1235 1240 return result; 1236 1241 } 1237 1238 1242 1243 1239 1244 /// Returns the local machine's host name. Idea from mango. 1240 1245 static string hostName() // getter … … 1245 1250 return std.string.toString(cast(char*)result).idup; 1246 1251 } 1247 1252 1248 1253 /// Remote endpoint Address. 1249 1254 Address remoteAddress() … … 1256 1261 return addr; 1257 1262 } 1258 1263 1259 1264 /// Local endpoint Address. 1260 1265 Address localAddress() … … 1267 1272 return addr; 1268 1273 } 1269 1274 1270 1275 /// Send or receive error code. 1271 1276 const int ERROR = _SOCKET_ERROR; 1272 1277 1273 1278 /** 1274 1279 * Send data on the connection. Returns the number of bytes actually … … 1283 1288 return sent; 1284 1289 } 1285 1290 1286 1291 /// ditto 1287 1292 int send(const(void)[] buf) … … 1289 1294 return send(buf, SocketFlags.NOSIGNAL); 1290 1295 } 1291 1296 1292 1297 /** 1293 1298 * Send data to a specific destination Address. If the destination address is not specified, a connection must have been made and that address is used. If the socket is blocking and there is no buffer space left, sendTo waits. … … 1299 1304 return sent; 1300 1305 } 1301 1306 1302 1307 /// ditto 1303 1308 int sendTo(const(void)[] buf, Address to) … … 1305 1310 return sendTo(buf, SocketFlags.NONE, to); 1306 1311 } 1307 1308 1312 1313 1309 1314 //assumes you connect()ed 1310 1315 /// ditto … … 1315 1320 return sent; 1316 1321 } 1317 1318 1322 1323 1319 1324 //assumes you connect()ed 1320 1325 /// ditto … … 1323 1328 return sendTo(buf, SocketFlags.NONE); 1324 1329 } 1325 1330 1326 1331 1327 1332 /** … … 1340 1345 return read; 1341 1346 } 1342 1347 1343 1348 /// ditto 1344 1349 int receive(void[] buf) … … 1346 1351 return receive(buf, SocketFlags.NONE); 1347 1352 } 1348 1353 1349 1354 /** 1350 1355 * Receive data and get the remote endpoint Address. … … 1365 1370 return read; 1366 1371 } 1367 1368 1372 1373 1369 1374 /// ditto 1370 1375 int receiveFrom(void[] buf, out Address from) … … 1372 1377 return receiveFrom(buf, SocketFlags.NONE, from); 1373 1378 } 1374 1375 1379 1380 1376 1381 //assumes you connect()ed 1377 1382 /// ditto … … 1384 1389 return read; 1385 1390 } 1386 1387 1391 1392 1388 1393 //assumes you connect()ed 1389 1394 /// ditto … … 1392 1397 return receiveFrom(buf, SocketFlags.NONE); 1393 1398 } 1394 1395 1396 /// Get a socket option. Returns the number of bytes written to result. 1399 1400 1401 /// Get a socket option. Returns the number of bytes written to result. 1397 1402 //returns the length, in bytes, of the actual result - very different from getsockopt() 1398 1403 int getOption(SocketOptionLevel level, SocketOption option, void[] result) … … 1403 1408 return len; 1404 1409 } 1405 1406 1407 /// Common case of getting integer and boolean options. 1410 1411 1412 /// Common case of getting integer and boolean options. 1408 1413 int getOption(SocketOptionLevel level, SocketOption option, out int32_t result) 1409 1414 { … … 1412 1417 1413 1418 1414 /// Get the linger option. 1419 /// Get the linger option. 1415 1420 int getOption(SocketOptionLevel level, SocketOption option, out linger result) 1416 1421 { 1417 1422 //return getOption(cast(SocketOptionLevel)SocketOptionLevel.SOCKET, SocketOption.LINGER, (&result)[0 .. 1]); 1418 return getOption(level, option, (&result)[0 .. 1]); 1419 } 1420 1423 return getOption(level, option, (&result)[0 .. 1]); 1424 } 1425 1421 1426 // Set a socket option. 1422 1427 void setOption(SocketOptionLevel level, SocketOption option, void[] value) … … 1425 1430 throw new SocketException("Unable to set socket option", _lasterr()); 1426 1431 } 1427 1428 1432 1433 1429 1434 /// Common case for setting integer and boolean options. 1430 1435 void setOption(SocketOptionLevel level, SocketOption option, int32_t value) … … 1440 1445 setOption(level, option, (&value)[0 .. 1]); 1441 1446 } 1442 1447 1443 1448 1444 1449 /** … … 1468 1473 fd_set* fr, fw, fe; 1469 1474 int n = 0; 1470 1475 1471 1476 version(Win32) 1472 1477 { … … 1487 1492 fr = null; 1488 1493 } 1489 1494 1490 1495 if(checkWrite) 1491 1496 { … … 1500 1505 fw = null; 1501 1506 } 1502 1507 1503 1508 if(checkError) 1504 1509 { … … 1514 1519 } 1515 1520 } 1516 1521 1517 1522 int result = .select(n, fr, fw, fe, cast(_ctimeval*)tv); 1518 1523 1519 1524 version(Win32) 1520 1525 { … … 1531 1536 static assert(0); 1532 1537 } 1533 1538 1534 1539 if(_SOCKET_ERROR == result) 1535 1540 throw new SocketException("Socket select error", _lasterr()); 1536 1541 1537 1542 return result; 1538 1543 } … … 1547 1552 return select(checkRead, checkWrite, checkError, &tv); 1548 1553 } 1549 1550 1554 1555 1551 1556 /// ditto 1552 1557 //maximum timeout … … 1555 1560 return select(checkRead, checkWrite, checkError, null); 1556 1561 } 1557 1558 1562 1563 1559 1564 /+ 1560 1565 bool poll(events) … … 1575 1580 super(family, SocketType.STREAM, ProtocolType.TCP); 1576 1581 } 1577 1582 1578 1583 /// Constructs a blocking TCP Socket. 1579 1584 this() … … 1581 1586 this(cast(AddressFamily)AddressFamily.INET); 1582 1587 } 1583 1584 1588 1589 1585 1590 //shortcut 1586 1591 /// Constructs a blocking TCP Socket and connects to an InternetAddress. … … 1601 1606 super(family, SocketType.DGRAM, ProtocolType.UDP); 1602 1607 } 1603 1604 1608 1609 1605 1610 /// Constructs a blocking UDP Socket. 1606 1611 this() trunk/phobos/std/stdio.d
r819 r853 25 25 public import std.c.stdio; 26 26 27 import memory; 27 28 import std.format; 28 29 import std.utf; 29 30 import std.string; 30 import std.gc;31 31 import std.c.stdlib; 32 32 import std.c.string; … … 568 568 } 569 569 570 auto sz = std.gc.capacity(buf.ptr);570 auto sz = GC.sizeOf(buf.ptr); 571 571 //auto sz = buf.length; 572 572 buf = buf.ptr[0 .. sz]; … … 587 587 { 588 588 sz = 64; 589 p = cast(char*) std.gc.malloc(sz); 590 std.gc.hasNoPointers(p); 589 p = cast(char*) GC.malloc(sz, GC.BlkAttr.NO_SCAN); 591 590 buf = p[0 .. sz]; 592 591 } … … 645 644 if (i > sz) 646 645 { 647 buf = cast(char[])std.gc.malloc(i); 648 std.gc.hasNoPointers(buf.ptr); 646 buf = cast(char[])GC.malloc(i, GC.BlkAttr.NO_SCAN)[0 .. i]; 649 647 } 650 648 if (i - 1) … … 668 666 if (i > sz) 669 667 { 670 buf = cast(char[])std.gc.malloc(i); 671 std.gc.hasNoPointers(buf.ptr); 668 buf = cast(char[])GC.malloc(i, GC.BlkAttr.NO_SCAN)[0 .. i]; 672 669 } 673 670 memcpy(buf.ptr, p, i); … … 749 746 return 0; 750 747 } 751 buf = buf.ptr[0 .. std.gc.capacity(buf.ptr)];748 buf = buf.ptr[0 .. GC.sizeOf(buf.ptr)]; 752 749 if (s <= buf.length) 753 750 { trunk/phobos/std/string.d
r826 r853 40 40 private import std.encoding; 41 41 private import std.uni; 42 private import std.array;43 42 private import std.format; 44 43 private import std.ctype; … … 48 47 private import std.conv; 49 48 private import std.traits; 49 private import exception : onArrayBoundsError; 50 50 51 51 extern (C) … … 3044 3044 { 3045 3045 if (i >= s.length) 3046 throw newArrayBoundsError("std.string.sformat", 0);3046 onArrayBoundsError("std.string.sformat", 0); 3047 3047 s[i] = cast(char)c; 3048 3048 ++i; … … 3052 3052 auto b = std.utf.toUTF8(buf, c); 3053 3053 if (i + b.length > s.length) 3054 throw newArrayBoundsError("std.string.sformat", 0);3054 onArrayBoundsError("std.string.sformat", 0); 3055 3055 s[i..i+b.length] = b[]; 3056 3056 i += b.length; trunk/phobos/std/variant.d
r816 r853 84 84 module std.variant; 85 85 86 import std.traits, std.conv, std.c.string, std.typetuple , std.gc;86 import std.traits, std.conv, std.c.string, std.typetuple; 87 87 import std.stdio; // for testing only 88 88 import std.contracts; // for testing only trunk/phobos/unittest.d
r719 r853 26 26 // Then, it prints out the arguments passed to main(). 27 27 28 public import std.array;29 public import std.asserterror;30 28 public import std.base64; 31 29 public import std.bind; … … 44 42 public import std.file; 45 43 public import std.format; 46 public import std.gc;47 44 public import std.getopt; 48 public import std.hiddenfunc;49 45 public import std.intrinsic; 50 46 public import std.loader; … … 53 49 public import std.metastrings; 54 50 public import std.mmfile; 55 public import std.moduleinit;56 51 public import std.openrj; 57 52 public import std.outbuffer; 58 public import std.outofmemory;59 53 public import std.path; 60 54 public import std.perf; … … 70 64 public import std.stream; 71 65 public import std.string; 72 public import std.switcherr;73 66 public import std.syserror; 74 67 public import std.system; 75 public import std.thread;76 68 public import std.traits; 77 69 public import std.typetuple; trunk/phobos/win32.mak
r850 r853 71 71 $(CC) -c $* 72 72 73 targets : phobos.lib gcstub.obj73 targets : phobos.lib 74 74 75 75 test : test.exe … … 81 81 $(DMD) test.obj -g -L/map 82 82 83 OBJS= deh.obj icomplex.obj \ 84 object.obj monitor.obj \ 85 critical.obj process.obj \ 86 Czlib.obj Dzlib.obj \ 83 OBJS= Czlib.obj Dzlib.obj \ 87 84 oldsyserror.obj \ 88 85 errno.obj \ 89 c_stdio.obj \ 90 complex.obj 86 c_stdio.obj 91 87 92 88 # ti_bit.obj ti_Abit.obj … … 96 92 std\compiler.d std\cpuid.d std\format.d std\demangle.d \ 97 93 std\path.d std\file.d std\outbuffer.d std\utf.d std\uri.d \ 98 std\ctype.d std\random.d std\ array.d std\mmfile.d \94 std\ctype.d std\random.d std\mmfile.d \ 99 95 std\bitarray.d std\algorithm.d std\numeric.d std\functional.d \ 100 std\metastrings.d std\ hiddenfunc.d std\contracts.d std\getopt.d \96 std\metastrings.d std\contracts.d std\getopt.d \ 101 97 std\signals.d std\typetuple.d std\traits.d std\bind.d \ 102 std\bitmanip.d std\typecons.d std\switcherr.d\103 std\ thread.d std\synchro.d std\moduleinit.d std\boxer.d \104 std\ asserterror.d std\outofmemory.d std\system.d \98 std\bitmanip.d std\typecons.d \ 99 std\boxer.d \ 100 std\system.d \ 105 101 std\iterator.d std\encoding.d std\variant.d \ 106 102 std\stream.d std\socket.d std\socketstream.d \ 107 std\perf.d std\openrj.d std\conv.d std\cover.d\103 std\perf.d std\openrj.d std\conv.d \ 108 104 std\zip.d std\cstream.d std\loader.d \ 109 crc32.d gcstats.d \ 110 internal\aaA.d internal\adi.d internal\arrayassign.d \ 111 internal\aApply.d internal\aApplyR.d internal\memset.d \ 112 internal\arraycast.d internal\arraycat.d \ 113 internal\switch.d internal\qsort.d internal\invariant.d \ 114 internal\dmain2.d internal\cast.d internal\obj.d \ 115 internal\arrayfloat.d internal\arraydouble.d internal\arrayreal.d \ 116 internal\arraybyte.d internal\arrayshort.d internal\arrayint.d \ 105 crc32.d \ 117 106 etc\gamma.d \ 118 107 std\c\stdarg.d \ … … 124 113 std\windows\iunknown.d \ 125 114 std\windows\registry.d \ 126 std\windows\syserror.d \ 127 std\typeinfo\ti_ptr.d \ 128 std\typeinfo\ti_delegate.d \ 129 std\typeinfo\ti_void.d \ 130 std\typeinfo\ti_C.d \ 131 std\typeinfo\ti_byte.d \ 132 std\typeinfo\ti_ubyte.d \ 133 std\typeinfo\ti_short.d \ 134 std\typeinfo\ti_ushort.d \ 135 std\typeinfo\ti_int.d \ 136 std\typeinfo\ti_uint.d \ 137 std\typeinfo\ti_long.d \ 138 std\typeinfo\ti_ulong.d \ 139 std\typeinfo\ti_char.d \ 140 std\typeinfo\ti_wchar.d \ 141 std\typeinfo\ti_dchar.d \ 142 std\typeinfo\ti_cdouble.d \ 143 std\typeinfo\ti_double.d \ 144 std\typeinfo\ti_idouble.d \ 145 std\typeinfo\ti_cfloat.d \ 146 std\typeinfo\ti_float.d \ 147 std\typeinfo\ti_ifloat.d \ 148 std\typeinfo\ti_creal.d \ 149 std\typeinfo\ti_real.d \ 150 std\typeinfo\ti_ireal.d \ 151 std\typeinfo\ti_AC.d \ 152 std\typeinfo\ti_Ag.d \ 153 std\typeinfo\ti_Ashort.d \ 154 std\typeinfo\ti_Aint.d \ 155 std\typeinfo\ti_Along.d \ 156 std\typeinfo\ti_Afloat.d \ 157 std\typeinfo\ti_Adouble.d \ 158 std\typeinfo\ti_Areal.d \ 159 std\typeinfo\ti_Acfloat.d \ 160 std\typeinfo\ti_Acdouble.d \ 161 std\typeinfo\ti_Acreal.d 115 std\windows\syserror.d 162 116 163 117 … … 169 123 $(DOC)\std_md5.html $(DOC)\std_zip.html $(DOC)\std_zlib.html \ 170 124 $(DOC)\std_algorithm.html \ 171 $(DOC)\std_array.html \172 125 $(DOC)\std_bigint.html \ 173 126 $(DOC)\std_bind.html \ … … 228 181 $(DOC)\phobos.html 229 182 230 SRC= errno.c object.d unittest.d crc32.d gcstats.d phobos.d183 SRC= errno.c unittest.d crc32.d phobos.d 231 184 232 185 SRC_STD= std\zlib.d std\zip.d std\stdint.d std\conv.d std\utf.d std\uri.d \ 233 std\ gc.d std\math.d std\string.d std\path.d std\date.d \186 std\math.d std\string.d std\path.d std\date.d \ 234 187 std\ctype.d std\file.d std\compiler.d std\system.d std\moduleinit.d \ 235 std\outbuffer.d std\thread.d std\ synchro.d std\md5.d std\atomics.d std\base64.d \236 std\ asserterror.d std\dateparse.d std\outofmemory.d std\mmfile.d \237 std\intrinsic.d std\ array.d std\switcherr.d std\syserror.d \188 std\outbuffer.d std\thread.d std\md5.d std\atomics.d std\base64.d \ 189 std\dateparse.d std\outofmemory.d std\mmfile.d \ 190 std\intrinsic.d std\switcherr.d std\syserror.d \ 238 191 std\regexp.d std\random.d std\stream.d std\process.d \ 239 192 std\socket.d std\socketstream.d std\loader.d std\stdarg.d std\format.d \ … … 241 194 std\cstream.d std\demangle.d std\cover.d std\bitarray.d \ 242 195 std\signals.d std\cpuid.d std\typetuple.d std\traits.d std\bind.d \ 243 std\metastrings.d std\ hiddenfunc.d std\contracts.d std\getopt.d \196 std\metastrings.d std\contracts.d std\getopt.d \ 244 197 std\variant.d std\numeric.d std\bitmanip.d std\complex.d \ 245 198 std\functional.d std\algorithm.d std\typecons.d std\iterator.d \ … … 249 202 std\c\math.d std\c\stdarg.d std\c\stddef.d std\c\fenv.d std\c\string.d \ 250 203 std\c\locale.d std\c\wcharh.d 251 252 SRC_TI= \253 std\typeinfo\ti_wchar.d std\typeinfo\ti_uint.d \254 std\typeinfo\ti_short.d std\typeinfo\ti_ushort.d \255 std\typeinfo\ti_byte.d std\typeinfo\ti_ubyte.d \256 std\typeinfo\ti_long.d std\typeinfo\ti_ulong.d \257 std\typeinfo\ti_ptr.d std\typeinfo\ti_dchar.d \258 std\typeinfo\ti_float.d std\typeinfo\ti_double.d \259 std\typeinfo\ti_real.d std\typeinfo\ti_delegate.d \260 std\typeinfo\ti_creal.d std\typeinfo\ti_ireal.d \261 std\typeinfo\ti_cfloat.d std\typeinfo\ti_ifloat.d \262 std\typeinfo\ti_cdouble.d std\typeinfo\ti_idouble.d \263 std\typeinfo\ti_Ashort.d \264 std\typeinfo\ti_Ag.d \265 std\typeinfo\ti_AC.d std\typeinfo\ti_C.d \266 std\typeinfo\ti_int.d std\typeinfo\ti_char.d \267 std\typeinfo\ti_Aint.d \268 std\typeinfo\ti_Along.d \269 std\typeinfo\ti_Afloat.d std\typeinfo\ti_Adouble.d \270 std\typeinfo\ti_Areal.d \271 std\typeinfo\ti_Acfloat.d std\typeinfo\ti_Acdouble.d \272 std\typeinfo\ti_Acreal.d \273 std\typeinfo\ti_void.d274 275 SRC_INT= \276 internal\switch.d internal\complex.c internal\critical.c \277 internal\minit.asm internal\alloca.d internal\llmath.d internal\deh.c \278 internal\arraycat.d internal\invariant.d internal\monitor.d \279 internal\memset.d internal\arraycast.d internal\aaA.d internal\adi.d \280 internal\dmain2.d internal\cast.d internal\qsort.d internal\deh2.d \281 internal\cmath2.d internal\obj.d internal\mars.h internal\aApply.d \282 internal\aApplyR.d internal\object.d internal\trace.d \283 internal\qsort2.d internal\arrayassign.d \284 internal\arrayfloat.d internal\arraydouble.d internal\arrayreal.d \285 internal\arraybyte.d internal\arrayshort.d internal\arrayint.d286 287 204 288 205 SRC_STD_WIN= std\windows\registry.d \ … … 332 249 etc\c\zlib\linux.mak 333 250 334 SRC_GC= internal\gc\gc.d \ 335 internal\gc\gcold.d \ 336 internal\gc\gcx.d \ 337 internal\gc\gcstub.d \ 338 internal\gc\gcbits.d \ 339 internal\gc\win32.d \ 340 internal\gc\gclinux.d \ 341 internal\gc\testgc.d \ 342 internal\gc\win32.mak \ 343 internal\gc\linux.mak 344 345 phobos.lib : $(OBJS) $(SRCS) minit.obj internal\gc\dmgc.lib \ 251 phobos.lib : $(OBJS) $(SRCS) minit.obj \ 346 252 etc\c\zlib\zlib.lib win32.mak 347 # lib -c -p64 phobos.lib $(OBJS) minit.obj internal\gc\dmgc.lib \348 # etc\c\zlib\zlib.lib349 253 $(DMD) -lib -ofphobos.lib $(DFLAGS) $(SRCS) $(OBJS) minit.obj \ 350 internal\gc\dmgc.libetc\c\zlib\zlib.lib254 etc\c\zlib\zlib.lib 351 255 352 256 unittest : $(SRCS) phobos.lib … … 369 273 ###################################################### 370 274 371 internal\gc\dmgc.lib:372 cd internal\gc373 make -f win32.mak dmgc.lib374 cd ..\..375 376 275 etc\c\zlib\zlib.lib: 377 276 cd etc\c\zlib … … 381 280 errno.obj : errno.c 382 281 383 ### internal384 385 aaA.obj : internal\aaA.d386 $(DMD) -c $(DFLAGS) internal\aaA.d387 388 aApply.obj : internal\aApply.d389 $(DMD) -c $(DFLAGS) internal\aApply.d390 391 aApplyR.obj : internal\aApplyR.d392 $(DMD) -c $(DFLAGS) internal\aApplyR.d393 394 adi.obj : internal\adi.d395 $(DMD) -c $(DFLAGS) internal\adi.d396 397 arrayassign.obj : internal\arrayassign.d398 $(DMD) -c $(DFLAGS) internal\arrayassign.d399 400 arraycast.obj : internal\arraycast.d401 $(DMD) -c $(DFLAGS) internal\arraycast.d402 403 arraycat.obj : internal\arraycat.d404 $(DMD) -c $(DFLAGS) internal\arraycat.d405 406 cast.obj : internal\cast.d407 $(DMD) -c $(DFLAGS) internal\cast.d408 409 icomplex.obj : internal\complex.c410 $(CC) -c $(CFLAGS) internal\complex.c -oicomplex.obj411 412 critical.obj : internal\critical.c413 $(CC) -c $(CFLAGS) internal\critical.c414 415 deh.obj : internal\mars.h internal\deh.c416 $(CC) -c $(CFLAGS) internal\deh.c417 418 dmain2.obj : internal\dmain2.d419 $(DMD) -c $(DFLAGS) internal\dmain2.d420 421 gcstub.obj : internal\gc\gcstub.d422 $(DMD) -c $(DFLAGS) -Iinternal\gc internal\gc\gcstub.d423 424 invariant.obj : internal\invariant.d425 $(DMD) -c $(DFLAGS) internal\invariant.d426 427 memset.obj : internal\memset.d428 $(DMD) -c $(DFLAGS) internal\memset.d429 430 minit.obj : internal\minit.asm431 $(CC) -c internal\minit.asm432 433 monitor.obj : internal\mars.h internal\monitor.d434 $(DMD) -c $(DFLAGS) internal\monitor.d435 436 obj.obj : internal\obj.d437 $(DMD) -c $(DFLAGS) internal\obj.d438 439 object.obj : internal\object.d440 $(DMD) -c $(DFLAGS) internal\object.d441 442 qsort.obj : internal\qsort.d443 $(DMD) -c $(DFLAGS) internal\qsort.d444 445 switch.obj : internal\switch.d446 $(DMD) -c $(DFLAGS) internal\switch.d447 448 282 ### std 449 283 … … 451 285 $(DMD) -c $(DFLAGS) std\algorithm.d 452 286 453 array.obj : std\array.d454 $(DMD) -c $(DFLAGS) std\array.d455 456 asserterror.obj : std\asserterror.d457 $(DMD) -c $(DFLAGS) std\asserterror.d458 459 287 atomics.obj : std\atomics.d 460 288 $(DMD) -c $(DFLAGS) -inline std\atomics.d … … 517 345 $(DMD) -c $(DFLAGS) std\functional.d 518 346 519 gc.obj : std\gc.d520 $(DMD) -c $(DFLAGS) std\gc.d521 522 347 getopt.obj : std\getopt.d 523 348 $(DMD) -c $(DFLAGS) std\getopt.d 524 349 525 hiddenfunc.obj : std\hiddenfunc.d526 $(DMD) -c $(DFLAGS) std\hiddenfunc.d527 528 350 iterator.obj : std\iterator.d 529 351 $(DMD) -c $(DFLAGS) std\iterator.d … … 550 372 $(DMD) -c $(DFLAGS) std\numeric.d 551 373 552 #object.obj : object.d553 # $(DMD) -c $(DFLAGS) object.d554 555 374 openrj.obj : std\openrj.d 556 375 $(DMD) -c $(DFLAGS) std\openrj.d … … 607 426 $(DMD) -c $(DFLAGS) std\thread.d 608 427 609 synchro.obj : std\synchro.d610 $(DMD) -c $(DFLAGS) std\synchro.d611 612 428 traits.obj : std\traits.d 613 429 $(DMD) -c $(DFLAGS) std\traits.d -oftraits.obj … … 689 505 $(DMD) -c $(DFLAGS) std\c\windows\windows.d 690 506 691 ### std\typeinfo692 693 ti_void.obj : std\typeinfo\ti_void.d694 $(DMD) -c $(DFLAGS) std\typeinfo\ti_void.d695 696 ti_bit.obj : std\typeinfo\ti_bit.d697 $(DMD) -c $(DFLAGS) std\typeinfo\ti_bit.d698 699 ti_wchar.obj : std\typeinfo\ti_wchar.d700 $(DMD) -c $(DFLAGS) std\typeinfo\ti_wchar.d701 702 ti_dchar.obj : std\typeinfo\ti_dchar.d703 $(DMD) -c $(DFLAGS) std\typeinfo\ti_dchar.d704 705 ti_uint.obj : std\typeinfo\ti_uint.d706 $(DMD) -c $(DFLAGS) std\typeinfo\ti_uint.d707 708 ti_short.obj : std\typeinfo\ti_short.d709 $(DMD) -c $(DFLAGS) std\typeinfo\ti_short.d710 711 ti_ushort.obj : std\typeinfo\ti_ushort.d712 $(DMD) -c $(DFLAGS) std\typeinfo\ti_ushort.d713 714 ti_byte.obj : std\typeinfo\ti_byte.d715 $(DMD) -c $(DFLAGS) std\typeinfo\ti_byte.d716 717 ti_ubyte.obj : std\typeinfo\ti_ubyte.d718 $(DMD) -c $(DFLAGS) std\typeinfo\ti_ubyte.d719 720 ti_long.obj : std\typeinfo\ti_long.d721 $(DMD) -c $(DFLAGS) std\typeinfo\ti_long.d722 723 ti_ulong.obj : std\typeinfo\ti_ulong.d724 $(DMD) -c $(DFLAGS) std\typeinfo\ti_ulong.d725 726 ti_ptr.obj : std\typeinfo\ti_ptr.d727 $(DMD) -c $(DFLAGS) std\typeinfo\ti_ptr.d728 729 ti_float.obj : std\typeinfo\ti_float.d730 $(DMD) -c $(DFLAGS) std\typeinfo\ti_float.d731 732 ti_double.obj : std\typeinfo\ti_double.d733 $(DMD) -c $(DFLAGS) std\typeinfo\ti_double.d734 735 ti_real.obj : std\typeinfo\ti_real.d736 $(DMD) -c $(DFLAGS) std\typeinfo\ti_real.d737 738 ti_delegate.obj : std\typeinfo\ti_delegate.d739 $(DMD) -c $(DFLAGS) std\typeinfo\ti_delegate.d740 741 ti_creal.obj : std\typeinfo\ti_creal.d742 $(DMD) -c $(DFLAGS) std\typeinfo\ti_creal.d743 744 ti_ireal.obj : std\typeinfo\ti_ireal.d745 $(DMD) -c $(DFLAGS) std\typeinfo\ti_ireal.d746 747 ti_cfloat.obj : std\typeinfo\ti_cfloat.d748 $(DMD) -c $(DFLAGS) std\typeinfo\ti_cfloat.d749 750 ti_ifloat.obj : std\typeinfo\ti_ifloat.d751 $(DMD) -c $(DFLAGS) std\typeinfo\ti_ifloat.d752 753 ti_cdouble.obj : std\typeinfo\ti_cdouble.d754 $(DMD) -c $(DFLAGS) std\typeinfo\ti_cdouble.d755 756 ti_idouble.obj : std\typeinfo\ti_idouble.d757 $(DMD) -c $(DFLAGS) std\typeinfo\ti_idouble.d758 759 ti_AC.obj : std\typeinfo\ti_AC.d760 $(DMD) -c $(DFLAGS) std\typeinfo\ti_AC.d761 762 ti_Ag.obj : std\typeinfo\ti_Ag.d763 $(DMD) -c $(DFLAGS) std\typeinfo\ti_Ag.d764 765 ti_Abit.obj : std\typeinfo\ti_Abit.d766 $(DMD) -c $(DFLAGS) std\typeinfo\ti_Abit.d767 768 ti_Ashort.obj : std\typeinfo\ti_Ashort.d769 $(DMD) -c $(DFLAGS) std\typeinfo\ti_Ashort.d770 771 ti_Aint.obj : std\typeinfo\ti_Aint.d772 $(DMD) -c $(DFLAGS) std\typeinfo\ti_Aint.d773 774 ti_Along.obj : std\typeinfo\ti_Along.d775 $(DMD) -c $(DFLAGS) std\typeinfo\ti_Along.d776 777 ti_Afloat.obj : std\typeinfo\ti_Afloat.d778 $(DMD) -c $(DFLAGS) std\typeinfo\ti_Afloat.d779 780 ti_Adouble.obj : std\typeinfo\ti_Adouble.d781 $(DMD) -c $(DFLAGS) std\typeinfo\ti_Adouble.d782 783 ti_Areal.obj : std\typeinfo\ti_Areal.d784 $(DMD) -c $(DFLAGS) std\typeinfo\ti_Areal.d785 786 ti_Acfloat.obj : std\typeinfo\ti_Acfloat.d787 $(DMD) -c $(DFLAGS) std\typeinfo\ti_Acfloat.d788 789 ti_Acdouble.obj : std\typeinfo\ti_Acdouble.d790 $(DMD) -c $(DFLAGS) std\typeinfo\ti_Acdouble.d791 792 ti_Acreal.obj : std\typeinfo\ti_Acreal.d793 $(DMD) -c $(DFLAGS) std\typeinfo\ti_Acreal.d794 795 ti_C.obj : std\typeinfo\ti_C.d796 $(DMD) -c $(DFLAGS) std\typeinfo\ti_C.d797 798 ti_char.obj : std\typeinfo\ti_char.d799 $(DMD) -c $(DFLAGS) std\typeinfo\ti_char.d800 801 ti_int.obj : std\typeinfo\ti_int.d802 $(DMD) -c $(DFLAGS) std\typeinfo\ti_int.d803 804 805 507 ################## DOCS #################################### 806 508 … … 811 513 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_algorithm.html std.ddoc std\algorithm.d 812 514 813 $(DOC)\std_array.html : std.ddoc std\array.d814 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_array.html std.ddoc std\array.d815 816 515 $(DOC)\std_atomics.html : std.ddoc std\atomics.d 817 516 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_atomics.html std.ddoc std\atomics.d … … 874 573 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_functional.html std.ddoc std\functional.d 875 574 876 $(DOC)\std_gc.html : std.ddoc std\gc.d877 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_gc.html std.ddoc std\gc.d878 879 575 $(DOC)\std_getopt.html : std.ddoc std\getopt.d 880 576 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_getopt.html std.ddoc std\getopt.d 881 577 882 $(DOC)\std_hiddenfunc.html : std.ddoc std\hiddenfunc.d883 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_hiddenfunc.html std.ddoc std\hiddenfunc.d884 885 578 $(DOC)\std_iterator.html : std.ddoc std\iterator.d 886 579 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_iterator.html std.ddoc std\iterator.d … … 955 648 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_thread.html std.ddoc std\thread.d 956 649 957 $(DOC)\std_synchro.html : std.ddoc std\synchro.d958 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_synchro.html std.ddoc std\synchro.d959 960 650 $(DOC)\std_traits.html : std.ddoc std\traits.d 961 651 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_traits.html std.ddoc std\traits.d … … 993 683 $(DOC)\std_windows_charset.html : std.ddoc std\windows\charset.d 994 684 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_windows_charset.html std.ddoc std\windows\charset.d 995 996 $(DOC)\object.html : std.ddoc internal\object.d997 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\object.html std.ddoc internal\object.d998 685 999 686 $(DOC)\std_c_fenv.html : std.ddoc std\c\fenv.d … … 1052 739 1053 740 clean: 1054 cd internal\gc1055 make -f win32.mak clean1056 cd ..\..1057 741 cd etc\c\zlib 1058 742 make -f win32.mak clean … … 1061 745 del $(DOCS) 1062 746 del unittest.obj unittest.map unittest.exe 1063 del phobos.lib gcstub.obj747 del phobos.lib 1064 748 1065 749 cleanhtml: … … 1072 756 $(CP) $(SRC_STD) $(DIR)\src\phobos\std 1073 757 $(CP) $(SRC_STD_C) $(DIR)\src\phobos\std\c 1074 $(CP) $(SRC_TI) $(DIR)\src\phobos\std\typeinfo1075 $(CP) $(SRC_INT) $(DIR)\src\phobos\internal1076 758 $(CP) $(SRC_STD_WIN) $(DIR)\src\phobos\std\windows 1077 759 $(CP) $(SRC_STD_C_WIN) $(DIR)\src\phobos\std\c\windows … … 1080 762 $(CP) $(SRC_ETC_C) $(DIR)\src\phobos\etc\c 1081 763 $(CP) $(SRC_ZLIB) $(DIR)\src\phobos\etc\c\zlib 1082 $(CP) $(SRC_GC) $(DIR)\src\phobos\internal\gc1083
