Recent

Author Topic: Is "FPC_FULLVERSION" not configured properly in some builds?  (Read 3531 times)

TRon

  • Hero Member
  • *****
  • Posts: 3646
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #30 on: February 27, 2024, 08:01:42 pm »
Will the use of revinc (still) influence the $fpcversion define/variable ?
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

PascalDragon

  • Hero Member
  • *****
  • Posts: 5759
  • Compiler Developer
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #31 on: February 27, 2024, 08:38:07 pm »
How does writeln(FPC_FULLVERSION) work then?

Where does FPC_FULLVERSION come from if it's only a define.
(I can't use any other defines like that)


O, forget my question.
It's a macro.
What line only works if macros is on ( {$MACRO ON}  ).

It's not a macro. It's a preprocessor constant that can be used no matter if $MACRO is enabled or not, just like any (untyped or preprocessor) constant does.

Will the use of revinc (still) influence the $fpcversion define/variable ?

FPCVERSION is not, FPCFULLVERSION is.

rvk

  • Hero Member
  • *****
  • Posts: 6585
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #32 on: February 27, 2024, 08:41:39 pm »
It's not a macro. It's a preprocessor constant that can be used no matter if $MACRO is enabled or not, just like any (untyped or preprocessor) constant does.
I couldn't. I needed to add {$MACRO ON} before FPC_FULLVERSION was recognized in writeln(FPC_FULLVERSION).

I can try again later.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5759
  • Compiler Developer
Re: Is "FPC_FULLVERSION" not configured properly in some builds?
« Reply #33 on: February 27, 2024, 09:19:42 pm »
Now I understand what you mean. FPC_FULLVERSION is supposed to be used inside preprocessor directives. That does not need {$MACRO ON}, however using it as a “constant” in the real Pascal source does.

The correct way without {$MACRO ON} is to use {$I %FPCVERSION%} (though the be fair that is the string variant with dots instead of the numeric version 🤷‍♀️)

 

TinyPortal © 2005-2018