Is there a compile-time check which will show whether the current mode is one in which the mod operator will work in accordance with the ISO Pascal definition?No. As you probably already know, the {$ifOpt} (https://freepascal.org/docs-html/current/prog/progsu33.html) directive only works on settings a short/single-letter alternative exists for.
I'm aware of -Miso and {$modeswitch ISOMOD } , but at a particular place in the code I want to know whether one of these is active and if not use a custom operator: […]Simply always use the “custom” operator. Write a separate unit in which you “overload”, for instance, the >< operator in any case, yet this unit has {$modeSwitch ISOMod+} at the top.
Is there a compile-time check which will show whether the current mode is one in which the mod operator will work in accordance with the ISO Pascal definition?
Is there a compile-time check which will show whether the current mode is one in which the mod operator will work in accordance with the ISO Pascal definition?
The current mode of the unit is available as FPC_<mode> define. Modeswitches themselves have no defines however (so you would not be able to detect {$MODE ISO}{$MODESWITCH ISOMOD-}.