Re: Running GtkD programs on macOS

2022-11-28 Thread Joel via Digitalmars-d-learn
On Saturday, 30 November 2019 at 00:17:51 UTC, Mike Wey wrote: On 29-11-2019 04:40, Joel wrote: Oh, I used 'brew install gtk+3', and the test program worked, but (see below) I don't know about all that installing - is that alright? They all look like GTK+ dependencies so that would be

Re: Windows specific: MS C++ versus D thread local variables

2022-11-28 Thread Gregor Mückl via Digitalmars-d-learn
On Monday, 28 November 2022 at 18:51:37 UTC, NonNull wrote: I tested this with D threads and it works for my test program. I might guess that this is so in general, because such a library has to successfully work with arbitrary MS VC++ and that "interop" is defined by MS to work. I worked on

Re: pragma(linkerDirective,_) removes double quotes, dmd ignores LIB

2022-11-28 Thread zjh via Digitalmars-d-learn
On Tuesday, 29 November 2022 at 01:08:03 UTC, zjh wrote: ... ```d [Environment64] LIB=%@P%\..\lib;%lj%\dku; ```

Re: pragma(linkerDirective,_) removes double quotes, dmd ignores LIB

2022-11-28 Thread zjh via Digitalmars-d-learn
On Monday, 28 November 2022 at 16:21:20 UTC, NonNull wrote: Any idea what may be going on with dmd? use `sc.ini` like this: ```d [Version] version=7.51 Build 020 [Environment] lj=E:\path DFLAGS="-I%@P%\..\..\src\phobos" "-I%@P%\..\..\src\druntime\import" "-I%lj%\dimport" LIB="%@P%\..\lib"

Re: __traits isCopyable vs isPOD

2022-11-28 Thread Paul Backus via Digitalmars-d-learn
On Monday, 28 November 2022 at 23:11:37 UTC, Per Nordlöw wrote: the real question I had is whether one should use `isPOD` instead of `isCopyable` in cases ```d static if (__traits(isCopyable, Element)) insertAt(element, index); else

Re: How to move from Unique(someClass) to Unique(someInterface)?

2022-11-28 Thread Gregor Mückl via Digitalmars-d-learn
On Monday, 28 November 2022 at 02:40:28 UTC, Tejas wrote: On Sunday, 27 November 2022 at 17:06:31 UTC, vushu wrote: On Saturday, 16 May 2020 at 17:45:56 UTC, Konstantin wrote: [...] I'm actually also very curious about this issue, since I come from c++ where this is possible, and it is a

Re: __traits isCopyable vs isPOD

2022-11-28 Thread Per Nordlöw via Digitalmars-d-learn
On Monday, 28 November 2022 at 22:59:13 UTC, Paul Backus wrote: Lots of types. For example, types with copy constructors or destructors are not POD but may still be copyable. This should be obvious if you read the definition of POD linked from the language spec:

Re: __traits isCopyable vs isPOD

2022-11-28 Thread Paul Backus via Digitalmars-d-learn
On Monday, 28 November 2022 at 20:58:43 UTC, Per Nordlöw wrote: For which types `T` does ```d __traits(isCopyable, T) ``` differ from ```d __traits(isPOD, T) ``` ? Lots of types. For example, types with copy constructors or destructors are not POD but may still be copyable. This should

Re: __traits isCopyable vs isPOD

2022-11-28 Thread Per Nordlöw via Digitalmars-d-learn
On Monday, 28 November 2022 at 20:58:43 UTC, Per Nordlöw wrote: For which types `T` does ```d __traits(isCopyable, T) ``` differ from ```d __traits(isPOD, T) ``` ? I'm asking because I have code like ```d static if (__traits(isCopyable, Element))

Re: Windows specific: MS C++ versus D thread local variables

2022-11-28 Thread NonNull via Digitalmars-d-learn
On Saturday, 26 November 2022 at 23:36:13 UTC, NonNull wrote: In the CLR module I have a static variable that can contain a reference to a .NET object. I need that variable to be thread local. I achieved this by prefixing its declaration with [System::ThreadStaticAttribute]. But this is thread

Re: pragma(linkerDirective,_) removes double quotes, dmd ignores LIB

2022-11-28 Thread NonNull via Digitalmars-d-learn
On Sunday, 27 November 2022 at 17:26:37 UTC, NonNull wrote: I worked around this by setting a LIB environment variable containing the extra path I needed, so I didn't need the pragma. But this only worked for ldc2; dmd still complained it cannot find the necessary, ignoring the LIB environment

Re: pragma(linkerDirective,_) removes double quotes, dmd ignores LIB

2022-11-28 Thread NonNull via Digitalmars-d-learn
On Monday, 28 November 2022 at 14:41:01 UTC, Adam D Ruppe wrote: This is the Microsoft doc page for the feature the pragma uses: https://learn.microsoft.com/en-us/cpp/preprocessor/comment-c-cpp?source=recommendations=msvc-170#linker It looks like they actually removed some options in the

Re: pragma(linkerDirective,_) removes double quotes, dmd ignores LIB

2022-11-28 Thread Adam D Ruppe via Digitalmars-d-learn
On Monday, 28 November 2022 at 14:19:46 UTC, NonNull wrote: double quotes whatsoever into the linker command line via pragma(linkerDirective,_). linkerDirective doesn't add things to the linker command line at all. https://dlang.org/spec/pragma.html#linkerDirective "Implementation Defined:

Re: pragma(linkerDirective,_) removes double quotes, dmd ignores LIB

2022-11-28 Thread NonNull via Digitalmars-d-learn
On Sunday, 27 November 2022 at 17:37:50 UTC, kinke wrote: For LDC, you shouldn't need any double quotes, the compiler quotes the linker flag if it contains spaces. In fact I cannot find any way (multiple double quotes, escaped double quotes, different combinations of these) to get any double