Re: Compiling to RiscV32

2023-07-11 Thread HuskyNator via Digitalmars-d-learn
On Monday, 10 July 2023 at 14:09:47 UTC, Kagamin wrote: You try to use C declarations, but they are specific to each C library, and different C libraries have different declarations, so headers can't decide which C library declarations to use. Try -mtriple=riscv32-unknown-linux It seems to be

Re: Compiling to RiscV32

2023-07-11 Thread Kagamin via Digitalmars-d-learn
Probably bug in druntime, v-functions shouldn't have `pragma(printf)`, because they don't have arguments to check.

Designated initializers to function argument

2023-07-11 Thread Ki Rill via Digitalmars-d-learn
In C I can do the following: ```C void apply(struct Appearance a) {...} // usage apply((struct Appearance) { .color = BLACK, .strokeWidth = 4 }); ``` Can I do the same in D without creating a struct variable separately? ```D void apply(Appearance a) {...} // currently accepts Appearan

Re: Designated initializers to function argument

2023-07-11 Thread Ki Rill via Digitalmars-d-learn
On Tuesday, 11 July 2023 at 15:16:54 UTC, Ki Rill wrote: ```D // or this apply(Appearance(color: BLACK, strokeWidth: 4)); // other fields are default initialized: strokeOpacity, fillOpacity, etc... ``` Ok, this works with DMD v2.103, but does not work with an older version (I had ldc2 ins

Re: Designated initializers to function argument

2023-07-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/11/23 11:22 AM, Ki Rill wrote: On Tuesday, 11 July 2023 at 15:16:54 UTC, Ki Rill wrote: ```D // or this apply(Appearance(color: BLACK, strokeWidth: 4)); // other fields are default initialized: strokeOpacity, fillOpacity, etc... ``` Ok, this works with DMD v2.103, but does not work wi

looking for recommendation: which thread safe logger library?

2023-07-11 Thread mw via Digitalmars-d-learn
Hi, Just wondering which logger library is thread safe? https://code.dlang.org/ Need to find a mature one to be used in a multi-threaded env. Thanks.

Re: looking for recommendation: which thread safe logger library?

2023-07-11 Thread mw via Digitalmars-d-learn
On Wednesday, 12 July 2023 at 01:24:41 UTC, mw wrote: Hi, Just wondering which logger library is thread safe? https://code.dlang.org/ Need to find a mature one to be used in a multi-threaded env. Oh, forget to mention: need output to logger file.

Re: looking for recommendation: which thread safe logger library?

2023-07-11 Thread mw via Digitalmars-d-learn
On Wednesday, 12 July 2023 at 01:26:25 UTC, mw wrote: On Wednesday, 12 July 2023 at 01:24:41 UTC, mw wrote: Hi, Just wondering which logger library is thread safe? https://code.dlang.org/ Need to find a mature one to be used in a multi-threaded env. Oh, forget to mention: need output to lo

Re: looking for recommendation: which thread safe logger library?

2023-07-11 Thread Danilo via Digitalmars-d-learn
On Wednesday, 12 July 2023 at 01:55:00 UTC, mw wrote: ``` import std.experimental.logger; void main() { std.experimental.logger.sharedLog.trace("msg"); } ``` See examples at https://dlang.org/phobos/std_logger.html and https://dlang.org/phobos/std_logger_filelogger.html ```d import std.st

Re: looking for recommendation: which thread safe logger library?

2023-07-11 Thread mw via Digitalmars-d-learn
On Wednesday, 12 July 2023 at 04:48:23 UTC, Danilo wrote: On Wednesday, 12 July 2023 at 01:55:00 UTC, mw wrote: ``` import std.experimental.logger; void main() { std.experimental.logger.sharedLog.trace("msg"); } ``` See examples at https://dlang.org/phobos/std_logger.html and https://dlan