Re: Purpose of template DECLARE_HANDLE in druntime

2019-02-26 Thread Andre Pany via Digitalmars-d-learn
On Friday, 1 February 2019 at 08:12:23 UTC, Andre Pany wrote: On Friday, 1 February 2019 at 07:35:34 UTC, Kagamin wrote: It's a strong typed handle, in C it's declared as #ifdef STRICT typedef void *HANDLE; #if 0 && (_MSC_VER > 1000) #define DECLARE_HANDLE(name) struct name##__; typedef struct

Re: Purpose of template DECLARE_HANDLE in druntime

2019-02-01 Thread Andre Pany via Digitalmars-d-learn
On Friday, 1 February 2019 at 07:35:34 UTC, Kagamin wrote: It's a strong typed handle, in C it's declared as #ifdef STRICT typedef void *HANDLE; #if 0 && (_MSC_VER > 1000) #define DECLARE_HANDLE(name) struct name##__; typedef struct name##__ *name #else #define DECLARE_HANDLE(name) struct

Re: Purpose of template DECLARE_HANDLE in druntime

2019-01-31 Thread Kagamin via Digitalmars-d-learn
It's a strong typed handle, in C it's declared as #ifdef STRICT typedef void *HANDLE; #if 0 && (_MSC_VER > 1000) #define DECLARE_HANDLE(name) struct name##__; typedef struct name##__ *name #else #define DECLARE_HANDLE(name) struct name##__{int unused;}; typedef struct name##__ *name #endif

Re: Purpose of template DECLARE_HANDLE in druntime

2019-01-31 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 31 January 2019 at 20:51:37 UTC, Andre Pany wrote: I noticed in druntime this template is used often: package template DECLARE_HANDLE(string name, base = HANDLE) { mixin ("alias " ~ base.stringof ~ " " ~ name ~ ";"); If my memory is correct, it is actually for old D

Re: Purpose of template DECLARE_HANDLE in druntime

2019-01-31 Thread Seb via Digitalmars-d-learn
On Thursday, 31 January 2019 at 20:51:37 UTC, Andre Pany wrote: Hi, I noticed in druntime this template is used often: package template DECLARE_HANDLE(string name, base = HANDLE) { mixin ("alias " ~ base.stringof ~ " " ~ name ~ ";"); The disadvantage is, IDEs like IntelliJ are not able to

Re: Purpose of template DECLARE_HANDLE in druntime

2019-01-31 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/31/19 3:51 PM, Andre Pany wrote: Hi, I noticed in druntime this template is used often: package template DECLARE_HANDLE(string name, base = HANDLE) {     mixin ("alias " ~ base.stringof ~ " " ~ name ~ ";"); The disadvantage is, IDEs like IntelliJ are not able to find the symbols using