Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: Just a question...



Permlink Replies: 3 - Last Post: Mar 20, 2017 2:30 PM Last Post By: Remy Lebeau (Te...
Amine Moulay Ra...

Posts: 517
Registered: 2/12/10
Just a question...
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 20, 2017 11:41 AM
Hello,

I want to port this function from Delphi to FreePascal,
the {$IfOpt O+} doesn't seem to work in FreePascal:

function CompilerOptimizationS: String;
begin
Result:= 'Compiler optimization is ' +
{$IfOpt O+}
'enabled'
{$Else}
'disabled'
{$EndIf}
end;

Thank you,
Amine Moulay Ramdane.

Remy Lebeau (Te...


Posts: 8,733
Registered: 12/23/01
Re: Just a question...
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 20, 2017 12:00 PM   in response to: Amine Moulay Ra... in response to: Amine Moulay Ra...
Amine wrote:

I want to port this function from Delphi to FreePascal, the
{$IfOpt O+} doesn't seem to work in FreePascal:

You should ask in the FreePascal forums instead:

http://forum.lazarus.freepascal.org/

Configuring FreePascal's optimizations is much more flexible than Delphi's:

http://www.freepascal.org/docs-html/prog/progsu58.html#x65-640001.2.58

So an all-encompassing {$IFOPT O+} may or may not make as much sense in FreePascal
as it does in Delphi. At the very least, are you putting FreePascal into
Delphi mode using {$Mode Delphi} before using {$IFOPT}?

--
Remy Lebeau (TeamB)
Amine Moulay Ra...

Posts: 517
Registered: 2/12/10
Re: Just a question...
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 20, 2017 12:27 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Amine wrote:

I want to port this function from Delphi to FreePascal, the
{$IfOpt O+} doesn't seem to work in FreePascal:

You should ask in the FreePascal forums instead:

http://forum.lazarus.freepascal.org/

Configuring FreePascal's optimizations is much more flexible than Delphi's:

http://www.freepascal.org/docs-html/prog/progsu58.html#x65-640001.2.58

So an all-encompassing {$IFOPT O+} may or may not make as much sense in FreePascal
as it does in Delphi. At the very least, are you putting FreePascal into
Delphi mode using {$Mode Delphi} before using {$IFOPT}?

--
Remy Lebeau (TeamB)

I have already set it with the Delphi mode in FreePascal..

The {$IfOpt O+} is not working in FreePascal, but it is working in Delphi.

Thank you,
Amine Moulay Ramdane.

Remy Lebeau (Te...


Posts: 8,733
Registered: 12/23/01
Re: Just a question...
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 20, 2017 2:30 PM   in response to: Amine Moulay Ra... in response to: Amine Moulay Ra...
Amine wrote:

I have already set it with the Delphi mode in FreePascal..

The {$IfOpt O+} is not working in FreePascal, but it is working
in Delphi.

Again, you should ask in the FreePascal forums instead.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02