Re: Wrong vtable for COM interfaces that don't inherit IUnknown

2019-07-15 Thread evilrat via Digitalmars-d-learn
On Monday, 15 July 2019 at 22:01:25 UTC, KytoDragon wrote: I am currently trying to write a XAudio2 backend and have come across the problem, that some of the interfaces for XAudio2's COM objects seem to be missing the first entry in their vtable. After reading the iterface article in the spec

Re: Wrong vtable for COM interfaces that don't inherit IUnknown

2019-07-15 Thread Nicholas Wilson via Digitalmars-d-learn
On Monday, 15 July 2019 at 22:01:25 UTC, KytoDragon wrote: I am currently trying to write a XAudio2 backend and have come across the problem, that some of the interfaces for XAudio2's COM objects seem to be missing the first entry in their vtable. After reading the iterface article in the spec

Wrong vtable for COM interfaces that don't inherit IUnknown

2019-07-15 Thread KytoDragon via Digitalmars-d-learn
I am currently trying to write a XAudio2 backend and have come across the problem, that some of the interfaces for XAudio2's COM objects seem to be missing the first entry in their vtable. After reading the iterface article in the spec (https://dlang.org/spec/interface.html#com-interfaces) it s

Re: OPTLINK : Warning 9: Unknown Option : OUT

2019-07-15 Thread Seb via Digitalmars-d-learn
On Monday, 15 July 2019 at 11:56:38 UTC, Vladimir Panteleev wrote: On Monday, 15 July 2019 at 11:48:13 UTC, Anonymouse wrote: dub run digger -- build "stable + druntime#2675" sc.ini and dub output at: https://pastebin.com/jPnh4yEA By default Digger builds D for 32-bit only. However, it look

Re: Manipulating alias sequences

2019-07-15 Thread Ben Ogles via Digitalmars-d-learn
On Monday, 15 July 2019 at 14:50:20 UTC, Paul Backus wrote: Use a run-time Tuple instead of an AliasSeq: import std.typecons; auto args = tuple(0, 0); static foreach (idx, val; args) { static if (user_defined_function_exists_for_arg!idx) { args[idx] = user_defined_function(); } e

Re: Manipulating alias sequences

2019-07-15 Thread Paul Backus via Digitalmars-d-learn
On Monday, 15 July 2019 at 13:40:29 UTC, Ben Ogles wrote: Now I want to extend it so that a caller can specify the values of only some of the parameters. I tried using a static foreach instead of the staticMap function. But I can't modify AliasSeq values. alias args = AliasSeq!(0, 0); static

Re: Manipulating alias sequences

2019-07-15 Thread Ben Ogles via Digitalmars-d-learn
On Monday, 15 July 2019 at 14:15:41 UTC, Stefan Koch wrote: On Monday, 15 July 2019 at 13:40:29 UTC, Ben Ogles wrote: I have written a simple function that can call another function over integral types with random arguments: [...] You cannot. meta-programming and compile-time evaluation are

Re: arsd terminal with ConsoleOutputType.cellular

2019-07-15 Thread Jani Hur via Digitalmars-d-learn
On Saturday, 13 July 2019 at 14:08:26 UTC, Jani Hur wrote: Thanks for the answers Adam - I can now proceed ! I wrote two simple examples for D dummies (like me and myself) to demonstrate arsd.terminal features I'm planning to use in my "real" console "application". The examples are available

Re: Manipulating alias sequences

2019-07-15 Thread Stefan Koch via Digitalmars-d-learn
On Monday, 15 July 2019 at 13:40:29 UTC, Ben Ogles wrote: I have written a simple function that can call another function over integral types with random arguments: [...] You cannot. meta-programming and compile-time evaluation are supposed to be deterministic, and hence cannot take random

Manipulating alias sequences

2019-07-15 Thread Ben Ogles via Digitalmars-d-learn
I have written a simple function that can call another function over integral types with random arguments: auto rnd = Random(42); auto rand_integral(T)() { return uniform(T.min, T.max, rnd); } auto call_with_rand(alias fun)() { fun(staticMap!(get_rand_integral, Parameters!fun)); } Now I w

Re: OPTLINK : Warning 9: Unknown Option : OUT

2019-07-15 Thread Boris Carvajal via Digitalmars-d-learn
On Monday, 15 July 2019 at 11:48:13 UTC, Anonymouse wrote: I built it with: dub fetch digger dub run digger -- build "stable + druntime#2675" I have not touched any digger.ini. The only one I can find is digger.ini.sample. sc.ini and dub output at: https://pastebin.com/jPnh4yEA dub test

Re: OPTLINK : Warning 9: Unknown Option : OUT

2019-07-15 Thread Vladimir Panteleev via Digitalmars-d-learn
On Monday, 15 July 2019 at 11:48:13 UTC, Anonymouse wrote: dub run digger -- build "stable + druntime#2675" sc.ini and dub output at: https://pastebin.com/jPnh4yEA By default Digger builds D for 32-bit only. However, it looks like Dub is trying to build your code targeting the 64-bit model,

Re: OPTLINK : Warning 9: Unknown Option : OUT

2019-07-15 Thread Anonymouse via Digitalmars-d-learn
On Monday, 15 July 2019 at 11:12:41 UTC, Vladimir Panteleev wrote: On Monday, 15 July 2019 at 10:27:49 UTC, Anonymouse wrote: OPTLINK : Warning 9: Unknown Option : OUT It looks like it's trying to use MS link command-line syntax with DM OPTLINK. I'm not sure why that would happen, as Digger

Re: OPTLINK : Warning 9: Unknown Option : OUT

2019-07-15 Thread Vladimir Panteleev via Digitalmars-d-learn
On Monday, 15 July 2019 at 10:27:49 UTC, Anonymouse wrote: OPTLINK : Warning 9: Unknown Option : OUT It looks like it's trying to use MS link command-line syntax with DM OPTLINK. I'm not sure why that would happen, as Digger creates a complete sc.ini file containing full paths to all releva

OPTLINK : Warning 9: Unknown Option : OUT

2019-07-15 Thread Anonymouse via Digitalmars-d-learn
I wanted to try out druntime + a specific pull request with digger on Windows, and dmd and everything builds, except my program itself fails to link when compiled with it. $ dub test --compiler=C:/cygwin/home/zorael/work/result/bin/dmd.exe [...] Linking... OPTLINK (R) for Win32 Release 8.00.

Re: Windows segfault, need brief help

2019-07-15 Thread Anonymouse via Digitalmars-d-learn
On Sunday, 14 July 2019 at 08:49:43 UTC, Boris Carvajal wrote: On Saturday, 13 July 2019 at 16:39:51 UTC, Anonymouse wrote: Thank you! Filed as https://issues.dlang.org/show_bug.cgi?id=20048. https://github.com/dlang/druntime/pull/2675 Excellent, thanks! I got OPTLINK errors while trying

Re: generating switch case from compile time sequence of functions

2019-07-15 Thread Sjoerd Nijboer via Digitalmars-d-learn
On Sunday, 14 July 2019 at 19:59:36 UTC, Adam D. Ruppe wrote: but I think even attempting this is overcomplicating. static foreach (name; FunctionNames) { name ~ " : " ~ name ~ "(); break;"; } I eventually went with `switch (mixin(index)) { static fore