December 21, 2021

On 12/21/21 2:32 PM, eugene wrote:

>

On Tuesday, 21 December 2021 at 19:13:19 UTC, Steven Schveighoffer wrote:

>

On 12/21/21 1:50 PM, eugene wrote:

>
     version (FreeBSD_12) enum __FreeBSD_version = 1202000;
else version (FreeBSD_11) enum __FreeBSD_version = 1104000;
else version (FreeBSD_10) enum __FreeBSD_version = 1004000;
else version (FreeBSD_9)  enum __FreeBSD_version = 903000;
else version (FreeBSD_8)  enum __FreeBSD_version = 804000;
else static assert(false, "Unsupported version of FreeBSD");

but __FreeBSD_version is 1104000 anyway.

Not sure how those versions are set. I have a hard time following the dmd code to see where it might check the current-running OS to check for the version.

I think, it'd be nice to set it in /etc/dmd.conf
Or.. is it bad idea?..

If this is a compiler-supplied version, then I don't think you are allowed to set it explicitly.

-Steve

December 21, 2021

On Tuesday, 21 December 2021 at 19:22:35 UTC, rempas wrote:

>

Yeah, don't use the "pkg" version as it is outdated. It is very hard to keep a whole OS (thousands of packages) up to date. So yeah, uninstall your current ldc and trying with the one from the link I gave you and tell me the output

core/sys/freebsd/config.d and core/sys/freebsd/sys/event.d
are the same as in fresh dmd, so there is not much sense to try it.
dmd (including phobos) is a reference, and I do not think,
that ldc is ahead of dmd with it's stdlib.

December 21, 2021

On Tuesday, 21 December 2021 at 19:49:26 UTC, Steven Schveighoffer wrote:

>

If this is a compiler-supplied version, then I don't think you are allowed to set it explicitly.

moreover... commented out in condig.d like this:

     version (FreeBSD_12) enum __FreeBSD_version = 1202000;
//else version (FreeBSD_11) enum __FreeBSD_version = 1104000;
//else version (FreeBSD_10) enum __FreeBSD_version = 1004000;
//else version (FreeBSD_9)  enum __FreeBSD_version = 903000;
//else version (FreeBSD_8)  enum __FreeBSD_version = 804000;
//else static assert(false, "Unsupported version of FreeBSD");

and...

@bsd:~/d> dmd freebsdver
/usr/include/d/dmd/core/sys/posix/sys/types.d(201): Error: undefined identifier `__FreeBSD_version`
/usr/include/d/dmd/core/sys/posix/stdio.d(393): Error: undefined identifier `__FreeBSD_version`
/usr/include/d/dmd/core/sys/freebsd/sys/event.d(42): Error: undefined identifier `__FreeBSD_version`
/usr/include/d/dmd/core/sys/freebsd/sys/event.d(173): Error: undefined identifier `__FreeBSD_version`
December 21, 2021

On Tuesday, 21 December 2021 at 19:40:52 UTC, eugene wrote:

>

But i like to use software out of the box and
do not like compile it from source.

Me too! The link I gave you has a binary release with LDC2. You won't have to compile it yourself.

>

I do not see any reason for me to do this.
The "problem" (with dmd, not with ldc) is
that despite phobos does contain everthing for ver 12+,
the version itself is incorrect.

I agree tho what I was wondering was if the latest version LDC2 will now have the missing definitions for freeBSD. The versioning will of course be wrong (as LDC2 uses DMD as a frontend from what I know) but if the other info isn't added then maybe we should add an issue in their Github. Of course if you don't care about LDC2 you should not spend your time

December 21, 2021

On Tuesday, 21 December 2021 at 19:55:13 UTC, eugene wrote:

>

core/sys/freebsd/config.d and core/sys/freebsd/sys/event.d
are the same as in fresh dmd, so there is not much sense to try it.
dmd (including phobos) is a reference, and I do not think,
that ldc is ahead of dmd with it's stdlib.

Oh, that was in the next page and I didn't saw it when I replied. So to continue from my last comment (and answer on this one), I thought you said that LDC does not include "core.sys.freebsd.config" here or is there something I didn't understand right? And WOW! We are making a big conversation here, lol

December 21, 2021

On Tuesday, 21 December 2021 at 21:02:21 UTC, rempas wrote:

>

On Tuesday, 21 December 2021 at 19:55:13 UTC, eugene wrote:

>

core/sys/freebsd/config.d and core/sys/freebsd/sys/event.d
are the same as in fresh dmd, so there is not much sense to try it.
dmd (including phobos) is a reference, and I do not think,
that ldc is ahead of dmd with it's stdlib.

Oh, that was in the next page and I didn't saw it when I replied. So to continue from my last comment (and answer on this one), I thought you said that LDC does not include "core.sys.freebsd.config" here or is
there something I didn't understand right?

  • The ldc installed by 'pkg install ldc' (the old one), does not have config module
  • Most resent ldc (link you indicated), does have condig module, and it is exactly the same as condig in most recent dmd
December 22, 2021

On Tuesday, 21 December 2021 at 21:09:14 UTC, eugene wrote:

>

On Tuesday, 21 December 2021 at 21:02:21 UTC, rempas wrote:

>

On Tuesday, 21 December 2021 at 19:55:13 UTC, eugene wrote:

>

core/sys/freebsd/config.d and core/sys/freebsd/sys/event.d
are the same as in fresh dmd, so there is not much sense to try it.
dmd (including phobos) is a reference, and I do not think,
that ldc is ahead of dmd with it's stdlib.

Oh, that was in the next page and I didn't saw it when I replied. So to continue from my last comment (and answer on this one), I thought you said that LDC does not include "core.sys.freebsd.config" here or is
there something I didn't understand right?

  • The ldc installed by 'pkg install ldc' (the old one), does not have config module
  • Most resent ldc (link you indicated), does have condig module, and it is exactly the same as condig in most recent dmd

Hi Eugene,
When you run ldc2 -v test.d (some arbitrary d file), you should see "predefs" at the top, followed by a bunch of predefined versions by the compiler. FreeBSD_xx should be on that list, and the number should correspond to your OS version. If it does not, then that's a bug in LDC.
I was wrong: LDC is using its own code to determine the OS version, and it should already do that correctly.

cheers,
Johan

December 22, 2021

On Tuesday, 21 December 2021 at 21:09:14 UTC, eugene wrote:

>
  • The ldc installed by 'pkg install ldc' (the old one), does not have config module
  • Most resent ldc (link you indicated), does have condig module, and it is exactly the same as condig in most recent dmd

Cool! Makes sense! I thought you didn't tried the latest LDC2 at all so it seemed weird to me. Great job man!

December 22, 2021

On Wednesday, 22 December 2021 at 06:50:00 UTC, rempas wrote:

>

On Tuesday, 21 December 2021 at 21:09:14 UTC, eugene wrote:

>
  • The ldc installed by 'pkg install ldc' (the old one), does not have config module
  • Most resent ldc (link you indicated), does have condig module, and it is exactly the same as condig in most recent dmd

Cool! Makes sense! I thought you didn't tried the latest LDC2 at all so it seemed weird to me. Great job man!

You thought right - I DID NOT try the latest LDC, I just looked into
ldc2-1.28.0-freebsd-x86_64.tar.xz archive to see
what is in core/sys/freebsd/config.d and in core/sys/freebsd/sys/event.d

Both these files are just copies from DMD distribution.

December 22, 2021

On Wednesday, 22 December 2021 at 08:41:56 UTC, eugene wrote:

>

You thought right - I DID NOT try the latest LDC, I just looked into
ldc2-1.28.0-freebsd-x86_64.tar.xz archive to see
what is in core/sys/freebsd/config.d and in core/sys/freebsd/sys/event.d

Both these files are just copies from DMD distribution.

Actually just taking a look in the files is the same thing ;)