Re: How to pre build vibe-d dub package

2020-05-29 Thread kookman via Digitalmars-d-learn
On Friday, 29 May 2020 at 11:45:24 UTC, Andre Pany wrote: André I do it by defining a configuration “build-deps” in my dub.sdl with target type “none” and then doing the build as two steps in the dockerfile: ``` dockerfile ... WORKDIR /build COPY dub.s* ./ RUN dub build -v

Re: std.bitmanip help - how to combine bitfields and read

2020-03-11 Thread kookman via Digitalmars-d-learn
On Wednesday, 11 March 2020 at 05:25:43 UTC, kookman wrote: I am using libpcap to read from stored pcap files, and want to use std.bitmanip.bitfields to read TCP flags from the file, using a struct like: struct TcpHeader { align(1): ushort srcPort; ushort dstPort; uint seqNo;

std.bitmanip help - how to combine bitfields and read

2020-03-10 Thread kookman via Digitalmars-d-learn
I am using libpcap to read from stored pcap files, and want to use std.bitmanip.bitfields to read TCP flags from the file, using a struct like: struct TcpHeader { align(1): ushort srcPort; ushort dstPort; uint seqNo; uint ackNo; mixin(bitfields!( bool,

Re: LockingTextWriter not an output range?

2018-04-19 Thread kookman via Digitalmars-d-learn
On Wednesday, 18 April 2018 at 06:40:15 UTC, rikki cattermole wrote: On 18/04/2018 6:28 PM, kookman wrote: The below static assert fails. Is this expected? Not the way I read the docs. static assert (isOutputRange(typeof(stdout.lockingTextWriter), char)); static assert

Re: LockingTextWriter not an output range?

2018-04-18 Thread kookman via Digitalmars-d-learn
Typo corrected: static assert (isOutputRange!(typeof(stdout.lockingTextWriter), char));

LockingTextWriter not an output range?

2018-04-18 Thread kookman via Digitalmars-d-learn
The below static assert fails. Is this expected? Not the way I read the docs. static assert (isOutputRange(typeof(stdout.lockingTextWriter), char));

Re: RDTSCP from dlang

2016-08-31 Thread kookman via Digitalmars-d-learn
On Wednesday, 31 August 2016 at 08:23:57 UTC, Basile B. wrote: By the way maybe someone could post an ER in bugzilla to get RDTSCP available in iasm w/o using the byte code trick. Someone beat me to it, but see here: https://issues.dlang.org/show_bug.cgi?id=16449

Re: RDTSCP from dlang

2016-08-31 Thread kookman via Digitalmars-d-learn
On Wednesday, 31 August 2016 at 07:36:16 UTC, rikki cattermole wrote: http://dlang.org/spec/abi.html#register_conventions That link talks about for functions defined extern(C) and extern(D), and gives specific info for win32. I'm using linux x86_64, does that mean I can assume standard

Re: RDTSCP from dlang

2016-08-31 Thread kookman via Digitalmars-d-learn
On Tuesday, 30 August 2016 at 09:04:41 UTC, Basile B. wrote: ALternatively to Rikki K's solution, you can do this to mimic the rdtscp behavior: asm { cpuid; rdtsc; // store time in locals } // bench { rdtsc; // store time in locals } // compute delta explanations here: -

RDTSCP from dlang

2016-08-29 Thread kookman via Digitalmars-d-learn
I need to access the x86_64 RDTSCP assembly instruction from D. I found this for C++: http://stackoverflow.com/questions/14783782/which-inline-assembly-code-is-correct-for-rdtscp Does anyone here know how (if?) I can do this from D?