Is it possible to create a file with conditional compilation depending on a compiler version, to write code which implements newest possibilities when compiled by a new fpc, but is compatible with older ones?
Code: Pascal [Select][+][-]const lcl_version = // note: 48 = Ord('0') {$ifdef ConditionalExpressions} {$if Declared(lcl_major) and (lcl_major >= 10)} Chr (48+(lcl_major div 10)) + {$ifend} {$endif} Chr (48+(lcl_major mod 10)) +'.'+ {$ifdef ConditionalExpressions} {$if Declared(lcl_minor) and (lcl_minor >= 10)} Chr (48+(lcl_minor div 10)) + {$ifend} {$endif} Chr (48+(lcl_minor mod 10)) +'.'+ {$ifdef ConditionalExpressions} {$if Declared(lcl_release) and (lcl_release >= 10)} Chr (48+(lcl_release div 10)) + {$ifend} {$endif} Chr (48+(lcl_release mod 10)) +'.'+ {$ifdef ConditionalExpressions} {$if Declared(lcl_patch) and (lcl_patch >= 10)} Chr (48+(lcl_patch div 10)) + {$ifend} {$endif} Chr (48+(lcl_patch mod 10));