On Tuesday, 8 December 2020 at 01:47:51 UTC, Andrew Edwards wrote:
Thanks Jacob. The extern(C) is temporary. I'm doing a direct
port of the code to D using -betterC. Wanted to keep it as
close to the original as possible until everything compiles.
Yes, that's always a good idea. Do the initia
On 12/7/20 10:56 PM, Adam D. Ruppe wrote:
On Monday, 7 December 2020 at 04:13:16 UTC, Andrew Edwards wrote:
Given:
===
extern(C):
char*[] hldr;
Why is this extern(C)? A D array ere is probably wrong.
To stay as close to the original implementation as possible. This will
all cha
On 12/7/20 10:12 PM, Jacob Carlborg wrote:
On Monday, 7 December 2020 at 04:13:16 UTC, Andrew Edwards wrote:
You can either use `extern(C) char*[] hldr` to make only `hldr` have C
linkage. Use `extern(C) {}` to group several symbols which should have C
linkage or rearrange the code so that `st
On Monday, 7 December 2020 at 04:13:16 UTC, Andrew Edwards wrote:
Given:
===
extern(C):
char*[] hldr;
Why is this extern(C)? A D array ere is probably wrong.
In C, a `char*[] hldr = {...}` is actually represented in D as a
static length array, like `char*[1] = [null];`
It shoul
On Monday, 7 December 2020 at 04:13:16 UTC, Andrew Edwards wrote:
Given:
===
extern(C):
char*[] hldr;
enum I = (1<<0);
struct S { char* ft; char** fm; int f; }
void main(){}
===
// Error Deprecation: static constructor can only be of D
linkage
S[] s;
static this() {
On Monday, 7 December 2020 at 05:28:41 UTC, user1234 wrote:
On Monday, 7 December 2020 at 04:13:16 UTC, Andrew Edwards
wrote:
Given:
===
extern(C):
char*[] hldr;
enum I = (1<<0);
struct S { char* ft; char** fm; int f; }
void main(){}
===
How do I initialize an instance
On Monday, 7 December 2020 at 04:13:16 UTC, Andrew Edwards wrote:
Given:
===
extern(C):
char*[] hldr;
enum I = (1<<0);
struct S { char* ft; char** fm; int f; }
void main(){}
===
How do I initialize an instance of S at global scope?
You cant. At the global scope the in
Given:
===
extern(C):
char*[] hldr;
enum I = (1<<0);
struct S { char* ft; char** fm; int f; }
void main(){}
===
How do I initialize an instance of S at global scope?
// Not sure how to do this... so try to keep as close to original as
possible
// Nope, does not work
S