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 bug; | |
//Use swig2.0 -Wall -d -d2 -c++ bug.i | |
//Then in the generated files: | |
//in Test/Test.d: | |
//"class AttachedPictureFrame : Test.Frame {" | |
//should be | |
//"class AttachedPictureFrame : Test.Test.Frame {" | |
namespace Test { |
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.datetime; | |
import std.array; | |
import std.conv; | |
import std.string; | |
import std.algorithm; | |
struct PackageVersion | |
{ | |
enum VersionType | |
{ |
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
/** | |
* Original libev documentation: | |
* $(LINK2 http://pod.tst.eu/http://cvs.schmorp.de/_libev/ev.pod?pathrev=rel-3__9, version 3.9) | |
* $(LINK2 http://pod.tst.eu/http://cvs.schmorp.de/_libev/ev.pod?pathrev=rel-4__04, version 4.04) | |
* $(LINK2 http://pod.tst.eu/http://cvs.schmorp.de/_libev/ev.pod, most recent version) | |
*/ | |
module jpf.c.libev; | |
/* | |
* libev native API header |
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
struct File | |
{ | |
private struct Impl | |
{ | |
uint refs = uint.max / 2; | |
//Other 'by-reference' members ... | |
this(uint r) | |
{ | |
refs = r; | |
} |
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
struct File | |
{ | |
private struct Impl | |
{ | |
uint refs = uint.max / 2; | |
//Other 'by-reference' members ... | |
this(uint r) | |
{ | |
refs = r; | |
} |
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; | |
import std.typecons; | |
void main() | |
{ | |
auto wrap1 = Wrapper(1); | |
} | |
void free(ref int _payload) | |
{ |
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
detach() | |
{ | |
if (!RefCounted._store) return; | |
assert(RefCounted._store._count > 0); | |
if (--RefCounted._store._count) | |
{ | |
debug(RefCounted) if (RefCounted.debugging) | |
writeln(typeof(this).stringof, | |
"@", cast(void*)RefCounted._store, | |
": decrement refcount to ", RefCounted._store._count); |
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.socket, std.exception, std.stdio, std.random, std.range; | |
void main(string args[]) | |
{ | |
enforce(args.length == 2); | |
if(args[1] == "--server") | |
{ | |
auto sock = new Socket(AddressFamily.INET, SocketType.STREAM); | |
sock.bind(new InternetAddress("localhost", 9870)); | |
sock.listen(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
import std.datetime, std.concurrency, std.stdio, core.sys.posix.unistd; | |
import std.exception; | |
enum BUFFER_SIZE = 1 * 1024 * 1024UL; | |
void main(string[] args) | |
{ | |
assert(args.length == 4); | |
ubyte[BUFFER_SIZE] buf; | |
auto sw = StopWatch(); |
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.datetime, std.concurrency, std.stdio, core.sys.posix.unistd; | |
import std.exception; | |
enum BUFFER_SIZE = 1 * 1024 * 1024UL; | |
void main(string[] args) | |
{ | |
assert(args.length == 3); | |
auto sw = StopWatch(); |