-/**
- * This module contains a collection of bit-level operations.
- *
- * Copyright: Copyright (c) 2005-2008, The D Runtime Project
- * License: BSD Style, see LICENSE
- * Authors: Walter Bright, Don Clugston, Sean Kelly
- */
-module bitmanip;
-
-
-version( DDoc )
-{
- /**
- * Scans the bits in v starting with bit 0, looking
- * for the first set bit.
- * Returns:
- * The bit number of the first bit set.
- * The return value is undefined if v is zero.
- */
- int bsf( uint v );
-
-
- /**
- * Scans the bits in v from the most significant bit
- * to the least significant bit, looking
- * for the first set bit.
- * Returns:
- * The bit number of the first bit set.
- * The return value is undefined if v is zero.
- * Example:
- * ---
- * import bitmanip;
- *
- * int main()
- * {
- * uint v;
- * int x;
- *
- * v = 0x21;
- * x = bsf(v);
- * printf("bsf(x%x) = %d\n", v, x);
- * x = bsr(v);
- * printf("bsr(x%x) = %d\n", v, x);
- * return 0;
- * }
- * ---
- * Output:
- * bsf(x21) = 0<br>
- * bsr(x21) = 5
- */
- int bsr( uint v );
-
-
- /**
- * Tests the bit.
- */
- int bt( uint* p, uint bitnum );
-
-
- /**
- * Tests and complements the bit.
- */
- int btc( uint* p, uint bitnum );
-
-
- /**
- * Tests and resets (sets to 0) the bit.
- */
- int btr( uint* p, uint bitnum );
-
-
- /**
- * Tests and sets the bit.
- * Params:
- * p = a non-NULL pointer to an array of uints.
- * index = a bit number, starting with bit 0 of p[0],
- * and progressing. It addresses bits like the expression:
- ---
- p[index / (uint.sizeof*8)] & (1 << (index & ((uint.sizeof*8) - 1)))
- ---
- * Returns:
- * A non-zero value if the bit was set, and a zero
- * if it was clear.
- *
- * Example:
- * ---
- import bitmanip;
-
- int main()
- {
- uint array[2];
-
- array[0] = 2;
- array[1] = 0x100;
-
- printf("btc(array, 35) = %d\n", <b>btc</b>(array, 35));
- printf("array = [0]:x%x, [1]:x%x\n", array[0], array[1]);
-
- printf("btc(array, 35) = %d\n", <b>btc</b>(array, 35));
- printf("array = [0]:x%x, [1]:x%x\n", array[0], array[1]);
-
- printf("bts(array, 35) = %d\n", <b>bts</b>(array, 35));
- printf("array = [0]:x%x, [1]:x%x\n", array[0], array[1]);
-
- printf("btr(array, 35) = %d\n", <b>btr</b>(array, 35));
- printf("array = [0]:x%x, [1]:x%x\n", array[0], array[1]);
-
- printf("bt(array, 1) = %d\n", <b>bt</b>(array, 1));
- printf("array = [0]:x%x, [1]:x%x\n", array[0], array[1]);
-
- return 0;
- }
- * ---
- * Output:
- <pre>
- btc(array, 35) = 0
- array = [0]:x2, [1]:x108
- btc(array, 35) = -1
- array = [0]:x2, [1]:x100
- bts(array, 35) = 0
- array = [0]:x2, [1]:x108
- btr(array, 35) = -1
- array = [0]:x2, [1]:x100
- bt(array, 1) = -1
- array = [0]:x2, [1]:x100
- </pre>
- */
- int bts( uint* p, uint bitnum );
-
-
- /**
- * Swaps bytes in a 4 byte uint end-to-end, i.e. byte 0 becomes
- * byte 3, byte 1 becomes byte 2, byte 2 becomes byte 1, byte 3
- * becomes byte 0.
- */
- uint bswap( uint v );
-
-
- /**
- * Reads I/O port at port_address.
- */
- ubyte inp( uint port_address );
-
-
- /**
- * ditto
- */
- ushort inpw( uint port_address );
-
-
- /**
- * ditto
- */
- uint inpl( uint port_address );
-
-
- /**
- * Writes and returns value to I/O port at port_address.
- */
- ubyte outp( uint port_address, ubyte value );
-
-
- /**
- * ditto
- */
- ushort outpw( uint port_address, ushort value );
-
-
- /**
- * ditto
- */
- uint outpl( uint port_address, uint value );
-}
-else
-{
- public import std.intrinsic;
-}
-
-
-/**
- * Calculates the number of set bits in a 32-bit integer.
- */
-int popcnt( uint x )
-{
- // Avoid branches, and the potential for cache misses which
- // could be incurred with a table lookup.
-
- // We need to mask alternate bits to prevent the
- // sum from overflowing.
- // add neighbouring bits. Each bit is 0 or 1.
- x = x - ((x>>1) & 0x5555_5555);
- // now each two bits of x is a number 00,01 or 10.
- // now add neighbouring pairs
- x = ((x&0xCCCC_CCCC)>>2) + (x&0x3333_3333);
- // now each nibble holds 0000-0100. Adding them won't
- // overflow any more, so we don't need to mask any more
-
- // Now add the nibbles, then the bytes, then the words
- // We still need to mask to prevent double-counting.
- // Note that if we used a rotate instead of a shift, we
- // wouldn't need the masks, and could just divide the sum
- // by 8 to account for the double-counting.
- // On some CPUs, it may be faster to perform a multiply.
-
- x += (x>>4);
- x &= 0x0F0F_0F0F;
- x += (x>>8);
- x &= 0x00FF_00FF;
- x += (x>>16);
- x &= 0xFFFF;
- return x;
-}
-
-
-/**
- * Reverses the order of bits in a 32-bit integer.
- */
-uint bitswap( uint x )
-{
-
- version( D_InlineAsm_X86 )
- {
- asm
- {
- // Author: Tiago Gasiba.
- mov EDX, EAX;
- shr EAX, 1;
- and EDX, 0x5555_5555;
- and EAX, 0x5555_5555;
- shl EDX, 1;
- or EAX, EDX;
- mov EDX, EAX;
- shr EAX, 2;
- and EDX, 0x3333_3333;
- and EAX, 0x3333_3333;
- shl EDX, 2;
- or EAX, EDX;
- mov EDX, EAX;
- shr EAX, 4;
- and EDX, 0x0f0f_0f0f;
- and EAX, 0x0f0f_0f0f;
- shl EDX, 4;
- or EAX, EDX;
- bswap EAX;
- }
- }
- else
- {
- // swap odd and even bits
- x = ((x >> 1) & 0x5555_5555) | ((x & 0x5555_5555) << 1);
- // swap consecutive pairs
- x = ((x >> 2) & 0x3333_3333) | ((x & 0x3333_3333) << 2);
- // swap nibbles
- x = ((x >> 4) & 0x0F0F_0F0F) | ((x & 0x0F0F_0F0F) << 4);
- // swap bytes
- x = ((x >> 8) & 0x00FF_00FF) | ((x & 0x00FF_00FF) << 8);
- // swap 2-byte long pairs
- x = ( x >> 16 ) | ( x << 16);
- return x;
-
- }
-}
+/**\r
+ * This module contains a collection of bit-level operations.\r
+ *\r
+ * Copyright: Copyright (c) 2005-2008, The D Runtime Project\r
+ * License: BSD Style, see LICENSE\r
+ * Authors: Walter Bright, Don Clugston, Sean Kelly\r
+ */\r
+module bitmanip;\r
+\r
+\r
+version( DDoc )\r
+{\r
+ /**\r
+ * Scans the bits in v starting with bit 0, looking\r
+ * for the first set bit.\r
+ * Returns:\r
+ * The bit number of the first bit set.\r
+ * The return value is undefined if v is zero.\r
+ */\r
+ int bsf( uint v );\r
+\r
+\r
+ /**\r
+ * Scans the bits in v from the most significant bit\r
+ * to the least significant bit, looking\r
+ * for the first set bit.\r
+ * Returns:\r
+ * The bit number of the first bit set.\r
+ * The return value is undefined if v is zero.\r
+ * Example:\r
+ * ---\r
+ * import bitmanip;\r
+ *\r
+ * int main()\r
+ * {\r
+ * uint v;\r
+ * int x;\r
+ *\r
+ * v = 0x21;\r
+ * x = bsf(v);\r
+ * printf("bsf(x%x) = %d\n", v, x);\r
+ * x = bsr(v);\r
+ * printf("bsr(x%x) = %d\n", v, x);\r
+ * return 0;\r
+ * }\r
+ * ---\r
+ * Output:\r
+ * bsf(x21) = 0<br>\r
+ * bsr(x21) = 5\r
+ */\r
+ int bsr( uint v );\r
+\r
+\r
+ /**\r
+ * Tests the bit.\r
+ */\r
+ int bt( uint* p, uint bitnum );\r
+\r
+\r
+ /**\r
+ * Tests and complements the bit.\r
+ */\r
+ int btc( uint* p, uint bitnum );\r
+\r
+\r
+ /**\r
+ * Tests and resets (sets to 0) the bit.\r
+ */\r
+ int btr( uint* p, uint bitnum );\r
+\r
+\r
+ /**\r
+ * Tests and sets the bit.\r
+ * Params:\r
+ * p = a non-NULL pointer to an array of uints.\r
+ * index = a bit number, starting with bit 0 of p[0],\r
+ * and progressing. It addresses bits like the expression:\r
+ ---\r
+ p[index / (uint.sizeof*8)] & (1 << (index & ((uint.sizeof*8) - 1)))\r
+ ---\r
+ * Returns:\r
+ * A non-zero value if the bit was set, and a zero\r
+ * if it was clear.\r
+ *\r
+ * Example:\r
+ * ---\r
+ import bitmanip;\r
+\r
+ int main()\r
+ {\r
+ uint array[2];\r
+\r
+ array[0] = 2;\r
+ array[1] = 0x100;\r
+\r
+ printf("btc(array, 35) = %d\n", <b>btc</b>(array, 35));\r
+ printf("array = [0]:x%x, [1]:x%x\n", array[0], array[1]);\r
+\r
+ printf("btc(array, 35) = %d\n", <b>btc</b>(array, 35));\r
+ printf("array = [0]:x%x, [1]:x%x\n", array[0], array[1]);\r
+\r
+ printf("bts(array, 35) = %d\n", <b>bts</b>(array, 35));\r
+ printf("array = [0]:x%x, [1]:x%x\n", array[0], array[1]);\r
+\r
+ printf("btr(array, 35) = %d\n", <b>btr</b>(array, 35));\r
+ printf("array = [0]:x%x, [1]:x%x\n", array[0], array[1]);\r
+\r
+ printf("bt(array, 1) = %d\n", <b>bt</b>(array, 1));\r
+ printf("array = [0]:x%x, [1]:x%x\n", array[0], array[1]);\r
+\r
+ return 0;\r
+ }\r
+ * ---\r
+ * Output:\r
+ <pre>\r
+ btc(array, 35) = 0\r
+ array = [0]:x2, [1]:x108\r
+ btc(array, 35) = -1\r
+ array = [0]:x2, [1]:x100\r
+ bts(array, 35) = 0\r
+ array = [0]:x2, [1]:x108\r
+ btr(array, 35) = -1\r
+ array = [0]:x2, [1]:x100\r
+ bt(array, 1) = -1\r
+ array = [0]:x2, [1]:x100\r
+ </pre>\r
+ */\r
+ int bts( uint* p, uint bitnum );\r
+\r
+\r
+ /**\r
+ * Swaps bytes in a 4 byte uint end-to-end, i.e. byte 0 becomes\r
+ * byte 3, byte 1 becomes byte 2, byte 2 becomes byte 1, byte 3\r
+ * becomes byte 0.\r
+ */\r
+ uint bswap( uint v );\r
+\r
+\r
+ /**\r
+ * Reads I/O port at port_address.\r
+ */\r
+ ubyte inp( uint port_address );\r
+\r
+\r
+ /**\r
+ * ditto\r
+ */\r
+ ushort inpw( uint port_address );\r
+\r
+\r
+ /**\r
+ * ditto\r
+ */\r
+ uint inpl( uint port_address );\r
+\r
+\r
+ /**\r
+ * Writes and returns value to I/O port at port_address.\r
+ */\r
+ ubyte outp( uint port_address, ubyte value );\r
+\r
+\r
+ /**\r
+ * ditto\r
+ */\r
+ ushort outpw( uint port_address, ushort value );\r
+\r
+\r
+ /**\r
+ * ditto\r
+ */\r
+ uint outpl( uint port_address, uint value );\r
+}\r
+else\r
+{\r
+ public import std.intrinsic;\r
+}\r
+\r
+\r
+/**\r
+ * Calculates the number of set bits in a 32-bit integer.\r
+ */\r
+int popcnt( uint x )\r
+{\r
+ // Avoid branches, and the potential for cache misses which\r
+ // could be incurred with a table lookup.\r
+\r
+ // We need to mask alternate bits to prevent the\r
+ // sum from overflowing.\r
+ // add neighbouring bits. Each bit is 0 or 1.\r
+ x = x - ((x>>1) & 0x5555_5555);\r
+ // now each two bits of x is a number 00,01 or 10.\r
+ // now add neighbouring pairs\r
+ x = ((x&0xCCCC_CCCC)>>2) + (x&0x3333_3333);\r
+ // now each nibble holds 0000-0100. Adding them won't\r
+ // overflow any more, so we don't need to mask any more\r
+\r
+ // Now add the nibbles, then the bytes, then the words\r
+ // We still need to mask to prevent double-counting.\r
+ // Note that if we used a rotate instead of a shift, we\r
+ // wouldn't need the masks, and could just divide the sum\r
+ // by 8 to account for the double-counting.\r
+ // On some CPUs, it may be faster to perform a multiply.\r
+\r
+ x += (x>>4);\r
+ x &= 0x0F0F_0F0F;\r
+ x += (x>>8);\r
+ x &= 0x00FF_00FF;\r
+ x += (x>>16);\r
+ x &= 0xFFFF;\r
+ return x;\r
+}\r
+\r
+\r
+/**\r
+ * Reverses the order of bits in a 32-bit integer.\r
+ */\r
+uint bitswap( uint x )\r
+{\r
+\r
+ version( D_InlineAsm_X86 )\r
+ {\r
+ asm\r
+ {\r
+ // Author: Tiago Gasiba.\r
+ mov EDX, EAX;\r
+ shr EAX, 1;\r
+ and EDX, 0x5555_5555;\r
+ and EAX, 0x5555_5555;\r
+ shl EDX, 1;\r
+ or EAX, EDX;\r
+ mov EDX, EAX;\r
+ shr EAX, 2;\r
+ and EDX, 0x3333_3333;\r
+ and EAX, 0x3333_3333;\r
+ shl EDX, 2;\r
+ or EAX, EDX;\r
+ mov EDX, EAX;\r
+ shr EAX, 4;\r
+ and EDX, 0x0f0f_0f0f;\r
+ and EAX, 0x0f0f_0f0f;\r
+ shl EDX, 4;\r
+ or EAX, EDX;\r
+ bswap EAX;\r
+ }\r
+ }\r
+ else\r
+ {\r
+ // swap odd and even bits\r
+ x = ((x >> 1) & 0x5555_5555) | ((x & 0x5555_5555) << 1);\r
+ // swap consecutive pairs\r
+ x = ((x >> 2) & 0x3333_3333) | ((x & 0x3333_3333) << 2);\r
+ // swap nibbles\r
+ x = ((x >> 4) & 0x0F0F_0F0F) | ((x & 0x0F0F_0F0F) << 4);\r
+ // swap bytes\r
+ x = ((x >> 8) & 0x00FF_00FF) | ((x & 0x00FF_00FF) << 8);\r
+ // swap 2-byte long pairs\r
+ x = ( x >> 16 ) | ( x << 16);\r
+ return x;\r
+\r
+ }\r
+}\r
void function() dtor;
void function() unitTest;
- static int opApply( int delegate( inout ModuleInfo ) );
+ static int opApply(int delegate(inout ModuleInfo));
}
-class Exception : Object
+class Throwable : Object
{
interface TraceInfo
{
- int opApply( int delegate(inout char[]) );
+ int opApply(int delegate(inout char[]));
string toString();
}
string file;
size_t line;
TraceInfo info;
- Exception next;
+ Throwable next;
- this(string msg, Exception next = null);
- this(string msg, string file, size_t line, Exception next = null);
+ this(string msg, Throwable next = null);
+ this(string msg, string file, size_t line, Throwable next = null);
override string toString();
}
-alias Exception Error;
+class Exception : Throwable
+{
+ this(string msg, Throwable next = null);
+ this(string msg, string file, size_t line, Throwable next = null);
+}
+
+
+class Error : Throwable
+{
+ this(string msg, Throwable next = null);
+ this(string msg, string file, size_t line, Throwable next = null);
+}
* License: BSD Style, see LICENSE
* Authors: Walter Bright, Don Clugston, Sean Kelly
*/
-module bitmanip;
+module core.bitmanip;
version( DDoc )
* The return value is undefined if v is zero.
* Example:
* ---
- * import bitmanip;
+ * import core.bitmanip;
*
* int main()
* {
*
* Example:
* ---
- import bitmanip;
+ import core.bitmanip;
int main()
{
* License: BSD Style, see LICENSE
* Authors: Sean Kelly
*/
-module exception;
+module core.exception;
private
}
-/**
- * Thrown on hidden function error.
- */
-class HiddenFuncException : Exception
-{
- this(ClassInfo ci)
- {
- super("hidden method called for " ~ ci.name);
- }
-}
-
-
/**
* Thrown on an assert error.
*/
}
+/**
+ * Thrown on hidden function error.
+ */
+class HiddenFuncException : Exception
+{
+ this( ClassInfo ci )
+ {
+ super( "Hidden method called for " ~ ci.name );
+ }
+}
+
+
/**
* Thrown on an out of memory error.
*/
}
+/**
+ * A callback for hidden function errors in D. A HiddenFuncException will be
+ * thrown.
+ *
+ * Throws:
+ * HiddenFuncException.
+ */
+extern (C) void onHiddenFuncError( Object o )
+{
+ throw new HiddenFuncException( o.classinfo );
+}
+
+
/**
* A callback for out of memory errors in D. An OutOfMemoryException will be
* thrown.
{
throw new UnicodeException( msg, idx );
}
-
-/********************************************
- * Called by the compiler generated code.
- */
-
-extern (C) void _d_hidden_func()
-{ Object o;
- asm
- {
- mov o, EAX;
- }
-
- //printf("_d_hidden_func()\n");
- auto a = new HiddenFuncException(o.classinfo);
- //printf("assertion %p created\n", a);
- throw a;
-}
* License: BSD Style, see LICENSE
* Authors: Sean Kelly
*/
-module memory;
+module core.memory;
private
* License: BSD Style, see LICENSE
* Authors: Sean Kelly
*/
-module runtime;
+module core.runtime;
private
* License: BSD Style, see LICENSE
* Authors: Sean Kelly
*/
-module thread;
+module core.thread;
// this should be true for most architectures
import stdc.posix.time;
import stdc.errno;
- extern (C) int _d_getErrno();
- alias _d_getErrno getErrno;
-
version( GNU )
{
import gcc.builtins;
-# Makefile to build the D runtime library core components for Posix
-# Designed to work with GNU make
-# Targets:
-# make
-# Same as make all
-# make lib
-# Build the common library
-# make doc
-# Generate documentation
-# make clean
-# Delete unneeded files created by build process
-
-LIB_TARGET=libdruntime-core.a
-LIB_MASK=libdruntime-core*.a
-
-CP=cp -f
-RM=rm -f
-MD=mkdir -p
-
-ADD_CFLAGS=
-ADD_DFLAGS=
-
-CFLAGS=-O $(ADD_CFLAGS)
-#CFLAGS=-g $(ADD_CFLAGS)
-
-DFLAGS=-release -O -inline -w -nofloat -version=Posix $(ADD_DFLAGS)
-#DFLAGS=-g -w -nofloat -version=Posix $(ADD_DFLAGS)
-
-TFLAGS=-O -inline -w -nofloat -version=Posix $(ADD_DFLAGS)
-#TFLAGS=-g -w -nofloat -version=Posix $(ADD_DFLAGS)
-
-DOCFLAGS=-version=DDoc -version=Posix
-
-CC=gcc
-LC=$(AR) -qsv
-DC=dmd
-
-INC_DEST=../../import
-LIB_DEST=../../lib
-DOC_DEST=../../doc
-
-.SUFFIXES: .s .S .c .cpp .d .html .o
-
-.s.o:
- $(CC) -c $(CFLAGS) $< -o$@
-
-.S.o:
- $(CC) -c $(CFLAGS) $< -o$@
-
-.c.o:
- $(CC) -c $(CFLAGS) $< -o$@
-
-.cpp.o:
- g++ -c $(CFLAGS) $< -o$@
-
-.d.o:
- $(DC) -c $(DFLAGS) -Hf$*.di $< -of$@
-# $(DC) -c $(DFLAGS) $< -of$@
-
-.d.html:
- $(DC) -c -o- $(DOCFLAGS) -Df$*.html $<
-
-targets : lib doc
-all : lib doc
-core : lib
-lib : core.lib
-doc : core.doc
-
-######################################################
-
-OBJ_CORE= \
- bitmanip.o \
- exception.o \
- memory.o \
- runtime.o \
- thread.o
-
-OBJ_STDC= \
- stdc.o
-
-ALL_OBJS= \
- $(OBJ_CORE) \
- $(OBJ_STDC)
-
-######################################################
-
-DOC_CORE= \
- bitmanip.html \
- exception.html \
- memory.html \
- runtime.html \
- thread.html
-
-
-ALL_DOCS=
-
-######################################################
-
-core.lib : $(LIB_TARGET)
-
-$(LIB_TARGET) : $(ALL_OBJS)
- $(RM) $@
- $(LC) $@ $(ALL_OBJS)
-
-core.doc : $(ALL_DOCS)
- echo Documentation generated.
-
-######################################################
-
-### bitmanip
-
-bitmanip.o : bitmanip.d
- $(DC) -c $(DFLAGS) bitmanip.d -of$@
-
-### thread
-
-thread.o : thread.d
- $(DC) -c $(DFLAGS) -d -Hf$*.di thread.d -of$@
-
-######################################################
-
-clean :
- find . -name "*.di" | xargs $(RM)
- $(RM) $(ALL_OBJS)
- $(RM) $(ALL_DOCS)
- find . -name "$(LIB_MASK)" | xargs $(RM)
-
-install :
- $(MD) $(INC_DEST)
- find . -name "*.di" -exec cp -f {} $(INC_DEST)/{} \;
- $(MD) $(DOC_DEST)
- find . -name "*.html" -exec cp -f {} $(DOC_DEST)/{} \;
- $(MD) $(LIB_DEST)
- find . -name "$(LIB_MASK)" -exec cp -f {} $(LIB_DEST)/{} \;
+# Makefile to build the D runtime library core components for Posix\r
+# Designed to work with GNU make\r
+# Targets:\r
+# make\r
+# Same as make all\r
+# make lib\r
+# Build the common library\r
+# make doc\r
+# Generate documentation\r
+# make clean\r
+# Delete unneeded files created by build process\r
+\r
+LIB_TARGET=libdruntime-core.a\r
+LIB_MASK=libdruntime-core*.a\r
+\r
+CP=cp -f\r
+RM=rm -f\r
+MD=mkdir -p\r
+\r
+ADD_CFLAGS=\r
+ADD_DFLAGS=\r
+\r
+CFLAGS=-O $(ADD_CFLAGS)\r
+#CFLAGS=-g $(ADD_CFLAGS)\r
+\r
+DFLAGS=-release -O -inline -w -nofloat -version=Posix $(ADD_DFLAGS)\r
+#DFLAGS=-g -w -nofloat -version=Posix $(ADD_DFLAGS)\r
+\r
+TFLAGS=-O -inline -w -nofloat -version=Posix $(ADD_DFLAGS)\r
+#TFLAGS=-g -w -nofloat -version=Posix $(ADD_DFLAGS)\r
+\r
+DOCFLAGS=-version=DDoc -version=Posix\r
+\r
+CC=gcc\r
+LC=$(AR) -qsv\r
+DC=dmd\r
+\r
+INC_DEST=../../import\r
+LIB_DEST=../../lib\r
+DOC_DEST=../../doc\r
+\r
+.SUFFIXES: .s .S .c .cpp .d .html .o\r
+\r
+.s.o:\r
+ $(CC) -c $(CFLAGS) $< -o$@\r
+\r
+.S.o:\r
+ $(CC) -c $(CFLAGS) $< -o$@\r
+\r
+.c.o:\r
+ $(CC) -c $(CFLAGS) $< -o$@\r
+\r
+.cpp.o:\r
+ g++ -c $(CFLAGS) $< -o$@\r
+\r
+.d.o:\r
+ $(DC) -c $(DFLAGS) -Hf$*.di $< -of$@\r
+# $(DC) -c $(DFLAGS) $< -of$@\r
+\r
+.d.html:\r
+ $(DC) -c -o- $(DOCFLAGS) -Df$*.html $<\r
+\r
+targets : lib doc\r
+all : lib doc\r
+core : lib\r
+lib : core.lib\r
+doc : core.doc\r
+\r
+######################################################\r
+\r
+OBJ_CORE= \\r
+ core/bitmanip.o \\r
+ core/exception.o \\r
+ core/memory.o \\r
+ core/runtime.o \\r
+ core/thread.o\r
+\r
+OBJ_STDC= \\r
+ stdc/errno.o\r
+\r
+ALL_OBJS= \\r
+ $(OBJ_CORE) \\r
+ $(OBJ_STDC)\r
+\r
+######################################################\r
+\r
+DOC_CORE= \\r
+ core/bitmanip.html \\r
+ core/exception.html \\r
+ core/memory.html \\r
+ core/runtime.html \\r
+ core/thread.html\r
+\r
+\r
+ALL_DOCS=\r
+\r
+######################################################\r
+\r
+core.lib : $(LIB_TARGET)\r
+\r
+$(LIB_TARGET) : $(ALL_OBJS)\r
+ $(RM) $@\r
+ $(LC) $@ $(ALL_OBJS)\r
+\r
+core.doc : $(ALL_DOCS)\r
+ echo Documentation generated.\r
+\r
+######################################################\r
+\r
+### bitmanip\r
+\r
+core/bitmanip.o : core/bitmanip.d\r
+ $(DC) -c $(DFLAGS) bitmanip.d -of$@\r
+\r
+### thread\r
+\r
+core/thread.o : core/thread.d\r
+ $(DC) -c $(DFLAGS) -d -Hf$*.di thread.d -of$@\r
+\r
+######################################################\r
+\r
+clean :\r
+ find . -name "*.di" | xargs $(RM)\r
+ $(RM) $(ALL_OBJS)\r
+ $(RM) $(ALL_DOCS)\r
+ find . -name "$(LIB_MASK)" | xargs $(RM)\r
+\r
+install :\r
+ $(MD) $(INC_DEST)\r
+ find . -name "*.di" -exec cp -f {} $(INC_DEST)/{} \;\r
+ $(MD) $(DOC_DEST)\r
+ find . -name "*.html" -exec cp -f {} $(DOC_DEST)/{} \;\r
+ $(MD) $(LIB_DEST)\r
+ find . -name "$(LIB_MASK)" -exec cp -f {} $(LIB_DEST)/{} \;\r
#include <errno.h>
-int _d_getErrno()
+int getErrno()
{
return errno;
}
-int _d_setErrno( int val )
+int setErrno( int val )
{
errno = val;
return val;
-# Makefile to build the D runtime library core components for Win32
-# Designed to work with DigitalMars make
-# Targets:
-# make
-# Same as make all
-# make lib
-# Build the common library
-# make doc
-# Generate documentation
-# make clean
-# Delete unneeded files created by build process
-
-LIB_TARGET=druntime-core.lib
-LIB_MASK=druntime-core*.lib
-
-CP=xcopy /y
-RM=del /f
-MD=mkdir
-
-ADD_CFLAGS=
-ADD_DFLAGS=
-
-CFLAGS=-mn -6 -r $(ADD_CFLAGS)
-#CFLAGS=-g -mn -6 -r $(ADD_CFLAGS)
-
-DFLAGS=-release -O -inline -w -nofloat $(ADD_DFLAGS)
-#DFLAGS=-g -w -nofloat $(ADD_DFLAGS)
-
-TFLAGS=-O -inline -w -nofloat $(ADD_DFLAGS)
-#TFLAGS=-g -w -nofloat $(ADD_DFLAGS)
-
-DOCFLAGS=-version=DDoc
-
-CC=dmc
-LC=lib
-DC=dmd
-
-INC_DEST=..\..\import
-LIB_DEST=..\..\lib
-DOC_DEST=..\..\doc
-
-.DEFAULT: .asm .c .cpp .d .html .obj
-
-.asm.obj:
- $(CC) -c $<
-
-.c.obj:
- $(CC) -c $(CFLAGS) $< -o$@
-
-.cpp.obj:
- $(CC) -c $(CFLAGS) $< -o$@
-
-.d.obj:
- $(DC) -c $(DFLAGS) -Hf$*.di $< -of$@
-# $(DC) -c $(DFLAGS) $< -of$@
-
-.d.html:
- $(DC) -c -o- $(DOCFLAGS) -Df$*.html $<
-
-targets : lib doc
-all : lib doc
-core : lib
-lib : core.lib
-doc : core.doc
-
-######################################################
-
-OBJ_CORE= \
- bitmanip.obj \
- exception.obj \
- memory.obj \
- runtime.obj \
- thread.obj
-
-OBJ_STDC= \
- stdc.obj
-
-ALL_OBJS= \
- $(OBJ_CORE) \
- $(OBJ_STDC)
-
-######################################################
-
-DOC_CORE= \
- bitmanip.html \
- exception.html \
- memory.html \
- runtime.html \
- thread.html
-
-ALL_DOCS=
-
-######################################################
-
-core.lib : $(LIB_TARGET)
-
-$(LIB_TARGET) : $(ALL_OBJS)
- $(RM) $@
- $(LC) -c -n $@ $(ALL_OBJS)
-
-core.doc : $(ALL_DOCS)
- @echo Documentation generated.
-
-######################################################
-
-### bitmanip
-
-bitmanip.obj : bitmanip.d
- $(DC) -c $(DFLAGS) bitmanip.d -of$@
-
-### thread
-
-thread.obj : thread.d
- $(DC) -c $(DFLAGS) -d -Hf$*.di thread.d -of$@
-
-######################################################
-
-clean :
- $(RM) /s .\*.di
- $(RM) $(ALL_OBJS)
- $(RM) $(ALL_DOCS)
- $(RM) $(LIB_MASK)
-
-install :
- $(MD) $(INC_DEST)
- $(CP) /s *.di $(INC_DEST)\.
- $(MD) $(DOC_DEST)
- $(CP) /s *.html $(DOC_DEST)\.
- $(MD) $(LIB_DEST)
- $(CP) $(LIB_MASK) $(LIB_DEST)\.
+# Makefile to build the D runtime library core components for Win32\r
+# Designed to work with DigitalMars make\r
+# Targets:\r
+# make\r
+# Same as make all\r
+# make lib\r
+# Build the common library\r
+# make doc\r
+# Generate documentation\r
+# make clean\r
+# Delete unneeded files created by build process\r
+\r
+LIB_TARGET=druntime-core.lib\r
+LIB_MASK=druntime-core*.lib\r
+\r
+CP=xcopy /y\r
+RM=del /f\r
+MD=mkdir\r
+\r
+ADD_CFLAGS=\r
+ADD_DFLAGS=\r
+\r
+CFLAGS=-mn -6 -r $(ADD_CFLAGS)\r
+#CFLAGS=-g -mn -6 -r $(ADD_CFLAGS)\r
+\r
+DFLAGS=-release -O -inline -w -nofloat $(ADD_DFLAGS)\r
+#DFLAGS=-g -w -nofloat $(ADD_DFLAGS)\r
+\r
+TFLAGS=-O -inline -w -nofloat $(ADD_DFLAGS)\r
+#TFLAGS=-g -w -nofloat $(ADD_DFLAGS)\r
+\r
+DOCFLAGS=-version=DDoc\r
+\r
+CC=dmc\r
+LC=lib\r
+DC=dmd\r
+\r
+INC_DEST=..\..\import\r
+LIB_DEST=..\..\lib\r
+DOC_DEST=..\..\doc\r
+\r
+.DEFAULT: .asm .c .cpp .d .html .obj\r
+\r
+.asm.obj:\r
+ $(CC) -c $<\r
+\r
+.c.obj:\r
+ $(CC) -c $(CFLAGS) $< -o$@\r
+\r
+.cpp.obj:\r
+ $(CC) -c $(CFLAGS) $< -o$@\r
+\r
+.d.obj:\r
+ $(DC) -c $(DFLAGS) -Hf$*.di $< -of$@\r
+# $(DC) -c $(DFLAGS) $< -of$@\r
+\r
+.d.html:\r
+ $(DC) -c -o- $(DOCFLAGS) -Df$*.html $<\r
+\r
+targets : lib doc\r
+all : lib doc\r
+core : lib\r
+lib : core.lib\r
+doc : core.doc\r
+\r
+######################################################\r
+\r
+OBJ_CORE= \\r
+ core\bitmanip.obj \\r
+ core\exception.obj \\r
+ core\memory.obj \\r
+ core\runtime.obj \\r
+ core\thread.obj\r
+\r
+OBJ_STDC= \\r
+ stdc\errno.obj\r
+\r
+ALL_OBJS= \\r
+ $(OBJ_CORE) \\r
+ $(OBJ_STDC)\r
+\r
+######################################################\r
+\r
+DOC_CORE= \\r
+ core\bitmanip.html \\r
+ core\exception.html \\r
+ core\memory.html \\r
+ core\runtime.html \\r
+ core\thread.html\r
+\r
+ALL_DOCS=\r
+\r
+######################################################\r
+\r
+core.lib : $(LIB_TARGET)\r
+\r
+$(LIB_TARGET) : $(ALL_OBJS)\r
+ $(RM) $@\r
+ $(LC) -c -n $@ $(ALL_OBJS)\r
+\r
+core.doc : $(ALL_DOCS)\r
+ @echo Documentation generated.\r
+\r
+######################################################\r
+\r
+### bitmanip\r
+\r
+core\bitmanip.obj : core\bitmanip.d\r
+ $(DC) -c $(DFLAGS) core\bitmanip.d -of$@\r
+\r
+### thread\r
+\r
+core\thread.obj : core\thread.d\r
+ $(DC) -c $(DFLAGS) -d -Hf$*.di core\thread.d -of$@\r
+\r
+######################################################\r
+\r
+clean :\r
+ $(RM) /s .\*.di\r
+ $(RM) $(ALL_OBJS)\r
+ $(RM) $(ALL_DOCS)\r
+ $(RM) $(LIB_MASK)\r
+\r
+install :\r
+ $(MD) $(INC_DEST)\.\r
+ $(CP) /s *.di $(INC_DEST)\.\r
+ $(MD) $(DOC_DEST)\r
+ $(CP) /s *.html $(DOC_DEST)\.\r
+ $(MD) $(LIB_DEST)\r
+ $(CP) $(LIB_MASK) $(LIB_DEST)\.\r
import stdc.posix.fcntl;
import stdc.posix.unistd;
}
- import bitmanip;
+ import core.bitmanip;
import stdc.stdio;
import util.utf;
#include "mars.h"
-extern ClassInfo D9Exception7__ClassZ;
+extern ClassInfo D6object9Throwable7__ClassZ;
+#define _Class_9Throwable D6object9Throwable7__ClassZ;
-#define _Class_9Exception D9Exception7__ClassZ
+extern ClassInfo D6object5Error7__ClassZ;
+#define _Class_5Error D6object5Error7__ClassZ
typedef int (__pascal *fp_t)(); // function pointer in ambient memory model
ci = **(ClassInfo ***)(exception_record->ExceptionInformation[0]);
}
else
- ci = &_Class_9Exception;
+ ci = &_Class_9Throwable;
}
if (_d_isbaseof(ci, pcb->type))
- { // Matched the catch type, so we've found the handler.
+ {
+ // Matched the catch type, so we've found the handler.
int regebp;
pti = _d_translate_se_to_d_exception(exception_record);
Object *_d_create_exception_object(ClassInfo *ci, char *msg)
{
- Exception *exc;
+ Throwable *exc;
- exc = (Exception *)_d_newclass(ci);
+ exc = (Throwable *)_d_newclass(ci);
// BUG: what if _d_newclass() throws an out of memory exception?
if (msg)
break;
case STATUS_INTEGER_DIVIDE_BY_ZERO:
- pti = _d_create_exception_object(&_Class_9Exception, "Integer Divide by Zero");
+ pti = _d_create_exception_object(&_Class_5Error, "Integer Divide by Zero");
break;
case STATUS_FLOAT_DIVIDE_BY_ZERO:
- pti = _d_create_exception_object(&_Class_9Exception, "Float Divide by Zero");
+ pti = _d_create_exception_object(&_Class_5Error, "Float Divide by Zero");
break;
case STATUS_ACCESS_VIOLATION:
- pti = _d_create_exception_object(&_Class_9Exception, "Access Violation");
+ pti = _d_create_exception_object(&_Class_5Error, "Access Violation");
break;
case STATUS_STACK_OVERFLOW:
- pti = _d_create_exception_object(&_Class_9Exception, "Stack Overflow");
+ pti = _d_create_exception_object(&_Class_5Error, "Stack Overflow");
break;
// convert all other exception codes into a Win32Exception
default:
- pti = _d_create_exception_object(&_Class_9Exception, "Win32 Exception");
+ pti = _d_create_exception_object(&_Class_5Error, "Win32 Exception");
break;
}
#include "mars.h"
-extern ClassInfo D9Exception7__ClassZ;
+extern ClassInfo D6object9Throwable7__ClassZ;
+#define _Class_9Throwable D6object9Throwable7__ClassZ;
-#define _Class_9Exception D9Exception7__ClassZ
+extern ClassInfo D6object5Error7__ClassZ;
+#define _Class_5Error D6object5Error7__ClassZ
typedef int (*fp_t)(); // function pointer in ambient memory model
import stdc.string;
}
-version( Windows )
+version(Windows)
{
extern (Windows) void* LocalFree(void*);
extern (Windows) wchar_t* GetCommandLineW();
* These functions must be defined for any D program linked
* against this library.
*/
-extern (C) void onAssertError( string file, size_t line );
-extern (C) void onAssertErrorMsg( string file, size_t line, string msg );
-extern (C) void onArrayBoundsError( string file, size_t line );
-extern (C) void onSwitchError( string file, size_t line );
+extern (C) void onAssertError(string file, size_t line);
+extern (C) void onAssertErrorMsg(string file, size_t line, string msg);
+extern (C) void onArrayBoundsError(string file, size_t line);
+extern (C) void onHiddenFuncError(Object o);
+extern (C) void onSwitchError(string file, size_t line);
extern (C) bool runModuleUnitTests();
// this function is called from the utf module
-//extern (C) void onUnicodeError( string msg, size_t idx );
+//extern (C) void onUnicodeError(string msg, size_t idx);
/***********************************
* These are internal callbacks for various language errors.
*/
-extern (C) void _d_assert( string file, uint line )
+extern (C) void _d_assert(string file, uint line)
{
- onAssertError( file, line );
+ onAssertError(file, line);
}
-extern (C) static void _d_assert_msg( string msg, string file, uint line )
+extern (C) static void _d_assert_msg(string msg, string file, uint line)
{
- onAssertErrorMsg( file, line, msg );
+ onAssertErrorMsg(file, line, msg);
}
-extern (C) void _d_array_bounds( string file, uint line )
+extern (C) void _d_array_bounds(string file, uint line)
{
- onArrayBoundsError( file, line );
+ onArrayBoundsError(file, line);
}
-extern (C) void _d_switch_error( string file, uint line )
+extern (C) void _d_switch_error(string file, uint line)
{
- onSwitchError( file, line );
+ onSwitchError(file, line);
}
-/+
extern (C) void _d_hidden_func()
{
- // TODO: Figure out what to do with this routine
- // it's in exception.d for the moment
+ Object o;
+ asm
+ {
+ mov o, EAX;
+ }
+ onHiddenFuncError(o);
}
-+/
bool _d_isHalting = false;
}
}
-alias void delegate( Exception ) ExceptionHandler;
+alias void delegate(Throwable) ExceptionHandler;
-extern (C) bool rt_init( ExceptionHandler dg = null )
+extern (C) bool rt_init(ExceptionHandler dg = null)
{
_d_criticalInit();
_moduleCtor();
return true;
}
- catch( Exception e )
+ catch (Throwable e)
{
- if( dg )
- dg( e );
+ if (dg)
+ dg(e);
}
catch
{
}
}
-extern (C) bool rt_term( ExceptionHandler dg = null )
+extern (C) bool rt_term(ExceptionHandler dg = null)
{
try
{
gc_term();
return true;
}
- catch( Exception e )
+ catch (Throwable e)
{
- if( dg )
- dg( e );
+ if (dg)
+ dg(e);
}
catch
{
for (size_t i = 0, p = 0; i < wargc; i++)
{
- int wlen = wcslen( wargs[i] );
+ int wlen = wcslen(wargs[i]);
int clen = WideCharToMultiByte(65001, 0, &wargs[i][0], wlen, null, 0, null, 0);
args[i] = cargp[p .. p+clen];
p += clen; assert(p <= cargl);
{
dg();
}
- catch (Exception e)
+ catch (Throwable e)
{
while (e)
{
if (e.file)
{
- // fprintf(stderr, "%.*s(%u): %.*s\n", e.file, e.line, e.msg);
- console (e.classinfo.name)("@")(e.file)("(")(e.line)("): ")(e.msg)("\n");
+ // fprintf(stderr, "%.*s(%u): %.*s\n", e.file, e.line, e.msg);
+ console (e.classinfo.name)("@")(e.file)("(")(e.line)("): ")(e.msg)("\n");
}
else
{
- // fprintf(stderr, "%.*s\n", e.toString());
- console (e.classinfo.name)(": ")(e.toString)("\n");
+ // fprintf(stderr, "%.*s\n", e.toString());
+ console (e.toString)("\n");
}
if (e.info)
{
extern (C) size_t gc_sizeOf( void* p );
extern (C) BlkInfo gc_query( void* p );
- extern (C) void onFinalizeError( ClassInfo c, Exception e );
+ extern (C) void onFinalizeError( ClassInfo c, Throwable e );
extern (C) void onOutOfMemoryError();
extern (C) void _d_monitordelete(Object h, bool det = true);
if ((cast(void**)p)[1]) // if monitor is not null
_d_monitordelete(cast(Object)p, det);
}
- catch (Exception e)
+ catch (Throwable e)
{
onFinalizeError(**pc, e);
}
int flags;
} ClassInfo;
-typedef struct Exception
+typedef struct Throwable
{
Object object;
size_t line;
struct Interface *info;
- struct Exception *next;
-} Exception;
+ struct Throwable *next;
+} Throwable;
typedef struct Array
{
//alias typeof(int.sizeof) size_t;
//alias typeof(cast(void*)0 - cast(void*)0) ptrdiff_t;
-version( X86_64 )
+version(X86_64)
{
alias ulong size_t;
alias long ptrdiff_t;
void unlock();
}
- /******
+ /**
* Create instance of class specified by classname.
* The class must either have no constructors or have
* a default constructor.
}
return o;
}
+
/**
* Search for all members with the name 'name'.
* If name[] is null, return all members.
class TypeInfo
{
override hash_t toHash()
- { hash_t hash;
+ {
+ hash_t hash;
foreach (char c; this.toString())
hash = hash * 9 + c;
///////////////////////////////////////////////////////////////////////////////
-// Exception
+// Throwable
///////////////////////////////////////////////////////////////////////////////
-class Exception : Object
+class Throwable : Object
{
interface TraceInfo
{
- int opApply( int delegate(inout char[]) );
+ int opApply(int delegate(inout char[]));
}
string msg;
string file;
size_t line;
TraceInfo info;
- Exception next;
- char[] buffer;
+ Throwable next;
- this( string msg, Exception next = null )
+ this(string msg, Throwable next = null)
{
this.msg = msg;
this.next = next;
this.info = traceContext();
}
- this( string msg, string file, size_t line, Exception next = null )
+ this(string msg, string file, size_t line, Throwable next = null)
{
this(msg, next);
this.file = file;
override string toString()
{
- if (file.length == 0 && line == 0)
- return msg;
- if (buffer.length == 0)
+ char[10] tmp;
+ char[] buf;
+
+ for (Throwable e = this; e !is null; e = e.next)
{
- // Write into buffer[] the following: "file(line): msg"
- buffer.length = 4 + file.length + line.sizeof * 3 + msg.length;
- auto i = file.length;
- buffer[0 .. i] = file[];
- buffer[i] = '(';
- i++;
-
- auto n = line;
- auto j = i;
- do
- {
- buffer[i] = cast(char)((n % 10) + '0');
- n /= 10;
- i++;
- } while (n);
- buffer[j .. i].reverse;
- buffer[i..i+3] = "): "[];
- i += 3;
-
- buffer[i .. i + msg.length] = msg[];
- i += msg.length;
-
- buffer = buffer[0 .. i];
- }
- return cast(invariant)buffer;
+ if (e.file)
+ {
+ buf ~= e.classinfo.name ~ "@" ~ e.file ~ "(" ~ tmp.intToString(e.line) ~ "): " ~ e.msg;
+ }
+ else
+ {
+ buf ~= e.classinfo.name ~ ": " ~ e.msg;
+ }
+ if (e.info)
+ {
+ buf ~= "\n----------------";
+ foreach (t; e.info)
+ buf ~= "\n" ~ t;
+ }
+ if (e.next)
+ buf ~= "\n";
+ }
+ return cast(string) buf;
}
}
-alias Exception.TraceInfo function( void* ptr = null ) TraceHandler;
+alias Throwable.TraceInfo function(void* ptr = null) TraceHandler;
private TraceHandler traceHandler = null;
* Params:
* h = The new trace handler. Set to null to use the default handler.
*/
-extern (C) void rt_setTraceHandler( TraceHandler h )
+extern (C) void rt_setTraceHandler(TraceHandler h)
{
traceHandler = h;
}
/**
- * This function will be called when an Exception is constructed. The
+ * This function will be called when an exception is constructed. The
* user-supplied trace handler will be called if one has been supplied,
* otherwise no trace will be generated.
*
* An object describing the current calling context or null if no handler is
* supplied.
*/
-Exception.TraceInfo traceContext( void* ptr = null )
+Throwable.TraceInfo traceContext(void* ptr = null)
{
- if( traceHandler is null )
+ if (traceHandler is null)
return null;
- return traceHandler( ptr );
+ return traceHandler(ptr);
+}
+
+
+class Exception : Throwable
+{
+ this(string msg, Throwable next = null)
+ {
+ super(msg, next);
+ }
+
+ this(string msg, string file, size_t line, Throwable next = null)
+ {
+ super(msg, file, line, next);
+ }
+}
+
+
+class Error : Throwable
+{
+ this(string msg, Throwable next = null)
+ {
+ super(msg, next);
+ }
+
+ this(string msg, string file, size_t line, Throwable next = null)
+ {
+ super(msg, file, line, next);
+ }
}
void function() ictor; // module static constructor (order independent)
- static int opApply( int delegate(inout ModuleInfo) dg )
+ static int opApply(int delegate(inout ModuleInfo) dg)
{
int ret = 0;
- foreach( m; _moduleinfo_array )
+ foreach (m; _moduleinfo_array)
{
- ret = dg( m );
- if( ret )
+ ret = dg(m);
+ if (ret)
break;
}
return ret;
if (m.flags & MIctorstart)
{ if (skip || m.flags & MIstandalone)
continue;
- throw new Exception( "Cyclic dependency in module " ~ m.name );
+ throw new Exception("Cyclic dependency in module " ~ m.name);
}
m.flags |= MIctorstart;
# Delete unneeded files created by build process
LIB_TARGET=libdruntime-dmd.a
-LIB_MASK=libdruntime-dmd*.a
+DUP_TARGET=libdruntime.a
+LIB_MASK=libdruntime*.a
-DIR_CC=../src/core
-DIR_RT=../src/compiler/dmd
-DIR_GC=../src/gc/basic
+DIR_CC=common
+DIR_RT=compiler/dmd
+DIR_GC=gc/basic
CP=cp -f
RM=rm -f
make -C $(DIR_CC) -fposix.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)"
make -C $(DIR_RT) -fposix.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)"
make -C $(DIR_GC) -fposix.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)"
- find . -name "libphobos*.a" | xargs $(RM)
+ $(RM) $(LIB_TARGET)
$(LC) $(LIB_TARGET) `find $(DIR_CC) -name "*.o" | xargs echo`
$(LC) $(LIB_TARGET) `find $(DIR_RT) -name "*.o" | xargs echo`
$(LC) $(LIB_TARGET) `find $(DIR_GC) -name "*.o" | xargs echo`
+ $(RM) $(DUP_TARGET)
+ $(CP) $(LIB_TARGET) $(DUP_TARGET)
doc : $(ALL_DOCS)
make -C $(DIR_CC) -fposix.mak doc DC=$(DC)
# make clean
# Delete unneeded files created by build process
-LIB_TARGET=druntime.lib
-LIB_MASK=druntime.lib
+LIB_TARGET=druntime-dmd.lib
+DUP_TARGET=druntime.lib
+LIB_MASK=druntime*.lib
-DIR_CC=core
+DIR_CC=common
DIR_RT=compiler\dmd
DIR_GC=gc\basic
cd ..\..
$(RM) $(LIB_TARGET)
$(LC) -c -n $(LIB_TARGET) $(LIB_CC) $(LIB_RT) $(LIB_GC)
+ $(RM) $(DUP_TARGET)
+ copy $(LIB_TARGET) $(DUP_TARGET)
doc : $(ALL_DOCS)
cd $(DIR_CC)
[Environment]
-DFLAGS=-version=Posix "-I%HOME%/core" "-I%HOME%/../import"
+DFLAGS=-version=Posix "-I%HOME%/common" "-I%HOME%/../import"
* Authors: Walter Bright, Sean Kelly
*/
+module gc.gc;
+
private import gcx;
private import gcstats;
private import stdc.stdlib;
* Authors: Walter Bright, David Friedman, Sean Kelly
*/
+module gc.gcalloc;
+
version (Windows)
{
* Authors: Walter Bright, David Friedman, Sean Kelly
*/
+module gc.gcbits;
+
private
{
- import bitmanip;
+ import core.bitmanip;
import stdc.string;
import stdc.stdlib;
extern (C) void onOutOfMemoryError();
* Authors: Walter Bright, Sean Kelly
*/
+module gc.gcstats;
+
/**
*
* Authors: Walter Bright, David Friedman, Sean Kelly
*/
+module gc.gcx;
+
// D Programming Language Garbage Collector implementation
/************** Debugging ***************************/
* Authors: Sean Kelly
*/
+module gc.gc;
+
private import stdc.stdlib;
private
[Environment]
LIB=%@P%\..\lib;\dm\lib
-DFLAGS="-I%HOME%\core" "-I%HOME%\..\import"
+DFLAGS="-I%HOME%\common" "-I%HOME%\..\import"
LINKCMD=%@P%\..\..\dm\bin\link.exe