Re: compiler fails with fatal error LNK1318: Unexpected PDB-error: OK (0) ""

2022-01-03 Thread Simon via Digitalmars-d-learn
oops this went into the wrong forum! Sorry! I will repost this as a compiler issue, any moderator feel free to delete this post.

Re: compiler fails with fatal error LNK1318: Unexpected PDB-error: OK (0) ""

2022-01-03 Thread Simon via Digitalmars-d-learn
Forgot to mention: I'm using DMD, and the Windows 10 is 64 bit.

compiler fails with fatal error LNK1318: Unexpected PDB-error: OK (0) ""

2022-01-03 Thread Simon via Digitalmars-d-learn
When compiling my project using v2.098.0 or v2.098.1 on Windows 10, this error just appeared: : fatal error LNK1318: Unerwarteter PDB-Fehler: OK (0) "". Error: linker exited with status 1318 "Unerwarteter PDB-Fehler" means "Unexpected PDB-error". The next 3 attempts to compile yielded the

What is D's "__debugbreak()" equivalent?

2021-10-27 Thread Simon via Digitalmars-d-learn
Microsofts C++ compiler provides the __debugbreak function, which on x86 emits interrupt 3, which will cause the debugger to halt. What is the equivalent in D? I tried using raise(SIGINT) from core.stdc.signal, but that just closes the debugger (I thought that was the same, seems like I was

Re: Is there an alternative to "__FUNCTION__" that gives the actual function symbol and not the name as a string?

2021-10-24 Thread Simon via Digitalmars-d-learn
On Saturday, 23 October 2021 at 20:24:32 UTC, Tim wrote: import std.traits, std.stdio; string generateLogCode(alias func)() { string code = "writeln("; code ~= "\"" ~ fullyQualifiedName!func ~ "(\""; foreach(i, param; ParameterIdentifierTuple!func) { if(i)

Re: Is there an alternative to "__FUNCTION__" that gives the actual function symbol and not the name as a string?

2021-10-23 Thread Simon via Digitalmars-d-learn
On Saturday, 23 October 2021 at 19:03:41 UTC, Tim wrote: On Saturday, 23 October 2021 at 18:56:48 UTC, Simon wrote: And I tried to use your suggestion like this: enum OUTPUT_REPRO_CASE(alias func = __traits(parent, {})) = "build the actual code stuff with"~fullyQualifiedName!func~" and so

Re: Is there an alternative to "__FUNCTION__" that gives the actual function symbol and not the name as a string?

2021-10-23 Thread Simon via Digitalmars-d-learn
On Saturday, 23 October 2021 at 18:36:27 UTC, Tim wrote: On Saturday, 23 October 2021 at 18:23:47 UTC, Simon wrote: So what I am looking for then is the equivalent to __FUNCTION__ that evaluates to the actual symbol of the function instead of its name, so it can be used as a parameter to

Is there an alternative to "__FUNCTION__" that gives the actual function symbol and not the name as a string?

2021-10-23 Thread Simon via Digitalmars-d-learn
For debugging purposes, I have built a mixin that will, when declared inside a function, output code to the console that will reproduce the exact function call. So, as an example, for the following function int reproducible_function(int a, int b){

Re: DMD won't compile re-init of variable

2020-02-03 Thread Simon via Digitalmars-d-learn
On Friday, 31 January 2020 at 14:01:04 UTC, Minty Fresh wrote: On Thursday, 30 January 2020 at 21:36:53 UTC, Adam D. Ruppe wrote: On Thursday, 30 January 2020 at 21:09:41 UTC, Simon wrote: How do I revert my variable to the init state? null is the initial state for those. More generally,

Re: DMD won't compile re-init of variable

2020-02-03 Thread Simon via Digitalmars-d-learn
On Thursday, 30 January 2020 at 21:18:04 UTC, MoonlightSentinel wrote: On Thursday, 30 January 2020 at 21:09:41 UTC, Simon wrote: Hi dlang community, I'm trying to implement a "reset" functionality which should revert all variables to the program start initial state. Example: import Graph;

DMD won't compile re-init of variable

2020-01-30 Thread Simon via Digitalmars-d-learn
Hi dlang community, I'm trying to implement a "reset" functionality which should revert all variables to the program start initial state. Example: import Graph; protected Edge[string] m_string2edge; int main() { // adding some elements // not important how it works //

Why is this pure function taking a string literal not CTFE-executable?

2019-06-01 Thread Simon via Digitalmars-d-learn
Hi Guys! In my programm, I have a custom String-type that I want to initialize some variables of at compile time by casting a string literal to said custom String type. I thought I could achieve this straight forwardly, but after trying a bit, I could not find a (simple) working solution. I

Re: Matching an array-type of a C++ function signature in D, without using a D-array-type, because the compiler crashes otherwise

2019-03-23 Thread Simon via Digitalmars-d-learn
On Saturday, 23 March 2019 at 13:04:10 UTC, kinke wrote: On Saturday, 23 March 2019 at 11:35:45 UTC, Simon wrote: Is there any way to end up with the correct mangled function signature, using only pointer types? The problem is that the C++ compiler uses head-const for the array param (`float

Matching an array-type of a C++ function signature in D, without using a D-array-type, because the compiler crashes otherwise

2019-03-23 Thread Simon via Digitalmars-d-learn
Hi, I experienced some trouble with DMD today, while trying to declare an external C++ function in D, that gets linked from a C++ compiled object file. The C++ function that I want to link against is declared as follows: bool ColorEdit4(const char* label, float col[4], int flags = 0);

Re: Aliasing a mixin (or alternative ways to profile a scope)

2019-03-10 Thread Simon via Digitalmars-d-learn
On Saturday, 9 March 2019 at 09:12:13 UTC, Dennis wrote: On Friday, 8 March 2019 at 11:42:11 UTC, Simon wrote: Thanks, this works flawlessly. Out of interest: what is the "enum" doing there? I had the exact same behaviour in a function before, that I only called at compile-time, so why did it

Re: Aliasing a mixin (or alternative ways to profile a scope)

2019-03-08 Thread Simon via Digitalmars-d-learn
On Thursday, 7 March 2019 at 21:50:17 UTC, Johannes Loher wrote: ``` enum profile_scope(string name) = "import core.stdc.stdio : printf; printf(\"" ~ name ~ "\n\"); scope(exit) printf(\"" ~ name ~ "\n\");"; extern (C) void main() { mixin(profile_scope!"func1"); } ``` This uses string

Re: Aliasing a mixin (or alternative ways to profile a scope)

2019-03-07 Thread Simon via Digitalmars-d-learn
On Thursday, 7 March 2019 at 20:34:48 UTC, Johannes Loher wrote: auto profile_scope(string name) { import std.format : format; return q{import std.stdio : writeln; writeln("%1$s"); scope(exit) writeln("%1$s");}.format(name); } void main() { mixin(profile_scope("func1")); } Is

Aliasing a mixin (or alternative ways to profile a scope)

2019-03-07 Thread Simon via Digitalmars-d-learn
Hello, I am currently porting the frontend of my instrumenting profiler to D. It features a C++-makro that profiles the time between entering and leaving a scope (achieved with con-/destructors in C++). Since D has scopeguards, I hoped to achieve this by creating a mixin that generates the