This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/struct.c b/src/struct.c | |
index f6fd857..3a6fe5f 100644 | |
--- a/src/struct.c | |
+++ b/src/struct.c | |
@@ -684,9 +684,19 @@ void StructDeclaration::finalizeSize(Scope *sc) | |
// Set the offsets of the fields and determine the size of the struct | |
unsigned offset = 0; | |
bool isunion = isUnionDeclaration() != NULL; | |
+ unsigned maxofs = 0; | |
for (size_t i = 0; i < members->dim; i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.traits; | |
/** | |
* Detect whether $(D X) is a type or not. | |
*/ | |
template isType(X...) if (X.length == 1) | |
{ | |
enum isType = is(X[0]); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template isMutable(T) | |
{ | |
enum isMutable = !is(T == const) && !is(T == immutable) && !is(T == inout); | |
} | |
template Unqual(T) | |
{ | |
static if (is(T U == shared(const U))) alias U Unqual; | |
else static if (is(T U == const U )) alias U Unqual; | |
else static if (is(T U == immutable U )) alias U Unqual; | |
else static if (is(T U == inout U )) alias U Unqual; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.stdio; | |
void main() | |
{ | |
T delegate(T) zero(T)(T delegate(T) f) | |
{ | |
return x => x; | |
} | |
T delegate(T) delegate(T delegate(T)) succ(T)(T delegate(T) delegate(T delegate(T)) n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# reqire DigitalMars make, and cp command in MSYS. | |
######## MAKE PARAMETERS ######## | |
#DMCDIR=c:\dm | |
#DMDDIR=c:\dmd2 | |
## INTERNAL VARIABLES ## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Source,Pool,Sinkの3つを基本I/Fと置く | |
(バッファリングされたSinkを明示的に扱う手段はなくす) | |
それぞれがやり取りする要素の型は任意だが、Fileはubyteをやり取りする | |
(D言語的にはvoid[]でもいいかも) | |
Encodedはubyteを任意型にcastする機能を提供する | |
Bufferedはバッファリングを行う |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module sealed; | |
import std.stdio; | |
@trusted struct Sealed(T) | |
{ | |
//private T* p; | |
public T* p; | |
this(ref T t) | |
{ |