Re: Is it possible to make an Linux Executable Binary using a Windows Operating System? [compiling and linking]

2023-07-27 Thread Kagamin via Digitalmars-d-learn
You will also need crt1.o, crti.o, crtn.o and libc.a

Re: array index out of bound may not throw exception?

2023-07-27 Thread Kagamin via Digitalmars-d-learn
On Friday, 21 July 2023 at 23:40:44 UTC, mw wrote: Is there a way to let it report on the spot when it happens? On linux if you catch an exception and call abort, the debugger will show you where abort was called, on windows you can call DebugBreak function, the debugger will show where it

Re: AA vs __gshared

2023-07-27 Thread Kagamin via Digitalmars-d-learn
On Friday, 28 July 2023 at 03:54:53 UTC, IchorDev wrote: I was told that using `__gshared` is quite a bit faster at runtime than using `shared`, but I also don't really know anything concrete about `shared` because the spec is so incredibly vague about it. The difference between them is

Re: AA vs __gshared

2023-07-27 Thread IchorDev via Digitalmars-d-learn
On Thursday, 27 July 2023 at 21:31:02 UTC, Jonathan M Davis wrote: Now, as to what's happening in your code that's causing segfaults, the most likely culprit would be that you're accessing the AA without actually having done anything to prevent other threads from accessing it at the same

Re: Unicode in strings

2023-07-27 Thread Cecil Ward via Digitalmars-d-learn
On Thursday, 27 July 2023 at 22:35:00 UTC, Adam D Ruppe wrote: On Thursday, 27 July 2023 at 22:15:47 UTC, Cecil Ward wrote: How do I get a wstring or dstring with a code point of 0xA0 in it ? note that you don't need wstring and dstring to express all unicode strings. I realised that I was

Re: Unicode in strings

2023-07-27 Thread Adam D Ruppe via Digitalmars-d-learn
On Thursday, 27 July 2023 at 22:15:47 UTC, Cecil Ward wrote: How do I get a wstring or dstring with a code point of 0xA0 in it ? note that you don't need wstring and dstring to express all unicode strings.

Re: Unicode in strings

2023-07-27 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Jul 27, 2023 at 10:15:47PM +, Cecil Ward via Digitalmars-d-learn wrote: > How do I get a wstring or dstring with a code point of 0xA0 in it ? > That’s a type of space, is it? I keep getting a message from the LDC > compiler something like "Outside Unicode code space" in my unittests >

Re: AA vs __gshared

2023-07-27 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, July 27, 2023 9:57:51 AM MDT IchorDev via Digitalmars-d-learn wrote: > I've been getting a lot of segfaults from using associative > arrays recently. The faults happen seemingly at random, and from > pretty mundane stuff like `if(auto x = y in z)` that run very > often: > ``` >

Re: Syntax for Static Import of User Define Attributes

2023-07-27 Thread Dennis via Digitalmars-d-learn
On Thursday, 27 July 2023 at 21:19:08 UTC, Vijay Nayar wrote: Attempted Fix 2: Enclose the entire attribute name in parenthesis. ``` static import vibe.data.serialization; class ChatCompletionFunctions { @(vibe.data.serialization.name)("name") ... } ``` Try: ```D

Re: Syntax for Static Import of User Define Attributes

2023-07-27 Thread Paul Backus via Digitalmars-d-learn
On Thursday, 27 July 2023 at 21:19:08 UTC, Vijay Nayar wrote: Attempted Fix 2: Enclose the entire attribute name in parenthesis. ``` static import vibe.data.serialization; class ChatCompletionFunctions { @(vibe.data.serialization.name)("name") ... } ``` You almost had it. The correct

Re: What is a dchar ?

2023-07-27 Thread Cecil Ward via Digitalmars-d-learn
On Wednesday, 26 July 2023 at 01:56:28 UTC, Richard (Rikki) Andrew Cattermole wrote: The spec says they are unsigned, so if ldc is using sign extension, that is probably a bug. My fault, I reread the code and the sign-extension applies to something else, coincidentally right where I was

Re: Getting __COLUMN__ of source code location.

2023-07-27 Thread IchorDev via Digitalmars-d-learn
I'm not aware of any way to do that exact thing. Measuring what column a line is on would be quite subjective. How wide is a tab space? Technically, it could be any number of columns depending on the display configuration used. On Sunday, 23 July 2023 at 15:01:51 UTC, realhet wrote: Why is

Re: AA vs __gshared

2023-07-27 Thread Dennis via Digitalmars-d-learn
On Thursday, 27 July 2023 at 15:57:51 UTC, IchorDev wrote: The faults happen seemingly at random, and from pretty mundane stuff like `if(auto x = y in z)` that run very often: Are you accessing the AA from multiple threads?

AA vs __gshared

2023-07-27 Thread IchorDev via Digitalmars-d-learn
I've been getting a lot of segfaults from using associative arrays recently. The faults happen seemingly at random, and from pretty mundane stuff like `if(auto x = y in z)` that run very often: ``` Segmentation fault. #0 0x55670f4a in rt.aaA.Impl.findSlotLookup(ulong, scope

Who can give me some advice about importC?

2023-07-27 Thread Zoe via Digitalmars-d-learn
Sorry, my English is not very good. I rely entirely on the translator to translate. I used the DMD compiler on the WINDOWS platform to try IMPORT C. I tried GLFW,YOGA, added a predefined part, precompiled it into an I file with cl.exe, then compiled it with dll, and then imported it into the I