Re: Is it possible to suppress standard lib and dlang symbols in dylib (macos)

2021-03-13 Thread David Skluzacek via Digitalmars-d-learn
On Thursday, 11 March 2021 at 22:10:04 UTC, David wrote: I wasn't aware that object files could be manipulated like the strip manual page - thx for the heads up. With the caveats that the linked post is almost 14 years old, I can't try this command myself, and the ldc solution is probably pre

Re: Is it possible to suppress standard lib and dlang symbols in dylib (macos)

2021-03-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 13 March 2021 at 23:41:28 UTC, David wrote: So Excel complains that it can't load my library - presumably because libphobos2 and libdruntime are not in the sandbox.ly You *might* be able to compile with --link-defaultlib-shared=false to use the static phobos+druntime... but with

Re: Is it possible to suppress standard lib and dlang symbols in dylib (macos)

2021-03-13 Thread David via Digitalmars-d-learn
On Friday, 12 March 2021 at 00:12:37 UTC, Guillaume Piolat wrote: Create a exports.lst file with: _addDD_D as the only line there. Build with: "lflags-osx-ldc": [ "-exported_symbols_list", "exports.lst", "-dead_strip" ], Thx that's really helpful. I've hit a snag with LDC. After serveral

Re: Cannot pass const(T) to function with ref const(T)

2021-03-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/13/21 5:24 PM, Andrey wrote: Mistake. It says about simple argument: cannot pass rvalue argument `x` of type `Word!(wstring, wstring)` to parameter `ref const(Word!(wstring, wstring)) base` Function: void _setPastBases(const ref Data item, const ref UsualWord base) Yeah, D does not

Re: Cannot pass const(T) to function with ref const(T)

2021-03-13 Thread Andrey via Digitalmars-d-learn
Mistake. It says about simple argument: cannot pass rvalue argument `x` of type `Word!(wstring, wstring)` to parameter `ref const(Word!(wstring, wstring)) base` Function: void _setPastBases(const ref Data item, const ref UsualWord base)

Cannot pass const(T) to function with ref const(T)

2021-03-13 Thread Andrey via Digitalmars-d-learn
Hello, Dmd gives an error: Error: function `_setPastBases(ref const(Data) item, ref const(Word!(wstring, wstring)) base)` is not callable using argument types `(const(Data), Word!(wstring, wstring)) where Data and Word - structs. What happens and how to pass arguments? Ldc compiles without s

Re: Storing interfaces as void[]

2021-03-13 Thread tsbockman via Digitalmars-d-learn
On Saturday, 13 March 2021 at 15:44:53 UTC, frame wrote: Maybe I don't get this right but why you don't just use the void[] as it is? void[] mem = [i]; //... return (cast(T[]) mem)[0]; This is how I exchange variable data between DLLs. That works, and is more elegant than the OP's solution.

Re: Endianness - How to test code for portability

2021-03-13 Thread Patrick Schluter via Digitalmars-d-learn
On Friday, 12 March 2021 at 05:53:40 UTC, Preetpal wrote: In the portability section of the language spec, they talk about endianness (https://dlang.org/spec/portability.html#endianness) which refers "to the order in which multibyte types are stored." IMO if you wanted to actually be sure you

Re: Storing interfaces as void[]

2021-03-13 Thread frame via Digitalmars-d-learn
On Friday, 12 March 2021 at 17:37:43 UTC, David Zhang wrote: I want to store interfaces as untyped void[], then cast them back to the interface at a later time. However, it appears to produce garbage values on get(). Is this even possible, and if so, what is happening here? The alternative w

Re: Compiler module import graph

2021-03-13 Thread frame via Digitalmars-d-learn
On Saturday, 13 March 2021 at 14:55:20 UTC, frame wrote: On Saturday, 13 March 2021 at 14:30:52 UTC, ag0aep6g wrote: On 13.03.21 15:20, frame wrote: Is there a tool to view module import graph? The compiler verbose output shows that the module is imported/parsed but not why. I wan't to avoid

Re: Compiler module import graph

2021-03-13 Thread frame via Digitalmars-d-learn
On Saturday, 13 March 2021 at 14:41:48 UTC, Eugene Wissner wrote: On Saturday, 13 March 2021 at 14:20:01 UTC, frame wrote: Is there a tool to view module import graph? The compiler verbose output shows that the module is imported/parsed but not why. I wan't to avoid unnecessary imports to spe

Re: Compiler module import graph

2021-03-13 Thread frame via Digitalmars-d-learn
On Saturday, 13 March 2021 at 14:30:52 UTC, ag0aep6g wrote: On 13.03.21 15:20, frame wrote: Is there a tool to view module import graph? The compiler verbose output shows that the module is imported/parsed but not why. I wan't to avoid unnecessary imports to speed up compile times or avoid is

Re: Compiler module import graph

2021-03-13 Thread Eugene Wissner via Digitalmars-d-learn
On Saturday, 13 March 2021 at 14:20:01 UTC, frame wrote: Is there a tool to view module import graph? The compiler verbose output shows that the module is imported/parsed but not why. I wan't to avoid unnecessary imports to speed up compile times or avoid issues if the module contents are not

Re: Compiler module import graph

2021-03-13 Thread ag0aep6g via Digitalmars-d-learn
On 13.03.21 15:20, frame wrote: Is there a tool to view module import graph? The compiler verbose output shows that the module is imported/parsed but not why. I wan't to avoid unnecessary imports to speed up compile times or avoid issues if the module contents are not fully compatible with the

Compiler module import graph

2021-03-13 Thread frame via Digitalmars-d-learn
Is there a tool to view module import graph? The compiler verbose output shows that the module is imported/parsed but not why. I wan't to avoid unnecessary imports to speed up compile times or avoid issues if the module contents are not fully compatible with the current compile target being in

Re: Dlang spec

2021-03-13 Thread Imperatorn via Digitalmars-d-learn
On Saturday, 13 March 2021 at 11:48:47 UTC, Bastiaan Veelo wrote: On Thursday, 11 March 2021 at 19:38:01 UTC, Imperatorn wrote: [...] The spec is written in ddoc format, and I thought that ddoc was able to output in PDF (at least at one point). It didn’t look very good and I’m not sure if th

Re: Dlang spec

2021-03-13 Thread Bastiaan Veelo via Digitalmars-d-learn
On Thursday, 11 March 2021 at 19:38:01 UTC, Imperatorn wrote: I created some PDFs (on request) of the dlang spec mobi-file and uploaded them here: https://gofile.io/d/ijctZt Different converters were used, hence multiple files. Maybe someone can upload a good version on dlang.org and link to