Re: DMD: can't get extern __gshared to work right (vs. LDC)

2019-02-07 Thread Kagamin via Digitalmars-d-learn
On Friday, 8 February 2019 at 05:28:30 UTC, DanielG wrote: Is this correct behavior? It's correct for Windows: address of imported data is not known at link time and must use dynamic linkage. AFAIK, export attribute doesn't do much on posix platforms.

Re: Tricky DMD bug, but I have no idea how to report

2019-02-07 Thread Vladimir Panteleev via Digitalmars-d-learn
On Thursday, 7 February 2019 at 22:16:19 UTC, JN wrote: Does it also work for dub projects? It will work if you can put all the relevant D code in one directory, which is harder for Dub, as it likes to pull dependencies from all over the place. When "dub dustmite" is insufficient (as in this

Re: Is it possible to modify shared struct array in a function.

2019-02-07 Thread Jerry via Digitalmars-d-learn
On Friday, 8 February 2019 at 04:51:08 UTC, Sudhi wrote: On Friday, 8 February 2019 at 04:30:23 UTC, Arun Chandrasekaran wrote: On Friday, 8 February 2019 at 04:13:39 UTC, Sudhi wrote: [...] Works fine for me with DMD64 D Compiler v2.083.1. https://run.dlang.io/is/RRM8GU My example code w

Re: Is it possible to modify shared struct array in a function.

2019-02-07 Thread Arun Chandrasekaran via Digitalmars-d-learn
On Friday, 8 February 2019 at 04:51:08 UTC, Sudhi wrote: On Friday, 8 February 2019 at 04:30:23 UTC, Arun Chandrasekaran wrote: [...] My example code was wrong. Below is the right one. struct Company { string name; string location; } struct Racks { int number; int location;

Re: DMD: can't get extern __gshared to work right (vs. LDC)

2019-02-07 Thread DanielG via Digitalmars-d-learn
Follow-up: The problem on DMD macOS is the "export" keyword. It ended up in my code during a similar-ish problem last year, when I was having trouble linking against DLL global variables on Windows. If I remove the "export" keyword in the D interface, it will work on macOS but break on Windo

Re: Is it possible to modify shared struct array in a function.

2019-02-07 Thread Sudhi via Digitalmars-d-learn
On Friday, 8 February 2019 at 04:30:23 UTC, Arun Chandrasekaran wrote: On Friday, 8 February 2019 at 04:13:39 UTC, Sudhi wrote: I have a situation, where i want to modify a shared variable in a function. Something like below struct Company { string name; string location; } struct Rack

Re: Is it possible to modify shared struct array in a function.

2019-02-07 Thread Arun Chandrasekaran via Digitalmars-d-learn
On Friday, 8 February 2019 at 04:13:39 UTC, Sudhi wrote: I have a situation, where i want to modify a shared variable in a function. Something like below struct Company { string name; string location; } struct Racks { int number; int location; } struct Metadata { string na

Is it possible to modify shared struct array in a function.

2019-02-07 Thread Sudhi via Digitalmars-d-learn
I have a situation, where i want to modify a shared variable in a function. Something like below struct Company { string name; string location; } struct Racks { int number; int location; } struct Metadata { string name; Company[] companies; Racks[] racks; } struct

Re: Tricky DMD bug, but I have no idea how to report

2019-02-07 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Feb 07, 2019 at 10:16:19PM +, JN via Digitalmars-d-learn wrote: [...] > Anyway, I managed to reduce the source code greatly manually: > > https://github.com/helikopterodaktyl/repro_d_release/ > > unfortunately I can't get rid of the dlib dependency. When built with > debug, test outpu

Re: Tricky DMD bug, but I have no idea how to report

2019-02-07 Thread JN via Digitalmars-d-learn
On Thursday, 7 February 2019 at 03:50:32 UTC, Vladimir Panteleev wrote: On Monday, 17 December 2018 at 21:59:59 UTC, JN wrote: while working on my game engine project, I encountered a DMD codegen bug. It occurs only when compiling in release mode, debug works. Old thread, but FWIW, such bugs

Re: std.container.rbtree as Interval Tree?

2019-02-07 Thread Eduard Staniloiu via Digitalmars-d-learn
On Tuesday, 5 February 2019 at 19:12:43 UTC, James Blachly wrote: However, even when allowing (pseudo)duplicates, this means the distinct intervals with same start but different end coordinates are not deterministically placed/sorted within the tree, because they are not sortable with the si

Re: Submenu Not Responding Until Second Click

2019-02-07 Thread Antonio Corbi via Digitalmars-d-learn
On Wednesday, 6 February 2019 at 13:13:44 UTC, Ron Tarrant wrote: On Tuesday, 5 February 2019 at 09:41:06 UTC, Antonio Corbi wrote: It could be so, I'm not using gnome so I can't say. By the way, I'm using gtk3 3.24.5. Yeah, I updated from 3.22 to 3.24, but it made no difference on Windows

Re: variant .init value

2019-02-07 Thread bauss via Digitalmars-d-learn
On Thursday, 7 February 2019 at 07:33:50 UTC, Norm wrote: Hi, I'm trying to use Variant in a struct and want a default init value like so: --- struct S { Variant v = Variant(10); } void main() {auto s = S();} but when I try to build this I get the following error: dmd2/linux/bin64/../../s

Re: variant .init value

2019-02-07 Thread Norm via Digitalmars-d-learn
On Thursday, 7 February 2019 at 07:44:17 UTC, Alex wrote: On Thursday, 7 February 2019 at 07:33:50 UTC, Norm wrote: [...] Hmm... found something similar from 2014... https://issues.dlang.org/show_bug.cgi?id=11864 Thanks, I've added a comment to that bug report. Cheers, Norm