Re: How to use @safe when a C library integration needed

2023-04-15 Thread Leonardo via Digitalmars-d-learn
On Friday, 14 April 2023 at 16:19:22 UTC, Paul Backus wrote: On Friday, 14 April 2023 at 14:10:41 UTC, Leonardo wrote: [...] No, there isn't. C is an unsafe language, so if you want to call C from `@safe` code, you have to do the work to make sure that each individual call is `@safe`. [...

Re: How to use @safe when a C library integration needed

2023-04-14 Thread Paul Backus via Digitalmars-d-learn
On Friday, 14 April 2023 at 14:10:41 UTC, Leonardo wrote: Thanks. But this works only to one function per time. Is there any way to do this to an imported library at all? something like `@trusted import library` No, there isn't. C is an unsafe language, so if you want to call C from `@safe` c

Re: How to use @safe when a C library integration needed

2023-04-14 Thread Leonardo via Digitalmars-d-learn
On Monday, 23 January 2023 at 16:46:48 UTC, Dom DiSc wrote: On Monday, 23 January 2023 at 16:36:21 UTC, Leonardo wrote: Hello. How to use @safe when a C library integration needed? Everything need a system function... ```d @safe fn() { // lot of safe stuff () @trusted { // in

Re: How to use @safe when a C library integration needed

2023-01-23 Thread Dom DiSc via Digitalmars-d-learn
On Monday, 23 January 2023 at 16:36:21 UTC, Leonardo wrote: Hello. How to use @safe when a C library integration needed? Everything need a system function... ```d @safe fn() { // lot of safe stuff () @trusted { // in this block[*] @system function like extern C can be called

How to use @safe when a C library integration needed

2023-01-23 Thread Leonardo via Digitalmars-d-learn
Hello. How to use @safe when a C library integration needed? Everything need a system function...