Re: Forcing my module to be initialized first

2023-10-16 Thread dan via Digitalmars-d-learn
On Monday, 16 October 2023 at 10:23:54 UTC, Richard (Rikki) Andrew Cattermole wrote: Okay, after looking at gtkd, I don't think this can be solved with module constructors or swapping out to lazy initialization. One way that might work however is to use a crt_constructor as that runs before

Re: Forcing my module to be initialized first

2023-10-16 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
Okay, after looking at gtkd, I don't think this can be solved with module constructors or swapping out to lazy initialization. One way that might work however is to use a crt_constructor as that runs before the D stuff. However it would now hard code your program to your system. Over all my

Re: Forcing my module to be initialized first

2023-10-15 Thread dan via Digitalmars-d-learn
On Monday, 16 October 2023 at 04:26:32 UTC, Paul Backus wrote: On Monday, 16 October 2023 at 03:31:13 UTC, dan wrote: I have some code that i would like executed before anything else is. The code is to set an environment variable which is used by a library. I'm trying to find some way to

Re: Forcing my module to be initialized first

2023-10-15 Thread dan via Digitalmars-d-learn
On Monday, 16 October 2023 at 03:33:55 UTC, Richard (Rikki) Andrew Cattermole wrote: On 16/10/2023 4:31 PM, dan wrote: I suppose if i could figure out a way to make all other modules depend on my module this would happen, but the module which uses the variable i want to set is in some

Re: Forcing my module to be initialized first

2023-10-15 Thread Paul Backus via Digitalmars-d-learn
On Monday, 16 October 2023 at 03:31:13 UTC, dan wrote: I have some code that i would like executed before anything else is. The code is to set an environment variable which is used by a library. I'm trying to find some way to avoid setting the environment variable on the command line, or in

Re: Forcing my module to be initialized first

2023-10-15 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 16/10/2023 4:31 PM, dan wrote: I suppose if i could figure out a way to make all other modules depend on my module this would happen, but the module which uses the variable i want to set is in some already-compiled dynamic library that i would prefer not to touch. If its in a shared

Forcing my module to be initialized first

2023-10-15 Thread dan via Digitalmars-d-learn
I have some code that i would like executed before anything else is. The code is to set an environment variable which is used by a library. I'm trying to find some way to avoid setting the environment variable on the command line, or in any shell script or initialization file. I think the