[Solved]Conditional compilation depending of fpc version? lazarus / 62-General ---------------------------------------------------------------------- glorfin · 2019-11-12 20:48 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? ---------------------------------------------------------------------- valdir.marcos · 2019-11-13 00:57 Quote from: glorfin on November 12, 2019, 09:48:28 pmIs 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?Quote from: Paulo França Lacerda on November 17, 2016, 09:23:48 pmCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 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));https://lazarus- ccr.sourceforge.io/docs/lcl/lclversion/index.html Directive, conditional or macro for LCL version? https://forum.lazarus.freepascal.org/index.php/topic,22674.0.html https://lazarus-ccr.sourceforge.io/docs/lcl/lclversion/index.html lcl_version as constant expression https://forum.lazarus.freepascal.org/index.php/topic,34831.0.html Compiler definiton for lcl like {$IF LCL_VERSION>2} ? https://forum.lazarus.freepascal.org/index.php/topic,45144.msg321468.h tml#msg321468 Get LCL revision or version via ifdef http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Get-LCL- revision-or-version-via-ifdef-td3383720.html https://wiki.freepascal.org/Conditional_compilation https://www.freepascal.org/docs-html/prog/progch1.html https://www.freepascal.org/docs-html/current/prog/progch2.html https://wiki.freepascal.org/Conditional_Compiler_Options https://wiki.freepascal.org/Macros_and_Conditionals https://wiki.freepascal.org/local_compiler_directives https://wiki.freepascal.org/index.php?title=local_compiler_directives& printable=yes ---------------------------------------------------------------------- glorfin · 2019-11-13 00:59 Thank you. It is better than nothing, but a library which I am supporting does not use LCL. Theoretically, it may be complied without lazarus. Are there LCL-independent solutions? If not, it would be nice to introduce them ---------------------------------------------------------------------- Cyrax · 2019-11-13 01:08 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$IF FPC_FULLVERSION >= 33000} ... ${ENDIF} ---------------------------------------------------------------------- glorfin · 2019-11-13 01:11 Oh, thank you, Cyrax! This is what I needed!