Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2024-01

$definec and $define

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Adriaan van Os

The FreePascal Programmer's Guide version 3.2.0 reads in section 1.2.11

"Under Mac Pascal mode, the $DEFINEC directive is equivalent to the $DEFINE directive and is provided for Mac Pascal compatibility.

{$DEFINE} can also be used to define macros or compile-time constants:"

This is not correct. In Metrowerks Pascal, $definec and $define are two distinct directives

$definec key value defines a macro where key is replaced by value $definec key defines a macro where key is replaced by an empty string $define key defines key as a symbol (to test with $fdef c.s.)

This is also how it actually works in FPC in Macpas mode, where $definec key and $define key are not equivalent.

Regards,

Adriaan van Os