Re: Importing version identifiers from another file?

2022-04-17 Thread cc via Digitalmars-d-learn
Another option for this was suggested here: https://forum.dlang.org/post/qbvgboihhwcuqglyg...@forum.dlang.org On Wednesday, 12 February 2020 at 09:28:15 UTC, Simen Kjærås wrote: So, you could have a file called 'versions' containing this: # Setting 'Compress' version -version=Compress # Optio

Re: Importing version identifiers from another file?

2022-04-12 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Apr 12, 2022 at 10:07:15AM -0700, Ali Çehreli via Digitalmars-d-learn wrote: > On 4/11/22 01:57, KytoDragon wrote: > > > Is there any way to import version specifiers from a separate file? > > Have you tried mixing in the versions? Have one file with the versions > in it: > > // file:

Re: Importing version identifiers from another file?

2022-04-12 Thread Ali Çehreli via Digitalmars-d-learn
On 4/11/22 01:57, KytoDragon wrote: > Is there any way to import > version specifiers from a separate file? Have you tried mixing in the versions? Have one file with the versions in it: // file: 'versions' version = x; Then mix it in: mixin (import ("versions")); version (x) { /* .

Re: Importing version identifiers from another file?

2022-04-11 Thread wjoe via Digitalmars-d-learn
On Monday, 11 April 2022 at 08:57:12 UTC, KytoDragon wrote: [...] Sadly this results in an identifier conflict, as the version set in config.d does not seem to affect library.d. Is there any way to import version specifiers from a separate file? I don't want to pollute the users build files (d

Importing version identifiers from another file?

2022-04-11 Thread KytoDragon via Digitalmars-d-learn
I am currently maintaining a port of a c++ library that uses conditional compilation to integrate into the users program. e.g.: config.h (edited by the user of the library) ``` #define USE_MY_ASSERT void MY_ASSERT(bool expr) {...} ``` library.c ``` include "config.h" #ifndef USE_MY_ASSERT v