Changeset 853
- Timestamp:
- 10/11/08 00:56:40 (16 years ago)
- Files:
-
- trunk/phobos/etc/gamma.d (modified) (1 diff)
- trunk/phobos/gcstats.d (deleted)
- trunk/phobos/internal (deleted)
- trunk/phobos/linux.mak (modified) (4 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) (3 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) (1 diff)
- trunk/phobos/std/signals.d (modified) (3 diffs)
- trunk/phobos/std/socket.d (modified) (1 diff)
- trunk/phobos/std/stdio.d (modified) (5 diffs)
- trunk/phobos/std/string.d (modified) (2 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) (1 diff)
- trunk/phobos/win32.mak (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/phobos/etc/gamma.d
r697 r853 407 407 q = ( x - 0.5L ) * log(x) - x + LOGSQRT2PI; 408 408 if (x > 1.0e10L) return q; 409 409 real p = 1.0L/(x*x); 410 410 q += poly( p, logGammaStirlingCoeffs ) / x; 411 411 return q ; 412 412 } 413 413 414 414 unittest 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); 420 420 } 421 421 422 422 assert(isnan(lgamma(real.nan))); 423 423 assert(lgamma(real.infinity) == real.infinity); 424 424 assert(lgamma(-1.0) == real.infinity); 425 425 assert(lgamma(0.0) == real.infinity); 426 426 assert(isPosZero(lgamma(1.0L))); 427 427 assert(isPosZero(lgamma(2.0L))); trunk/phobos/linux.mak
r829 r853 83 83 DFLAGS := $(DFLAGS) -O -release 84 84 OBJDIR = none 85 85 endif 86 86 87 87 ifndef OBJDIR 88 88 $(error Cannot make $(MAKECMDGOALS). Please make either all, \ 89 89 debug, release, unittest/debug, unittest/release, clean, or html) 90 90 endif 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 97 96 LIB=$(OBJDIR)/libphobos2.$(LIBEXT) 98 97 DOC_OUTPUT_DIR=../web/phobos 99 98 100 99 .SUFFIXES: .d 101 100 $(OBJDIR)/%.$(OBJEXT) : %.c 102 101 $(CC) -c $(CFLAGS) -o$@ $< 103 102 104 103 $(OBJDIR)/%.$(OBJEXT) : %.cpp … … 131 130 endif 132 131 ifeq (release,$(MAKECMDGOALS)) 133 132 ln -sf `pwd`/$(OBJDIR)/libphobos2.$(LIBEXT) ../../lib 134 133 endif 135 134 136 135 $(OBJDIR)/unittest.$(OBJEXT) : unittest.d all_std_modules_generated.d 137 136 138 137 all_std_modules_generated.d : $(MAKEFILE_LIST) 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 170 152 STD_C_MODULES_NOTBUILT = fenv math process stddef stdlib string time locale \ 171 153 wcharh 172 154 173 155 STD_C_LINUX_MODULES = linux socket 174 156 STD_C_LINUX_MODULES_NOTBUILT = linuxextern pthread termios 175 157 176 158 STD_C_WINDOWS_MODULES_NOTBUILT = windows com winsock stat 177 159 … … 200 182 win32.mak zconf.h zconf.in.h zlib.3 zlib.h zutil.c zutil.h 201 183 SRC_ZLIB := $(addprefix etc/c/zlib/,$(SRC_ZLIB)) 202 184 203 185 SRC_DOCUMENTABLES = phobos.d $(addprefix std/, $(addsuffix .d, \ 204 186 $(STD_MODULES) $(STD_MODULES_NOTBUILT))) $(addprefix std/c/, \ 205 187 $(addsuffix .d, $(STD_C_MODULES) $(STD_C_MODULES_NOTBUILT))) \ 206 188 $(addprefix std/c/linux/,$(addsuffix .d, \ 207 189 $(STD_C_LINUX_MODULES) $(STD_C_LINUX_MODULES_NOTBUILT))) 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 \ 219 195 std/c/linux/, $(addsuffix .d, $(STD_C_LINUX_MODULES) \ 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)) 239 210 240 211 SRC2LIB := $(addsuffix .d,$(SRC2LIB)) 241 212 242 213 $(LIB) : $(SRC2LIB) $(OBJS) $(MAKEFILE_LIST) 243 214 @echo $(DMD) $(DFLAGS) -lib -of$@ "[...tons of files...]" 244 215 @$(DMD) $(DFLAGS) -lib -of$@ $(SRC2LIB) $(OBJS) 245 216 246 217 ########################################################### … … 267 238 zip : $(SRC_RELEASEZIP) 268 239 $(RM) phobos.zip 269 240 zip phobos $(SRC_RELEASEZIP) 270 241 271 242 clean: 272 243 $(RM) libphobos2.$(LIBEXT) all_std_modules_generated.d 273 244 $(RM) -r $(DOC_OUTPUT_DIR) obj 274 245 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 253 $(addprefix std/c/linux/,$(addsuffix .d,$(STD_C_LINUX_MODULES_NOTBUILT))) 284 254 285 255 HEADERS := $(addprefix $(HEADERDIR)/,$(HEADERS)) 286 256 287 257 $(HEADERDIR)/%.d : %.d 288 258 $(DMD) -I$(dir $<) -o- -c -H $(DFLAGS) -Hf$@ $< trunk/phobos/std/c/stdio.d
r689 r853 188 188 int fflush(FILE *); /// 189 189 int fclose(FILE *); /// 190 190 int fputs(in char *,FILE *); /// 191 191 char * gets(char *); /// 192 192 int fputc(int,FILE *); /// 193 193 int _fputchar(int); /// 194 194 int puts(in char *); /// 195 195 int ungetc(int,FILE *); /// 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); /// 201 201 int vprintf(in char *,va_list); /// 202 202 int sprintf(char *,in char *,...); /// 203 203 int vsprintf(char *,in char *,va_list); /// 204 204 int scanf(in char *,...); /// 205 205 int fscanf(FILE *,in char *,...); /// 206 206 int sscanf(char *,in char *,...); /// 207 207 void setbuf(FILE *,char *); /// 208 208 int setvbuf(FILE *,char *,int,size_t); /// trunk/phobos/std/encoding.d
r693 r853 2066 2066 * { 2067 2067 * static this() 2068 2068 * { 2069 2069 * EncodingScheme.register("path.to.Amiga1251"); 2070 2070 * } 2071 2071 * } 2072 2072 * ---------------------------------------------- 2073 2073 */ 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); 2079 2079 foreach(encodingName;scheme.names()) 2080 2080 { 2081 2081 supported[tolower(encodingName)] = className; 2082 2082 } 2083 2083 } 2084 2084 2085 2085 /** 2086 2086 * Obtains a subclass of EncodingScheme which is capable of encoding … … 2093 2093 * --------------------------------------------------- 2094 2094 * auto scheme = EncodingScheme.create("Amiga-1251"); 2095 2095 * --------------------------------------------------- 2096 2096 */ 2097 2097 static EncodingScheme create(string encodingName) 2098 2098 { 2099 2099 auto p = std.string.tolower(encodingName) in supported; 2100 2100 if (p is null) 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; 2106 2106 } 2107 2107 2108 2108 const 2109 2109 { 2110 2110 /** 2111 2111 * Returns the standard name of the encoding scheme 2112 2112 */ 2113 2113 abstract override string toString(); trunk/phobos/std/file.d
r840 r853 30 30 * in a product, an acknowledgment in the product documentation would be 31 31 * appreciated but is not required. 32 32 * o Altered source versions must be plainly marked as such, and must not 33 33 * be misrepresented as being the original software. 34 34 * o This notice may not be removed or altered from any source 35 35 * distribution. 36 36 */ 37 37 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; 42 43 private import std.path; 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; 48 48 private import std.conv; 49 49 private import std.contracts; 50 50 private import std.utf; 51 51 version (unittest) { 52 52 private import std.stdio; // for testing only 53 53 } 54 54 55 55 /* =========================== Win32 ======================= */ … … 124 124 FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,cast(HANDLE)null); 125 125 } 126 126 127 127 if (h == INVALID_HANDLE_VALUE) 128 128 goto err1; 129 129 130 130 auto size = GetFileSize(h, null); 131 131 if (size == INVALID_FILE_SIZE) 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) 139 137 goto err2; 140 138 141 139 if (numread != size) 142 140 goto err2; 143 141 144 142 if (!CloseHandle(h)) 145 143 goto err; 146 144 … … 947 945 void[] read(string name) 948 946 { 949 947 invariant fd = std.c.linux.linux.open(toStringz(name), O_RDONLY); 950 948 cenforce(fd != -1, name); 951 949 scope(exit) std.c.linux.linux.close(fd); 952 950 953 951 struct_stat statbuf = void; 954 952 cenforce(std.c.linux.linux.fstat(fd, &statbuf) == 0, name); 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); 963 960 964 961 return buf[0 .. size]; 965 962 } 966 963 967 964 /******************************************** 968 965 * Read and validates (using $(XREF utf, validate)) a text file. $(D 969 966 * S) can be a type of array of characters of any width and constancy. 970 967 * trunk/phobos/std/md5.d
r689 r853 81 81 These notices must be retained in any copies of any part of this 82 82 documentation and/or software. 83 83 */ 84 84 85 85 module std.md5; 86 86 87 87 //debug=md5; // uncomment to turn on debugging printf's 88 88 89 89 import std.string; 90 90 import std.contracts; 91 import std.c.stdio : printf; 91 92 92 93 /*************************************** 93 94 * Computes MD5 digest of several arrays of data. 94 95 */ 95 96 96 97 void sum(ubyte[16] digest, in void[][] data...) 97 98 { 98 99 MD5_CTX context; 99 100 context.start(); 100 101 foreach (datum; data) trunk/phobos/std/outbuffer.d
r689 r853 11 11 * www.digitalmars.com 12 12 */ 13 13 14 14 15 15 // Written by Walter Bright 16 16 17 17 module std.outbuffer; 18 18 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; 25 25 import std.c.stdarg; 26 26 } 27 27 28 28 /********************************************* 29 29 * OutBuffer provides a way to build up an array of bytes out 30 30 * of raw data. It is useful for things like preparing an 31 31 * array of bytes to write out to a file. 32 32 * OutBuffer's byte order is the format native to the computer. … … 73 73 out 74 74 { 75 75 assert(offset + nbytes <= data.length); 76 76 } 77 77 body 78 78 { 79 79 //c.stdio.printf("OutBuffer.reserve: length = %d, offset = %d, nbytes = %d\n", data.length, offset, nbytes); 80 80 if (data.length < offset + nbytes) 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 } 86 86 87 87 /************************************* 88 88 * Append data to the internal buffer. 89 89 */ 90 90 91 91 void write(const(ubyte)[] bytes) 92 92 { 93 93 reserve(bytes.length); trunk/phobos/std/path.d
r849 r853 27 27 //private import std.stdio; 28 28 29 29 private import std.string; 30 30 private import std.file; 31 31 private import std.contracts; 32 32 33 33 version(linux) 34 34 { 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 40 40 version(Windows) 41 41 { 42 42 43 43 /** String used to separate directory names in a path. Under 44 44 * Windows this is a backslash, under Linux a slash. */ 45 45 invariant char[1] sep = "\\"; 46 46 /** Alternate version of sep[] used in Windows (a slash). Under 47 47 * Linux this is empty. */ … … 1250 1250 path = combineCPathWithDPath(result.pw_dir, path, last_char); 1251 1251 1252 1252 Lnotfound: 1253 1253 std.c.stdlib.free(extra_memory); 1254 1254 return path; 1255 1255 1256 1256 Lerror: 1257 1257 // Errors are going to be caused by running out of memory 1258 1258 if (extra_memory) 1259 1259 std.c.stdlib.free(extra_memory); 1260 _d_OutOfMemory();1260 onOutOfMemoryError(); 1261 1261 return null; 1262 1262 } 1263 1263 1264 1264 } trunk/phobos/std/random.d
r846 r853 459 459 auto n = rnd.next; 460 460 ... 461 461 ---- 462 462 */ 463 463 464 464 uint unpredictableSeed() 465 465 { 466 466 static bool seeded; 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 } 472 472 return cast(uint) (getUTCtime ^ rand.next); 473 473 } 474 474 475 475 unittest 476 476 { 477 477 // not much to test here 478 478 auto a = unpredictableSeed; 479 479 static assert(is(typeof(a) == uint)); trunk/phobos/std/signals.d
r464 r853 51 51 * SIGNALS=signals 52 52 * Copyright: 53 53 * Public Domain 54 54 * Author: Walter Bright, Digital Mars, www.digitalmars.com 55 55 */ 56 56 57 57 module std.signals; 58 58 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. 64 64 // Use of this is where the slot had better be a delegate 65 65 // to an object or an interface that is part of an object. 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 70 74 /************************ 71 75 * Mixin to create a signal within a class object. 72 76 * 73 77 * Different signals can be added to a class by naming the mixins. 74 78 * 75 79 * Example: 76 80 --- 77 81 import std.signals; … … 163 167 * but use malloc() and friends instead 164 168 */ 165 169 auto len = slots.length; 166 170 if (slots_idx == len) 167 171 { 168 172 if (slots.length == 0) 169 173 { 170 174 len = 4; 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 } 176 180 else 177 181 { 178 182 len = len * 2 + 4; 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; 184 188 } 185 189 } 186 190 slots[slots_idx++] = slot; 187 191 188 192 L1: 189 193 Object o = _d_toObject(slot.ptr); 190 o.notifyRegister(&unhook);194 rt_attachDisposeEvent(o, &unhook); 191 195 } 192 196 193 197 /*** 194 198 * Remove a slot from the list of slots to be called when emit() is called. 195 199 */ 196 200 void disconnect( slot_t slot) 197 201 { 198 202 debug (signal) writefln("Signal.disconnect(slot)"); 199 203 for (size_t i = 0; i < slots_idx; ) 200 204 { 201 205 if (slots[i] == slot) 202 206 { slots_idx--; 203 207 slots[i] = slots[slots_idx]; 204 208 slots[slots_idx] = null; // not strictly necessary 205 209 206 210 Object o = _d_toObject(slot.ptr); 207 o.notifyUnRegister(&unhook);211 rt_detachDisposeEvent(o, &unhook); 208 212 } 209 213 else 210 214 i++; 211 215 } 212 216 } 213 217 214 218 /* ** 215 219 * Special function called when o is destroyed. 216 220 * It causes any slots dependent on o to be removed from the list 217 221 * of slots to be called by emit(). … … 240 244 * When this object is destroyed, need to let every slot 241 245 * know that this object is destroyed so they are not left 242 246 * with dangling references to it. 243 247 */ 244 248 if (slots) 245 249 { 246 250 foreach (slot; slots[0 .. slots_idx]) 247 251 { 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 } 253 257 std.signals.free(slots.ptr); 254 258 slots = null; 255 259 } 256 260 } 257 261 258 262 private: 259 263 slot_t[] slots; // the slots to call from emit() 260 264 size_t slots_idx; // used length of slots[] trunk/phobos/std/socket.d
r851 r853 31 31 * Example: See /dmd/samples/d/listener.d. 32 32 * Authors: Christopher E. Miller 33 33 * Macros: 34 34 * WIKI=Phobos/StdSocket 35 35 */ 36 36 37 37 module std.socket; 38 38 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) 43 48 { 44 49 version = BsdSockets; 45 50 } 46 51 47 52 version(Win32) 48 53 { 49 54 50 55 pragma (lib, "ws2_32.lib"); trunk/phobos/std/stdio.d
r819 r853 17 17 Alexandrescu) 18 18 * 19 19 * Macros: 20 20 * WIKI=Phobos/StdStdio 21 21 */ 22 22 23 23 module std.stdio; 24 24 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; 33 33 import std.c.stddef; 34 34 import std.conv; 35 35 import std.traits; 36 36 import std.contracts; 37 37 import std.file; 38 38 import std.typetuple; 39 39 40 40 version (DigitalMars) … … 560 560 c = ((c - 0xD7C0) << 10) + (c2 - 0xDC00); 561 561 } 562 562 std.utf.encode(buf, c); 563 563 } 564 564 } 565 565 if (ferror(fp)) 566 566 StdioException(); 567 567 return buf.length; 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]; 573 573 if (fp._flag & _IONBF) 574 574 { 575 575 /* Use this for unbuffered I/O, when running 576 576 * across buffer boundaries, or for any but the common 577 577 * cases. 578 578 */ 579 579 L1: 580 580 char *p; 581 581 582 582 if (sz) 583 583 { 584 584 p = buf.ptr; 585 585 } 586 586 else 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 } 593 592 size_t i = 0; 594 593 for (int c; (c = FGETC(fp)) != -1; ) 595 594 { 596 595 if ((p[i] = c) != terminator) 597 596 { 598 597 i++; 599 598 if (i < sz) 600 599 continue; … … 637 636 goto L1; 638 637 } 639 638 else 640 639 { if (i != u && p[i] == terminator) 641 640 break; 642 641 goto L1; 643 642 } 644 643 } 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) 651 649 memcpy(buf.ptr, p, i - 1); 652 650 buf[i - 1] = terminator; 653 651 buf = buf[0 .. i]; 654 652 if (terminator == '\n' && c == '\r') 655 653 i++; 656 654 } 657 655 else 658 656 { … … 660 658 { 661 659 if (i == u) // if end of buffer 662 660 goto L1; // give up 663 661 auto c = p[i]; 664 662 i++; 665 663 if (c == terminator) 666 664 break; 667 665 } 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); 674 671 buf = buf[0 .. i]; 675 672 } 676 673 fp._cnt -= i; 677 674 fp._ptr += i; 678 675 return i; 679 676 } 680 677 } 681 678 else version (GCC_IO) … … 741 738 size_t n = 0; 742 739 auto s = getdelim(&lineptr, &n, terminator, fp); 743 740 scope(exit) free(lineptr); 744 741 if (s < 0) 745 742 { 746 743 if (ferror(fp)) 747 744 StdioException(); 748 745 buf.length = 0; // end of file 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 { 754 751 buf.length = s; 755 752 buf[] = lineptr[0 .. s]; 756 753 } 757 754 else 758 755 { 759 756 buf = lineptr[0 .. s].dup; 760 757 } 761 758 return s; trunk/phobos/std/string.d
r826 r853 32 32 //debug=string; // uncomment to turn on debugging printf's 33 33 34 34 private import std.algorithm; 35 35 private import std.stdio; 36 36 private import std.c.stdio; 37 37 private import std.c.stdlib; 38 38 private import std.c.string; 39 39 private import std.utf; 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; 45 44 private import std.stdarg; 46 45 private import std.contracts; 47 46 private import std.typetuple; 48 47 private import std.conv; 49 48 private import std.traits; 49 private import exception : onArrayBoundsError; 50 50 51 51 extern (C) 52 52 { 53 53 54 54 size_t wcslen(in wchar *); 55 55 int wcscmp(in wchar *, in wchar *); 56 56 } 57 57 58 58 /* ************* Exceptions *************** */ 59 59 … … 3036 3036 * Returns: s 3037 3037 */ 3038 3038 char[] sformat(char[] s, ...) 3039 3039 { size_t i; 3040 3040 3041 3041 void putc(dchar c) 3042 3042 { 3043 3043 if (c <= 0x7F) 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; 3049 3049 } 3050 3050 else 3051 3051 { char[4] buf; 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; 3057 3057 } 3058 3058 } 3059 3059 3060 3060 std.format.doFormat(&putc, _arguments, _argptr); 3061 3061 return s[0 .. i]; 3062 3062 } 3063 3063 3064 3064 trunk/phobos/std/variant.d
r816 r853 76 76 * in a product, an acknowledgment in the product documentation would be 77 77 * appreciated but is not required. 78 78 * o Altered source versions must be plainly marked as such, and must not 79 79 * be misrepresented as being the original software. 80 80 * o This notice may not be removed or altered from any source 81 81 * distribution. 82 82 */ 83 83 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 89 89 90 90 private template maxSize(T...) 91 91 { 92 92 static if (T.length == 1) 93 93 { 94 94 static const size_t maxSize = T[0].sizeof; 95 95 } 96 96 else trunk/phobos/unittest.d
r719 r853 18 18 * o Altered source versions must be plainly marked as such, and must not 19 19 * be misrepresented as being the original software. 20 20 * o This notice may not be removed or altered from any source 21 21 * distribution. 22 22 */ 23 23 24 24 // This test program pulls in all the library modules in order 25 25 // to run the unit tests on them. 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; 32 30 public import std.bitarray; 33 31 public import std.boxer; 34 32 public import std.compiler; 35 33 public import std.contracts; 36 34 public import std.conv; 37 35 public import std.cover; 38 36 public import std.cpuid; 39 37 public import std.cstream; 40 38 public import std.ctype; 41 39 public import std.date; 42 40 public import std.dateparse; 43 41 public import std.demangle; 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; 51 47 public import std.math; 52 48 public import std.md5; 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; 61 55 public import std.process; 62 56 public import std.random; 63 57 public import std.regexp; 64 58 public import std.signals; 65 59 //public import std.slist; 66 60 public import std.socket; 67 61 public import std.socketstream; 68 62 public import std.stdint; 69 63 public import std.stdio; 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; 78 70 public import std.uni; 79 71 public import std.uri; 80 72 public import std.utf; 81 73 public import std.variant; 82 74 public import std.zip; 83 75 public import std.zlib; 84 76 85 77 int main(char[][] args) trunk/phobos/win32.mak
r850 r853 63 63 64 64 .cpp.obj: 65 65 $(CC) -c $(CFLAGS) $* 66 66 67 67 .d.obj: 68 68 $(DMD) -c $(DFLAGS) $* 69 69 70 70 .asm.obj: 71 71 $(CC) -c $* 72 72 73 targets : phobos.lib gcstub.obj73 targets : phobos.lib 74 74 75 75 test : test.exe 76 76 77 77 test.obj : test.d 78 78 $(DMD) -c test -g -unittest 79 79 80 80 test.exe : test.obj phobos.lib 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 93 89 94 90 SRCS= std\math.d std\stdio.d std\dateparse.d std\date.d std\uni.d std\string.d \ 95 91 std\atomics.d std\base64.d std\md5.d std\xml.d std\bigint.d std\regexp.d \ 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 \ 119 108 std\c\windows\com.d \ 120 109 std\c\windows\stat.d \ 121 110 std\c\windows\windows.d \ 122 111 std\c\windows\winsock.d \ 123 112 std\windows\charset.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 164 118 165 119 DOCS= $(DOC)\std_path.html $(DOC)\std_math.html $(DOC)\std_outbuffer.html \ 166 120 $(DOC)\std_stream.html $(DOC)\std_string.html $(DOC)\std_base64.html \ 167 121 $(DOC)\object.html $(DOC)\std_compiler.html $(DOC)\std_format.html \ 168 122 $(DOC)\std_random.html $(DOC)\std_file.html $(DOC)\std_date.html \ 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 \ 174 127 $(DOC)\std_bitarray.html \ 175 128 $(DOC)\std_bitmanip.html \ 176 129 $(DOC)\std_boxer.html \ 177 130 $(DOC)\std_complex.html \ 178 131 $(DOC)\std_contracts.html \ 179 132 $(DOC)\std_conv.html \ 180 133 $(DOC)\std_cover.html \ 181 134 $(DOC)\std_cpuid.html \ … … 220 173 $(DOC)\std_c_process.html \ 221 174 $(DOC)\std_c_stdarg.html \ 222 175 $(DOC)\std_c_stddef.html \ 223 176 $(DOC)\std_c_stdio.html \ 224 177 $(DOC)\std_c_stdlib.html \ 225 178 $(DOC)\std_c_string.html \ 226 179 $(DOC)\std_c_time.html \ 227 180 $(DOC)\std_c_wcharh.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 \ 240 193 std\stdio.d std\perf.d std\openrj.d std\uni.d std\boxer.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 \ 246 199 std\xml.d std\encoding.d std\bigint.d 247 200 248 201 SRC_STD_C= std\c\process.d std\c\stdlib.d std\c\time.d std\c\stdio.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 \ 289 206 std\windows\iunknown.d std\windows\syserror.d std\windows\charset.d 290 207 291 208 SRC_STD_C_WIN= std\c\windows\windows.d std\c\windows\com.d \ 292 209 std\c\windows\winsock.d std\c\windows\stat.d 293 210 294 211 SRC_STD_C_LINUX= std\c\linux\linux.d std\c\linux\linuxextern.d \ 295 212 std\c\linux\socket.d std\c\linux\pthread.d std\c\linux\termios.d \ 296 213 std\c\linux\tipc.d … … 324 241 etc\c\zlib\inftrees.c \ 325 242 etc\c\zlib\zutil.h \ 326 243 etc\c\zlib\zlib.3 \ 327 244 etc\c\zlib\zlib.h \ 328 245 etc\c\zlib\adler32.c \ 329 246 etc\c\zlib\ChangeLog \ 330 247 etc\c\zlib\README \ 331 248 etc\c\zlib\win32.mak \ 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 353 257 $(DMD) $(UDFLAGS) -L/co -unittest unittest.d $(SRCS) phobos.lib 354 258 unittest 355 259 356 260 #unittest : unittest.exe 357 261 # unittest 358 262 # 359 263 #unittest.exe : unittest.d phobos.lib 360 264 # $(DMD) unittest -g 361 265 # dmc unittest.obj -g 362 266 363 267 cov : $(SRCS) phobos.lib 364 268 $(DMD) -cov -unittest -ofcov.exe unittest.d $(SRCS) phobos.lib 365 269 cov 366 270 367 271 html : $(DOCS) 368 272 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 378 277 make -f win32.mak zlib.lib 379 278 cd ..\..\.. 380 279 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 450 284 algorithm.obj : std\algorithm.d 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 461 289 462 290 base64.obj : std\base64.d 463 291 $(DMD) -c $(DFLAGS) -inline std\base64.d 464 292 465 293 bind.obj : std\bind.d 466 294 $(DMD) -c $(DFLAGS) -inline std\bind.d 467 295 468 296 bitarray.obj : std\bitarray.d … … 509 337 510 338 file.obj : std\file.d 511 339 $(DMD) -c $(DFLAGS) std\file.d 512 340 513 341 format.obj : std\format.d 514 342 $(DMD) -c $(DFLAGS) std\format.d 515 343 516 344 functional.obj : std\functional.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 530 352 531 353 loader.obj : std\loader.d 532 354 $(DMD) -c $(DFLAGS) std\loader.d 533 355 534 356 math.obj : std\math.d 535 357 $(DMD) -c $(DFLAGS) std\math.d 536 358 537 359 md5.obj : std\md5.d … … 542 364 543 365 mmfile.obj : std\mmfile.d 544 366 $(DMD) -c $(DFLAGS) std\mmfile.d 545 367 546 368 moduleinit.obj : std\moduleinit.d 547 369 $(DMD) -c $(DFLAGS) std\moduleinit.d 548 370 549 371 numeric.obj : std\numeric.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 557 376 558 377 outbuffer.obj : std\outbuffer.d 559 378 $(DMD) -c $(DFLAGS) std\outbuffer.d 560 379 561 380 outofmemory.obj : std\outofmemory.d 562 381 $(DMD) -c $(DFLAGS) std\outofmemory.d 563 382 564 383 path.obj : std\path.d … … 599 418 600 419 oldsyserror.obj : std\syserror.d 601 420 $(DMD) -c $(DFLAGS) std\syserror.d -ofoldsyserror.obj 602 421 603 422 system.obj : std\system.d 604 423 $(DMD) -c $(DFLAGS) std\system.d 605 424 606 425 thread.obj : std\thread.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 614 430 615 431 typecons.obj : std\typecons.d 616 432 $(DMD) -c $(DFLAGS) std\typecons.d -oftypecons.obj 617 433 618 434 typetuple.obj : std\typetuple.d 619 435 $(DMD) -c $(DFLAGS) std\typetuple.d -oftypetuple.obj 620 436 621 437 uni.obj : std\uni.d … … 681 497 682 498 stat.obj : std\c\windows\stat.d 683 499 $(DMD) -c $(DFLAGS) std\c\windows\stat.d 684 500 685 501 winsock.obj : std\c\windows\winsock.d 686 502 $(DMD) -c $(DFLAGS) std\c\windows\winsock.d 687 503 688 504 windows.obj : std\c\windows\windows.d 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 807 509 $(DOC)\phobos.html : std.ddoc phobos.d 808 510 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\phobos.html std.ddoc phobos.d 809 511 810 512 $(DOC)\std_algorithm.html : std.ddoc std\algorithm.d 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 818 517 819 518 $(DOC)\std_base64.html : std.ddoc std\base64.d 820 519 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_base64.html std.ddoc std\base64.d 821 520 822 521 $(DOC)\std_bigint.html : std.ddoc std\bigint.d 823 522 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_bigint.html std.ddoc std\bigint.d 824 523 825 524 $(DOC)\std_bind.html : std.ddoc std\bind.d … … 866 565 867 566 $(DOC)\std_file.html : std.ddoc std\file.d 868 567 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_file.html std.ddoc std\file.d 869 568 870 569 $(DOC)\std_format.html : std.ddoc std\format.d 871 570 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_format.html std.ddoc std\format.d 872 571 873 572 $(DOC)\std_functional.html : std.ddoc std\functional.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 887 580 888 581 $(DOC)\std_intrinsic.html : std.ddoc std\intrinsic.d 889 582 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_intrinsic.html std.ddoc std\intrinsic.d 890 583 891 584 $(DOC)\std_math.html : std.ddoc std\math.d 892 585 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_math.html std.ddoc std\math.d 893 586 894 587 $(DOC)\std_md5.html : std.ddoc std\md5.d … … 947 640 948 641 $(DOC)\std_string.html : std.ddoc std\string.d 949 642 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_string.html std.ddoc std\string.d 950 643 951 644 $(DOC)\std_system.html : std.ddoc std\system.d 952 645 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_system.html std.ddoc std\system.d 953 646 954 647 $(DOC)\std_thread.html : std.ddoc std\thread.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 962 652 963 653 $(DOC)\std_typecons.html : std.ddoc std\typecons.d 964 654 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_typecons.html std.ddoc std\typecons.d 965 655 966 656 $(DOC)\std_typetuple.html : std.ddoc std\typetuple.d 967 657 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_typetuple.html std.ddoc std\typetuple.d 968 658 969 659 $(DOC)\std_uni.html : std.ddoc std\uni.d … … 985 675 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_encoding.html std.ddoc std\encoding.d 986 676 987 677 $(DOC)\std_zip.html : std.ddoc std\zip.d 988 678 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_zip.html std.ddoc std\zip.d 989 679 990 680 $(DOC)\std_zlib.html : std.ddoc std\zlib.d 991 681 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_zlib.html std.ddoc std\zlib.d 992 682 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 1000 687 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_c_fenv.html std.ddoc std\c\fenv.d 1001 688 1002 689 $(DOC)\std_c_locale.html : std.ddoc std\c\locale.d 1003 690 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_c_locale.html std.ddoc std\c\locale.d 1004 691 1005 692 $(DOC)\std_c_math.html : std.ddoc std\c\math.d 1006 693 $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_c_math.html std.ddoc std\c\math.d 1007 694 … … 1044 731 zip32 -u phobos $(SRC_STD_C) 1045 732 zip32 -u phobos $(SRC_STD_WIN) 1046 733 zip32 -u phobos $(SRC_STD_C_WIN) 1047 734 zip32 -u phobos $(SRC_STD_C_LINUX) 1048 735 zip32 -u phobos $(SRC_ETC) 1049 736 zip32 -u phobos $(SRC_ETC_C) 1050 737 zip32 -u phobos $(SRC_ZLIB) 1051 738 zip32 -u phobos $(SRC_GC) 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 1059 743 cd ..\..\.. 1060 744 del $(OBJS) 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: 1066 750 del $(DOCS) 1067 751 1068 752 install: 1069 753 $(CP) phobos.lib gcstub.obj $(DIR)\lib 1070 754 $(CP) win32.mak linux.mak phoboslicense.txt minit.obj std.ddoc $(DIR)\src\phobos 1071 755 $(CP) $(SRC) $(DIR)\src\phobos 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 1078 760 $(CP) $(SRC_STD_C_LINUX) $(DIR)\src\phobos\std\c\linux 1079 761 $(CP) $(SRC_ETC) $(DIR)\src\phobos\etc 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
