Re: [OT] #define

2017-05-23 Thread Andrew Edwards via Digitalmars-d-learn
On Tuesday, 23 May 2017 at 00:14:43 UTC, Mike Parker wrote: On Monday, 22 May 2017 at 18:44:10 UTC, Andrew Edwards wrote: There isn't any Windows specific section. Every function pointer in the library is decorated in one of the following two forms void (APIENTRY *NAME)(PARAMS) or

Re: [OT] #define

2017-05-22 Thread Andrew Edwards via Digitalmars-d-learn
On Monday, 22 May 2017 at 18:48:44 UTC, Adam D. Ruppe wrote: On Monday, 22 May 2017 at 18:44:10 UTC, Andrew Edwards wrote: Both happen to be the exact same. So does mean that for every function pointer in the file, I need to duplicate as such? You can use `extern(System)` or that case in D. I

Re: [OT] #define

2017-05-22 Thread Mike Parker via Digitalmars-d-learn
On Monday, 22 May 2017 at 18:44:10 UTC, Andrew Edwards wrote: There isn't any Windows specific section. Every function pointer in the library is decorated in one of the following two forms void (APIENTRY *NAME)(PARAMS) or void (APIENTRYP NAME)(PARAMS) Sorry, I worded that poorly.

Re: [OT] #define

2017-05-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 22 May 2017 at 18:44:10 UTC, Andrew Edwards wrote: Both happen to be the exact same. So does mean that for every function pointer in the file, I need to duplicate as such? You can use `extern(System)` or that case in D. It will be extern(Windows) on win an extern(C) elsewhere - just

Re: [OT] #define

2017-05-22 Thread Andrew Edwards via Digitalmars-d-learn
On Monday, 22 May 2017 at 16:56:10 UTC, Mike Parker wrote: On Monday, 22 May 2017 at 16:37:51 UTC, Andrew Edwards wrote: Specific context at the following links: https://github.com/glfw/glfw/blob/66ff4aae89572419bb130c5613798e34d7521fc7/deps/glad/glad.h#L24-L48 Generally, any functions in

Re: [OT] #define

2017-05-22 Thread Mike Parker via Digitalmars-d-learn
On Monday, 22 May 2017 at 16:37:51 UTC, Andrew Edwards wrote: Specific context at the following links: https://github.com/glfw/glfw/blob/66ff4aae89572419bb130c5613798e34d7521fc7/deps/glad/glad.h#L24-L48 APIENTRY is typically defined in Windows headers to set the stdcall calling convention

Re: [OT] #define

2017-05-22 Thread Andrew Edwards via Digitalmars-d-learn
On Monday, 22 May 2017 at 13:52:35 UTC, Dukc wrote: On Monday, 22 May 2017 at 13:11:15 UTC, Andrew Edwards wrote: Sorry if this is a stupid question but it eludes me. In the following, what is THING? What is SOME_THING? [...] I assume you know that the above part is c/c++ preprocessor, which

Re: [OT] #define

2017-05-22 Thread Andrew Edwards via Digitalmars-d-learn
On Monday, 22 May 2017 at 13:15:31 UTC, Adam D. Ruppe wrote: On Monday, 22 May 2017 at 13:11:15 UTC, Andrew Edwards wrote: #ifndef THING #define THING #endif This kind of thing is most commonly used in include guards https://en.wikipedia.org/wiki/Include_guard#Use_of_.23include_gu

Re: [OT] #define

2017-05-22 Thread Andrew Edwards via Digitalmars-d-learn
On Monday, 22 May 2017 at 13:18:51 UTC, Eugene Wissner wrote: On Monday, 22 May 2017 at 13:11:15 UTC, Andrew Edwards wrote: Sorry if this is a stupid question but it eludes me. In the following, what is THING? What is SOME_THING? #ifndef THING #define THING #endif #ifndef SOME

Re: [OT] #define

2017-05-22 Thread biocyberman via Digitalmars-d-learn
On Monday, 22 May 2017 at 13:11:15 UTC, Andrew Edwards wrote: Sorry if this is a stupid question but it eludes me. In the following, what is THING? What is SOME_THING? #ifndef THING #define THING #endif #ifndef SOME_THING #define SOME_THING THING * #endif Is this equiv

Re: [OT] #define

2017-05-22 Thread Dukc via Digitalmars-d-learn
On Monday, 22 May 2017 at 13:11:15 UTC, Andrew Edwards wrote: Sorry if this is a stupid question but it eludes me. In the following, what is THING? What is SOME_THING? #ifndef THING #define THING #endif #ifndef SOME_THING #define SOME_THING THING * #endif Is this equiv

Re: [OT] #define

2017-05-22 Thread Eugene Wissner via Digitalmars-d-learn
On Monday, 22 May 2017 at 13:11:15 UTC, Andrew Edwards wrote: Sorry if this is a stupid question but it eludes me. In the following, what is THING? What is SOME_THING? #ifndef THING #define THING #endif #ifndef SOME_THING #define SOME_THING THING * #endif Is this equiv

Re: [OT] #define

2017-05-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 22 May 2017 at 13:11:15 UTC, Andrew Edwards wrote: #ifndef THING #define THING #endif This kind of thing is most commonly used in include guards https://en.wikipedia.org/wiki/Include_guard#Use_of_.23include_guards You can usually just strip that out in D, since the modu

[OT] #define

2017-05-22 Thread Andrew Edwards via Digitalmars-d-learn
Sorry if this is a stupid question but it eludes me. In the following, what is THING? What is SOME_THING? #ifndef THING #define THING #endif #ifndef SOME_THING #define SOME_THING THING * #endif Is this equivalent to: alias thing = void; alias someThing = thing*