Re: How include header file?

2022-09-07 Thread Injeckt via Digitalmars-d-learn
On Wednesday, 7 September 2022 at 23:01:34 UTC, Mike Parker wrote: On Wednesday, 7 September 2022 at 20:23:03 UTC, Injeckt wrote: Convert it to D: extern(C) const(char)* inet_ntop(int af, const(void)* src, char* dst, socklen_t size); Win32 API functions need to be `extern(Windows)`.

Re: How include header file?

2022-09-07 Thread Injeckt via Digitalmars-d-learn
On Wednesday, 7 September 2022 at 22:57:53 UTC, Loara wrote: On Wednesday, 7 September 2022 at 20:23:03 UTC, Injeckt wrote: On Wednesday, 7 September 2022 at 19:38:52 UTC, H. S. Teoh wrote: On Wed, Sep 07, 2022 at 06:11:14PM +, Injeckt via Digitalmars-d-learn wrote: You need to link

Re: How include header file?

2022-09-07 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 7 September 2022 at 20:23:03 UTC, Injeckt wrote: Convert it to D: extern(C) const(char)* inet_ntop(int af, const(void)* src, char* dst, socklen_t size); Win32 API functions need to be `extern(Windows)`. You probably also need: alias socklen_t = ...;

Re: How include header file?

2022-09-07 Thread Loara via Digitalmars-d-learn
On Wednesday, 7 September 2022 at 20:23:03 UTC, Injeckt wrote: On Wednesday, 7 September 2022 at 19:38:52 UTC, H. S. Teoh wrote: On Wed, Sep 07, 2022 at 06:11:14PM +, Injeckt via Digitalmars-d-learn wrote: I need to include this Ws2tcpip.h header file to my project. How can I do this? It's

Re: How include header file?

2022-09-07 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/7/22 4:23 PM, Injeckt wrote: On Wednesday, 7 September 2022 at 19:38:52 UTC, H. S. Teoh wrote: On Wed, Sep 07, 2022 at 06:11:14PM +, Injeckt via Digitalmars-d-learn wrote: I need to include this Ws2tcpip.h header file to my project. How can I do this? It's all because I need inet_ntop

Re: How include header file?

2022-09-07 Thread Injeckt via Digitalmars-d-learn
On Wednesday, 7 September 2022 at 20:23:03 UTC, Injeckt wrote: _inet_ntop". I guess I can add my utils.c to my .d project when I compile project and I need write in this file function wrapper of inet_ntop. No, it doesn't work. Jesus I need to figure out how to add WS2tcpip.h

Re: How include header file?

2022-09-07 Thread Injeckt via Digitalmars-d-learn
On Wednesday, 7 September 2022 at 19:38:52 UTC, H. S. Teoh wrote: On Wed, Sep 07, 2022 at 06:11:14PM +, Injeckt via Digitalmars-d-learn wrote: I need to include this Ws2tcpip.h header file to my project. How can I do this? It's all because I need inet_ntop function from this header file.

Re: How include header file?

2022-09-07 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Sep 07, 2022 at 06:11:14PM +, Injeckt via Digitalmars-d-learn wrote: > I need to include this Ws2tcpip.h header file to my project. How can I > do this? It's all because I need inet_ntop function from this header > file. If that's the only function you need, you can just copy the