Unable to pass a D function member to a C callback

2019-11-02 Thread Luh via Digitalmars-d-learn
Hello, When trying to pass a D function to the C callback, the compiler says: 'Error: cannot implicitly convert expression &this.onProcessCb of type extern (C) bool delegate(const(short*) a, ulong b, void* c) to extern (C) bool function(const(short*), ulong, void*' because my function is m

Re: Unable to pass a D function member to a C callback

2019-11-02 Thread Luh via Digitalmars-d-learn
On Saturday, 2 November 2019 at 18:31:28 UTC, Stefan Koch wrote: On Saturday, 2 November 2019 at 17:49:09 UTC, Luh wrote: Hello, When trying to pass a D function to the C callback, the compiler says: 'Error: cannot implicitly convert expression &this.onProcessCb of type extern (C) bool dele

Re: Unable to pass a D function member to a C callback

2019-11-02 Thread Luh via Digitalmars-d-learn
On Saturday, 2 November 2019 at 19:55:58 UTC, Dennis wrote: On Saturday, 2 November 2019 at 19:42:54 UTC, Luh wrote: So I think I just can't. :( Is that `void* c` in the callback a context pointer by any chance? That's a common thing in C callbacks precisely for purposes like this. You can c

Linker anomalies

2019-11-07 Thread Luh via Digitalmars-d-learn
Hey there, I figured out some strange behavior ; #1 It seems that the linker doesn't check for the function declared twice first. Instead, it says: "Error: class app.Child use of app.Parent.foo() is hidden by Child; use alias foo = Parent.foo; to introduce base class overload set" but whe

Re: Linker anomalies

2019-11-07 Thread Luh via Digitalmars-d-learn
On Thursday, 7 November 2019 at 18:45:21 UTC, Ali Çehreli wrote: On 11/07/2019 04:14 AM, Luh wrote: It's not the linker but the "compiler" that is concerned about these things. [...] Oops :o That's an important warning where the programmer can get surprising results depending on whether th