Re: Win32 DLLs in D

2020-06-05 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 5 June 2020 at 18:00:40 UTC, Poyeyo wrote: Hello everyone. I want to create a windows plugin.dll that could be called from rFactor, and I want to try D first, instead of going directly to C++ as the rFactor example. I am trying to wrap my head around this:

Re: What is the equivalent of -version=Flag for conditional compilation in the ldc2 compiler?

2020-06-05 Thread Johan via Digitalmars-d-learn
On Friday, 5 June 2020 at 22:36:23 UTC, data pulverizer wrote: Hi, I was switching from dmd to ldc2 and would like to know the equivalent command line for conditional compilation -version=Flag I was using in dmd. I checked the ldc2 --help but didn't see anything relevant. Version there

Re: What is the equivalent of -version=Flag for conditional compilation in the ldc2 compiler?

2020-06-05 Thread data pulverizer via Digitalmars-d-learn
On Friday, 5 June 2020 at 22:39:23 UTC, Steven Schveighoffer wrote: It's in there, I had to do grep to find it: --d-version= - Compile in version code >= or identified by -Steve Thanks, I tried that but didn't realise I still had the old version flag in the command line

Re: What is the equivalent of -version=Flag for conditional compilation in the ldc2 compiler?

2020-06-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/5/20 6:36 PM, data pulverizer wrote: Hi, I was switching from dmd to ldc2 and would like to know the equivalent command line for conditional compilation -version=Flag I was using in dmd. I checked the ldc2 --help but didn't see anything relevant. Version there refers to compiler version

What is the equivalent of -version=Flag for conditional compilation in the ldc2 compiler?

2020-06-05 Thread data pulverizer via Digitalmars-d-learn
Hi, I was switching from dmd to ldc2 and would like to know the equivalent command line for conditional compilation -version=Flag I was using in dmd. I checked the ldc2 --help but didn't see anything relevant. Version there refers to compiler version or some other unrelated things. Thanks

Re: Win32 DLLs in D

2020-06-05 Thread Andre Pany via Digitalmars-d-learn
On Friday, 5 June 2020 at 18:00:40 UTC, Poyeyo wrote: Hello everyone. I want to create a windows plugin.dll that could be called from rFactor, and I want to try D first, instead of going directly to C++ as the rFactor example. I am trying to wrap my head around this:

Re: App hangs, GC.collect() fixet it. Why?

2020-06-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/5/20 1:57 PM, Bastiaan Veelo wrote: I've been tracking down a hang in our pilot app. Using writeln, it appears to hang at newing a slice. After many hours of trying things, I discovered that program flow would continue past that point when I inserted a call to `GC.collect()` just before.

Re: Control flushing to stdout... core.osthread.Thread + arsd.terminal

2020-06-05 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 5 June 2020 at 20:11:16 UTC, aberba wrote: Didn't come to mind to lookup from terminal docs. Thought it was a Dlang/OS problem. Yeah, the OS by itself rarely buffers output like this, but both the C library (on which std.stdio is built) and my Terminal object do (they do

Re: Control flushing to stdout... core.osthread.Thread + arsd.terminal

2020-06-05 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 5 June 2020 at 20:05:28 UTC, aberba wrote: Why was the initial decision to handle buffering that way in terminal? More buffering = more speed, it actually makes a surprisingly big difference sometimes, like you can notice the lag with your eyes alone as it prints in the more

Re: Control flushing to stdout... core.osthread.Thread + arsd.terminal

2020-06-05 Thread aberba via Digitalmars-d-learn
On Friday, 5 June 2020 at 12:28:17 UTC, Adam D. Ruppe wrote: On Friday, 5 June 2020 at 11:45:31 UTC, aberba wrote: How can I make Thread.sleep() only run AFTER "Wait, signing you in ..." is written (force flushed) to stdout? just use explicit `terminal.flush();` any time you want the output

Re: Control flushing to stdout... core.osthread.Thread + arsd.terminal

2020-06-05 Thread aberba via Digitalmars-d-learn
On Friday, 5 June 2020 at 12:28:17 UTC, Adam D. Ruppe wrote: On Friday, 5 June 2020 at 11:45:31 UTC, aberba wrote: How can I make Thread.sleep() only run AFTER "Wait, signing you in ..." is written (force flushed) to stdout? just use explicit `terminal.flush();` any time you want the output

Re: How debugg unittest with visual code + code-d

2020-06-05 Thread WebFreak001 via Digitalmars-d-learn
On Friday, 5 June 2020 at 17:03:40 UTC, Luis wrote: So I actually managed to "debug" my unittests but It requires that I run previsuly "dub test" on console, so the executable is update. As I understand, I need to setup a task to be prelaunched by debug to generate the unittest executable, but

Win32 DLLs in D

2020-06-05 Thread Poyeyo via Digitalmars-d-learn
Hello everyone. I want to create a windows plugin.dll that could be called from rFactor, and I want to try D first, instead of going directly to C++ as the rFactor example. I am trying to wrap my head around this: https://wiki.dlang.org/Win32_DLLs_in_D ... which seems quite outdated, and

App hangs, GC.collect() fixet it. Why?

2020-06-05 Thread Bastiaan Veelo via Digitalmars-d-learn
I've been tracking down a hang in our pilot app. Using writeln, it appears to hang at newing a slice. After many hours of trying things, I discovered that program flow would continue past that point when I inserted a call to `GC.collect()` just before. Then it stalled again at a call to Win32

How debugg unittest with visual code + code-d

2020-06-05 Thread Luis via Digitalmars-d-learn
So I actually managed to "debug" my unittests but It requires that I run previsuly "dub test" on console, so the executable is update. As I understand, I need to setup a task to be prelaunched by debug to generate the unittest executable, but I don't know how setup it correctly. I only manage

Re: Is there a list of things which are slow to compile?

2020-06-05 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Jun 05, 2020 at 08:25:13AM +, aberba via Digitalmars-d-learn wrote: > On Wednesday, 3 June 2020 at 17:02:35 UTC, H. S. Teoh wrote: > > On Wed, Jun 03, 2020 at 09:36:52AM +, drathier via > > Digitalmars-d-learn wrote: > > > I'm wondering if there's a place that lists things which

Re: Control flushing to stdout... core.osthread.Thread + arsd.terminal

2020-06-05 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 5 June 2020 at 11:45:31 UTC, aberba wrote: How can I make Thread.sleep() only run AFTER "Wait, signing you in ..." is written (force flushed) to stdout? just use explicit `terminal.flush();` any time you want the output to appear immediately. Terminal does its own aggressive

Control flushing to stdout... core.osthread.Thread + arsd.terminal

2020-06-05 Thread aberba via Digitalmars-d-learn
I have this code which take two inputs. I expect "Wait, signing you in ..." to be written to stdout before Thread.sleep() kicks in but it somehow doesn't follow that sequence. I believe its a normal stdout behaviour since its buffered. How can I make Thread.sleep() only run AFTER "Wait,

Re: writeln Function while reading a Text File is printing appending text "before text" and "after text" at the same position

2020-06-05 Thread Ali Çehreli via Digitalmars-d-learn
On 6/3/20 1:43 PM, BoQsc wrote: Chomp sounds kind of funny hahaha. Also consider strip, stripLeft, and stripRight. (Not because they may be funny but because they are useful as well. :) ) Ali

Re: Is there a list of things which are slow to compile?

2020-06-05 Thread aberba via Digitalmars-d-learn
On Wednesday, 3 June 2020 at 17:02:35 UTC, H. S. Teoh wrote: On Wed, Jun 03, 2020 at 09:36:52AM +, drathier via Digitalmars-d-learn wrote: I'm wondering if there's a place that lists things which are slower/faster to compile? DMD is pretty famed for compiling quickly, but I'm not seeing