| 1 | | - | ## About this page |
| 2 | | - | |
| 3 | | - | Below you can find a list of new features introduced since the [[FPC New Features 3.2.2|previous release]], along with some background information and examples. Note that since svn trunk is by definition still under development, some of the features here may still change before they end up in a release version. |
| 4 | | - | |
| 5 | | - | A list of changes that may break existing code can be found [[User Changes Trunk|here]]. |
| 6 | | - | |
| 7 | | - | ## All systems |
| 8 | | - | |
| 9 | | - | ### Compiler |
| 10 | | - | |
| 11 | | - | #### fpcres can compile RC files |
| 12 | | - | |
| 13 | | - | - **Overview**: The *fpcres* utility gained support for compiling RC files to RES files if the output format (parameter *-of*) is set to *rc*. The Free Pascal compiler itself can use *fpcres* instead of *windres* or *gorc* as well if the option *-FF* is supplied. |
| 14 | | - | - **Notes**: Using *fpcres* instead of *windres* or *gorc* will become default once a release with the new *fpcres* is released. |
| 15 | | - | - **svn**: 46398 (and others before and after that) |
| 16 | | - | |
| 17 | | - | ### Language |
| 18 | | - | |
| 19 | | - | #### Support for "volatile" intrinsic |
| 20 | | - | |
| 21 | | - | - **Overview**: A **volatile** intrinsic has been added to indicate to the code generator that a particular load from or store to a memory location must not be removed. |
| 22 | | - | - **Notes**: |
| 23 | | - | - Delphi uses an attribute rather than an intrinsic. Such support will be added once support for attributes is available in FPC. An intrinsic that applies only to a specific memory access also has the advantages outlined in <https://lwn.net/Articles/233482/> |
| 24 | | - | - Accesses to fixed absolute addresses (as common on DOS and embedded platforms) are automatically marked as volatile by the compiler. |
| 25 | | - | - **Example**: <https://gitlab.com/freepascal.org/fpc/source/-/blob/main/tests/test/tmt1.pp> |
| 26 | | - | - **svn**: 40465 |
| 27 | | - | |
| 28 | | - | #### Support for "noinline" modifier |
| 29 | | - | |
| 30 | | - | - **Overview**: A **noinline** modifier has been added that can be used to prevent a routine from ever being inlined (even by automatic inlining). |
| 31 | | - | - **Notes**: Mainly added for internal compiler usage related to LLVM support. |
| 32 | | - | - **svn**: 41198 |
| 33 | | - | |
| 34 | | - | #### Support for multiple active helpers per type |
| 35 | | - | |
| 36 | | - | - **Overview**: With the modeswitch *multihelpers* multiple helpers for a single type can be active at once. If a member of the type is accessed it's first checked in all helpers that are in scope in reverse order before the extended type itself is checked. |
| 37 | | - | - **Examples**: All tests with the name *tmshlp*.pp* in <https://gitlab.com/freepascal.org/fpc/source/-/tree/main/tests/test> |
| 38 | | - | - **svn**: 42026 |
| 39 | | - | |
| 40 | | - | #### Support for custom attributes |
| 41 | | - | |
| 42 | | - | - **Overview**: Custom attributes allow to decorate types and published properties of classes to be decorated with additional metadata. The metadata are by itself descendants of *TCustomAttribute* and can take additional parameters if the classes have a suitable constructor to take these parameters. This feature requires the new modeswitch *PrefixedAttributes*. This modeswitch is active by default in modes *Delphi* and *DelphiUnicode*. Attributes can be queried using the *TypInfo* or *Rtti* units. |
| 43 | | - | - **Notes**: More information can be seen in the [announcement mail](https://lists.freepascal.org/pipermail/fpc-announce/2019-July/000612.html) and [[Custom Attributes]] |
| 44 | | - | - **svn**: 42356 - 42411 |
| 45 | | - | - **Example**: |
| 46 | | - | |
| 47 | | - | ``` pascal |
| 48 | | - | program tcustomattr; |
| 49 | | - | |
| 50 | | - | {$mode objfpc}{$H+} |
| 51 | | - | {$modeswitch prefixedattributes} |
| 52 | | - | |
| 53 | | - | type |
| 54 | | - | TMyAttribute = class(TCustomAttribute) |
| 55 | | - | constructor Create; |
| 56 | | - | constructor Create(aArg: String); |
| 57 | | - | constructor Create(aArg: TGUID); |
| 58 | | - | constructor Create(aArg: LongInt); |
| 59 | | - | end; |
| 60 | | - | |
| 61 | | - | {$M+} |
| 62 | | - | [TMyAttribute] |
| 63 | | - | TTestClass = class |
| 64 | | - | private |
| 65 | | - | fTest: LongInt; |
| 66 | | - | published |
| 67 | | - | [TMyAttribute('Test')] |
| 68 | | - | property Test: LongInt read fTest; |
| 69 | | - | end; |
| 70 | | - | {$M-} |
| 71 | | - | |
| 72 | | - | [TMyAttribute(1234)] |
| 73 | | - | [TMy('Hello World')] |
| 74 | | - | TTestEnum = ( |
| 75 | | - | teOne, |
| 76 | | - | teTwo |
| 77 | | - | ); |
| 78 | | - | |
| 79 | | - | [TMyAttribute(IInterface), TMy(42)] |
| 80 | | - | TLongInt = type LongInt; |
| 81 | | - | |
| 82 | | - | constructor TMyAttribute.Create; |
| 83 | | - | begin |
| 84 | | - | end; |
| 85 | | - | |
| 86 | | - | constructor TMyAttribute.Create(aArg: String); |
| 87 | | - | begin |
| 88 | | - | end; |
| 89 | | - | |
| 90 | | - | constructor TMyAttribute.Create(aArg: LongInt); |
| 91 | | - | begin |
| 92 | | - | end; |
| 93 | | - | |
| 94 | | - | constructor TMyAttribute.Create(aArg: TGUID); |
| 95 | | - | begin |
| 96 | | - | end; |
| 97 | | - | |
| 98 | | - | begin |
| 99 | | - | |
| 100 | | - | end. |
| 101 | | - | ``` |
| 102 | | - | |
| 103 | | - | #### Support for constant parameters in generics |
| 104 | | - | |
| 105 | | - | - **Overview**: Generic types and routines can now be declared with constants as parameters which function as untyped constants inside the generic. However these generic parameters have a type which allows the author of the generic to restrict the possible values for the constant. Only constant types that can also be used for untyped constants can be used. |
| 106 | | - | - **Notes**: |
| 107 | | - | - This feature is not Delphi compatible, but can be used in mode *Delphi* as well |
| 108 | | - | - More information is available in the [announcement mail](https://lists.freepascal.org/pipermail/fpc-devel/2020-April/042708.html). |
| 109 | | - | - **Examples**: All tests with the name *tgenconst*.pp* in <https://gitlab.com/freepascal.org/fpc/source/-/tree/main/tests/test> |
| 110 | | - | - **svn**: 45080 |
| 111 | | - | |
| 112 | | - | #### Support for "IsConstValue" intrinsic |
| 113 | | - | |
| 114 | | - | - **Overview**: An *IsConstValue* intrinsic has been added to check whether a provided value is considered a constant value. This is mainly useful inside inlined functions to manually improve the generated code if a constant is encountered. |
| 115 | | - | - **Notes**: |
| 116 | | - | - This function returns a constant Boolean value and is Delphi compatible. |
| 117 | | - | - Typed constants are *not* considered constants (Delphi compatible and also compatible with the usual modus operandi regarding typed constants). |
| 118 | | - | - **Example**: <https://gitlab.com/freepascal.org/fpc/source/-/tree/main/tests/test/tisconstvalue2.pp> |
| 119 | | - | - **svn**: 45695 |
| 120 | | - | |
| 121 | | - | #### Copy supports Open Array parameters |
| 122 | | - | |
| 123 | | - | - **Overview**: The *Copy* intrinsic can now be used to copy (a part of) the contents of an open array parameter to a dynamic array. |
| 124 | | - | - **Notes**: |
| 125 | | - | - The result of the *Copy* function will have the type of a dynamic array with the same element type as the parameter that is copied from. |
| 126 | | - | - If the *Start* parameter is out of range the resulting dynamic array will be empty. |
| 127 | | - | - If the *Count* parameter is too large then the resulting dynamic array will only contain the elements that exist. |
| 128 | | - | - **svn**: 46890 |
| 129 | | - | - **Example**: |
| 130 | | - | |
| 131 | | - | ``` pascal |
| 132 | | - | procedure Test(aArg: array of LongInt); |
| 133 | | - | var |
| 134 | | - | arr: array of LongInt; |
| 135 | | - | begin |
| 136 | | - | arr := Copy(aArg, 3, 5); |
| 137 | | - | end; |
| 138 | | - | ``` |
| 139 | | - | |
| 140 | | - | #### Array constructors for static arrays |
| 141 | | - | |
| 142 | | - | - **Overview**: Array constructors can be used to assign values to static arrays. |
| 143 | | - | - **Notes**: |
| 144 | | - | - The array constructor needs to have the same amount of elements as the static array. |
| 145 | | - | - The first element of the array constructor will be placed at the location of the first element of the static array (e.g. if the array starts at -1 the first element will be at that location). |
| 146 | | - | - Arrays with enumeration index are supported as well. |
| 147 | | - | - **svn**: 46891, 46901 |
| 148 | | - | - **Example**: <https://gitlab.com/freepascal.org/fpc/source/-/tree/main/tests/test/tarrconstr16.pp> |
| 149 | | - | |
| 150 | | - | #### "Align" modifier support for record definitions |
| 151 | | - | |
| 152 | | - | - **Overview**: It is now possible to add an **Align X** modifier at the end of a record definition to indicate that the record as a whole should be aligned to a particular boundary. |
| 153 | | - | - **Notes**: |
| 154 | | - | - Should be Delphi compatible, although documentation is not available (["semi-official" reference](https://web.archive.org/web/20171221044023/http://qc.embarcadero.com/wc/qcmain.aspx?d=87283); the mentioned issue does not exist in the FPC implementation). |
| 155 | | - | - This does not influence the alignment of the individual fields, which are still aligned according to the current *{\$packrecords y}*/*{\$align y}* settings. |
| 156 | | - | - X can be 1, 2, 4, 8, 16, 32 or 64. |
| 157 | | - | - **svn**: 47892 |
| 158 | | - | - **Example**: <https://gitlab.com/freepascal.org/fpc/source/-/blob/main/tests/webtbs/tw28927.pp> |
| 159 | | - | |
| 160 | | - | #### Support for binary literals in Delphi mode |
| 161 | | - | |
| 162 | | - | - **Overview**: It is now possible to use binary literals ('%' as prefix) in Delphi mode. |
| 163 | | - | - **Notes**: [Delphi compatibility](https://docwiki.embarcadero.com/RADStudio/Alexandria/en/What%27s_New#Binary_Literals_and_Digit_Separator). |
| 164 | | - | - **GitLab issue**: [\#39503](https://gitlab.com/freepascal.org/fpc/source/-/issues/39503) |
| 165 | | - | - **Example**: |
| 166 | | - | |
| 167 | | - | ``` pascal |
| 168 | | - | {$mode Delphi} |
| 169 | | - | var |
| 170 | | - | b: byte; |
| 171 | | - | begin |
| 172 | | - | b:=%11001001; |
| 173 | | - | end. |
| 174 | | - | ``` |
| 175 | | - | |
| 176 | | - | #### Support for Digit Separator |
| 177 | | - | |
| 178 | | - | - **Overview**: It is now possible to use the Digit Separator ('_') with the *underscoreisseparator* modeswitch. It is also enabled by default in Delphi mode. |
| 179 | | - | - **Notes**: [Delphi compatibility](https://docwiki.embarcadero.com/RADStudio/Alexandria/en/What%27s_New#Binary_Literals_and_Digit_Separator). |
| 180 | | - | - **GitLab issue**: [\#39504](https://gitlab.com/freepascal.org/fpc/source/-/issues/39504) |
| 181 | | - | - **Example**: |
| 182 | | - | |
| 183 | | - | ``` pascal |
| 184 | | - | {$mode Delphi} |
| 185 | | - | var |
| 186 | | - | i: Integer; |
| 187 | | - | r: Real; |
| 188 | | - | begin |
| 189 | | - | i := %1001_1001; |
| 190 | | - | i := &121_102; |
| 191 | | - | i := 1_123_123; |
| 192 | | - | i := $1_123_123; |
| 193 | | - | r := 1_123_123.000_000; |
| 194 | | - | r := 1_123_123.000_000e1_2; |
| 195 | | - | end. |
| 196 | | - | ``` |
| 197 | | - | |
| 198 | | - | #### Support for forward declarations of generic types |
| 199 | | - | |
| 200 | | - | - **Overview**: It is now possible to use forward declarations for generic classes and interfaces like is possible for non-generic classes and interfaces. |
| 201 | | - | - **Notes**: |
| 202 | | - | - Generic type constraints and const declarations need to be used for both the forward and the final implementation like is necessary for global generic routines. |
| 203 | | - | - This is Delphi-compatible. |
| 204 | | - | - **Commit**: [2a502350](https://gitlab.com/freepascal.org/fpc/source/-/commit/2a5023508a2bc4ff3ba4f3a0ca16366d3df86db8) |
| 205 | | - | - **Example**: |
| 206 | | - | |
| 207 | | - | ``` pascal |
| 208 | | - | {$mode objfpc} |
| 209 | | - | type |
| 210 | | - | generic TTest<T> = class; |
| 211 | | - | generic TFoo<T: class> = class; |
| 212 | | - | generic TBar<const N: LongInt> = class; |
| 213 | | - | |
| 214 | | - | TSomething = class |
| 215 | | - | fTest: specialize TTest<LongInt>; |
| 216 | | - | fFoo: specialize TFoo<TObject>; |
| 217 | | - | fBar: specialize TBar<42>; |
| 218 | | - | end; |
| 219 | | - | |
| 220 | | - | generic TTest<T> = class end; |
| 221 | | - | generic TFoo<T: class> = class end; |
| 222 | | - | generic TBar<const N: LongInt> = class end; |
| 223 | | - | |
| 224 | | - | begin |
| 225 | | - | end. |
| 226 | | - | ``` |
| 227 | | - | |
| 228 | | - | #### Support for Function References and Anonymous Functions |
| 229 | | - | |
| 230 | | - | - **Function References**: Function References (also applicable names are Procedure References and Routine References, in the following only Function References will be used) are types that can take a function (or procedure or routine), method, function variable (or procedure variable or routine variable), method variable, nested function (or nested procedure or nested routine) or an anonymous function (or anonymous procedure or anonymous routine) as a value. The function reference can then be used to call the provided function just like other similar routine pointer types. In contrast to these other types nearly all function-like constructs can be assigned to it (the only exception are nested function variables (or nested procedure variables or nested routine variables), more about that later on) and then used or stored. |
| 231 | | - | - **Anonymous Functions**: Anonymous Functions (or Anonymous Procedures or Anonymous Routines, in the following simply Anonymous Functions) are routines that have no name associated with them and are declared in the middle of a code block (for example on the right side of an expression or as a parameter for a function call). However they can just as well be called directly like a nested function (or nested procedure or nested routine) would. |
| 232 | | - | - **More Information and Examples**: [Feature announcement: Function References and Anonymous Functions](https://forum.lazarus.freepascal.org/index.php/topic,59468.0.html) |
| 233 | | - | - **GitLab Issue**: [\#24481](https://gitlab.com/freepascal.org/fpc/source/-/issues/24481) |
| 234 | | - | |
| 235 | | - | #### Descendant type helpers can extend type aliases |
| 236 | | - | |
| 237 | | - | - **Overview**: A type helper that descends from another type helper can now extend a unique type alias of the type the inherited type helper extends. This way a type helper for the original type can be made available for the type alias as well. |
| 238 | | - | - **Notes**: |
| 239 | | - | - The type alias the descendant extends does not need to be a *direct* type alias of the parent's extended type. |
| 240 | | - | - The other way around is not allowed: a type helper that inherits from another helper which extends a unique type alias can not extend the base type. |
| 241 | | - | - **Example**: See the [test](https://gitlab.com/freepascal.org/fpc/source/-/blob/main/tests/test/tthlp30.pp) for the feature. |
| 242 | | - | - **Commit**: [7133ad7e](https://gitlab.com/freepascal.org/fpc/source/-/commit/7133ad7ecc46700618193adff85cef84682355b0) |
| 243 | | - | |
| 244 | | - | #### Support for Unicode RTL |
| 245 | | - | |
| 246 | | - | - **Overview**: The Unicode RTL is required for Delphi 2009+ compatibility. This also includes support for dotted filenames like *System.SysUtils* |
| 247 | | - | - **Notes**: [FPC Unicode RTL](https://wiki.freepascal.org/FPC_Unicode_RTL). |
| 248 | | - | - **fpc-devel Mailinglist announcement**: [Unicode RTL](https://lists.freepascal.org/pipermail/fpc-devel/2023-July/045194.html) |
| 249 | | - | |
| 250 | | - | #### Support for Extended RTTI |
| 251 | | - | |
| 252 | | - | - **Overview**: Extended RTTI includes the for *\$RTTI* directive, generating RTTI metadata for all fields, methods and properties and allowing the access of the RTTI metadata via TypInfo and RTTI unit. |
| 253 | | - | - **Notes**: [Delphi 2010+ compatibility](https://docwiki.embarcadero.com/RADStudio/Alexandria/en/RTTI_directive_(Delphi)). |
| 254 | | - | - **GitLab issue**: [\#38964](https://gitlab.com/freepascal.org/fpc/source/-/issues/38964) |
| 255 | | - | - **Commit**: \[<https://gitlab.com/freepascal.org/fpc/source/-/compare/c74441323ac9712f0a1f08349debcffe580734d1>...a98462835ed6848b62ef95188627e11c4ba52df0 7eea8507..a9846283\] |
| 256 | | - | |
| 257 | | - | ### Units |
| 258 | | - | |
| 259 | | - | #### DaemonApp |
| 260 | | - | |
| 261 | | - | ##### Additional control codes on Windows |
| 262 | | - | |
| 263 | | - | - **Overview**: Windows allows a service to request additional control codes to be received. For example if the session of the user changed. These might also carry additional parameters that need to be passed along to the *TDaemon* instance. For this the *WinBindings* class of the *TDaemonDef* now has an additional *AcceptedCodes* field (which is a set) that allows to define which additional codes should be requested. Then the daemon should handle the *OnControlCodeEvent* event handler which in contrast to the existing *OnControlCode* handler takes two additional parameters that carry the parameters that the function described for MSDNs *[LPHANDLER_FUNCTION_EX](https://docs.microsoft.com/en-us/windows/win32/api/winsvc/nc-winsvc-lphandler_function_ex)* takes as well. |
| 264 | | - | - **Notes**: This lead to slight incompatibilities which are mentioned in [[User Changes Trunk]] |
| 265 | | - | - **svn**: 46326, 46327 |
| 266 | | - | |
| 267 | | - | #### Classes |
| 268 | | - | |
| 269 | | - | ##### Naming of Threads |
| 270 | | - | |
| 271 | | - | - **Overview**: *TThread.NameThreadForDebugging* has been implemented for macOS. |
| 272 | | - | - **Notes**: Delphi compatible, was already implemented for Windows, Linux and Android and finally for macOS now. Read documentation as every platform has its own restrictions. |
| 273 | | - | - **svn:** 49323 |
| 274 | | - | |
| 275 | | - | #### Objects |
| 276 | | - | |
| 277 | | - | ##### TRawByteStringCollection |
| 278 | | - | |
| 279 | | - | - **Overview**: A new object type TRawByteStringCollection, similar to TStringCollection, but works with RawByteString/AnsiString |
| 280 | | - | - **git:** 0b8a0fb4 |
| 281 | | - | |
| 282 | | - | ##### TUnicodeStringCollection |
| 283 | | - | |
| 284 | | - | - **Overview**: A new object type TUnicodeStringCollection, similar to TStringCollection, but works with UnicodeString |
| 285 | | - | - **git:** 0b8a0fb4 |
| 286 | | - | |
| 287 | | - | ##### TStream methods for reading and writing RawByteString and UnicodeString |
| 288 | | - | |
| 289 | | - | - **Overview**: New methods have been added to TStream for reading and writing RawByteString/AnsiString and UnicodeString types. |
| 290 | | - | - **Notes**: The following methods have been added: |
| 291 | | - | |
| 292 | | - | `FUNCTION TStream.ReadRawByteString: RawByteString;`\ |
| 293 | | - | `FUNCTION TStream.ReadUnicodeString: UnicodeString;`\ |
| 294 | | - | `PROCEDURE TStream.WriteRawByteString (Const S: RawByteString);`\ |
| 295 | | - | `PROCEDURE TStream.WriteUnicodeString (Const S: UnicodeString);` |
| 296 | | - | |
| 297 | | - | RawByteStrings are written to the stream as a 16-bit code page, followed by 32-bit length, followed by the string contents. UnicodeStrings are written as a 32-bit length (the number of 16-bit UTF-16 code units needed to encode the string), followed by the string itself in UTF-16. |
| 298 | | - | |
| 299 | | - | - **git:** 0b8a0fb4 |
| 300 | | - | |
| 301 | | - | #### Free Vision |
| 302 | | - | |
| 303 | | - | ##### Unicode support |
| 304 | | - | |
| 305 | | - | - **Overview**: Unicode versions of the Free Vision units have been added. |
| 306 | | - | - **Notes**: The Unicode versions of the units have the same name as their non-Unicode counterparts, but with an added 'U' prefix in the beginning of their name. For example, the Unicode version of the 'app' unit is 'uapp', the Unicode version of 'views' is 'uviews', etc. The Unicode versions of the units use the UnicodeString type, instead of shortstrings and pchars. Mixing Unicode and non-Unicode Free Vision units in the same program is not supported and will not work. |
| 307 | | - | - **More information**: [[Free Vision|Free_Vision#Unicode_version]] |
| 308 | | - | - **git:** 0b8a0fb4 |
| 309 | | - | |
| 310 | | - | #### Video |
| 311 | | - | |
| 312 | | - | ##### Unicode output support |
| 313 | | - | |
| 314 | | - | - **Overview**: Unicode video buffer support has been added to the Video unit. |
| 315 | | - | - **Notes**: To use the Unicode video buffer, you must call InitEnhancedVideo instead of InitVideo and finalize the unit with DoneEnhancedVideo instead of DoneVideo. After initializing with InitEnhancedVideo, you must use the EnhancedVideoBuf array instead of VideoBuf. On non-Unicode operating systems, the Video unit will automatically translate Unicode characters to the console code page. This is done transparently to the user application, so new programs can always use EnhancedVideoBuf, without worrying about compatibility. |
| 316 | | - | - **git:** 0b8a0fb4 |
| 317 | | - | |
| 318 | | - | #### Keyboard |
| 319 | | - | |
| 320 | | - | ##### Unicode keyboard input support |
| 321 | | - | |
| 322 | | - | - **Overview**: Unicode keyboard input support has been added to the Keyboard unit. |
| 323 | | - | - **Notes**: After initializing the unit normally via InitKeyboard, you can obtain enhanced key events, which include Unicode character information, as well as an enhanced shift state. To get enhanced key events, use GetEnhancedKeyEvent or PollEnhancedKeyEvent. They return a TEnhancedKeyEvent, which is a record with these fields: |
| 324 | | - | |
| 325 | | - | ` TEnhancedKeyEvent = record`\ |
| 326 | | - | ` VirtualKeyCode: Word; { device-independent identifier of the key }`\ |
| 327 | | - | ` VirtualScanCode: Word; { device-dependent value, generated by the keyboard }`\ |
| 328 | | - | ` UnicodeChar: WideChar; { the translated Unicode character }`\ |
| 329 | | - | ` AsciiChar: Char; { the translated ASCII character }`\ |
| 330 | | - | ` ShiftState: TEnhancedShiftState;`\ |
| 331 | | - | ` Flags: Byte;`\ |
| 332 | | - | ` end;` |
| 333 | | - | |
| 334 | | - | TEnhancedShiftState is a set of TEnhancedShiftStateElement, which is defined as: |
| 335 | | - | |
| 336 | | - | ` TEnhancedShiftStateElement = (`\ |
| 337 | | - | ` essShift, { either Left or Right Shift is pressed }`\ |
| 338 | | - | ` essLeftShift,`\ |
| 339 | | - | ` essRightShift,`\ |
| 340 | | - | ` essCtrl, { either Left or Right Ctrl is pressed }`\ |
| 341 | | - | ` essLeftCtrl,`\ |
| 342 | | - | ` essRightCtrl,`\ |
| 343 | | - | ` essAlt, { either Left or Right Alt is pressed, but *not* AltGr }`\ |
| 344 | | - | ` essLeftAlt,`\ |
| 345 | | - | ` essRightAlt, { only on keyboard layouts, without AltGr }`\ |
| 346 | | - | ` essAltGr, { only on keyboard layouts, with AltGr instead of Right Alt }`\ |
| 347 | | - | ` essCapsLockPressed,`\ |
| 348 | | - | ` essCapsLockOn,`\ |
| 349 | | - | ` essNumLockPressed,`\ |
| 350 | | - | ` essNumLockOn,`\ |
| 351 | | - | ` essScrollLockPressed,`\ |
| 352 | | - | ` essScrollLockOn`\ |
| 353 | | - | ` );` |
| 354 | | - | |
| 355 | | - | A special value NilEnhancedKeyEvent is used to indicate no key event available in the result of PollEnhancedKeyEvent: |
| 356 | | - | |
| 357 | | - | ` { The Nil value for the enhanced key event }`\ |
| 358 | | - | ` NilEnhancedKeyEvent: TEnhancedKeyEvent = (`\ |
| 359 | | - | ` VirtualKeyCode: 0;`\ |
| 360 | | - | ` VirtualScanCode: 0;`\ |
| 361 | | - | ` UnicodeChar: #0;`\ |
| 362 | | - | ` AsciiChar: #0;`\ |
| 363 | | - | ` ShiftState: [];`\ |
| 364 | | - | ` Flags: 0;`\ |
| 365 | | - | ` );` |
| 366 | | - | |
| 367 | | - | - **git:** 0b8a0fb4 |
| 368 | | - | |
| 369 | | - | ## Darwin/macOS platforms |
| 370 | | - | |
| 371 | | - | ### Support for symbolicating Dwarf backtraces |
| 372 | | - | |
| 373 | | - | - **Overview**: The -gl option now works with DWARF debug information on Darwin. This is the default for non-PowerPC Darwin targets, and the only support format for ARM and 64 bit Darwin targets. |
| 374 | | - | - **Notes**: You have to also use the -Xg command line option when compiling the main program or library, to generate a .dSYM bundle that contains all debug information. You can also do this manually by calling *dsymutil* |
| 375 | | - | - **svn**: 49140 |
| 376 | | - | |
| 377 | | - | ## New compiler targets |
| 378 | | - | |
| 379 | | - | ### Support for code generation through LLVM |
| 380 | | - | |
| 381 | | - | - **Overview**: The compiler now has a code generator that generates LLVM bitcode. |
| 382 | | - | - **Notes**: LLVM still requires target-specific support and modifications in the compiler. Initially, the LLVM code generator only works when targeting Darwin/x86-64, Darwin/AArch64 (only macOS; iOS has not been tested), Linux/x86-64, Linux/ARMHF and Linux/AArch64. |
| 383 | | - | - **More information**: [[LLVM]] |
| 384 | | - | - **svn**: 42260 |
| 385 | | - | |
| 386 | | - | ### Support for address sanitizer (asan) through LLVM |
| 387 | | - | |
| 388 | | - | - **Overview**: The compiler allows to check code with the LLVM address sanitizer. |
| 389 | | - | - **Notes**: The LLVM address sanitizer is supported for all 64 bit targets supported by the LLVM code generator. |
| 390 | | - | - **More information**: |
| 391 | | - | - [[LLVM]] |
| 392 | | - | - [Address Sanitizer on Wikipedia](https://en.wikipedia.org/wiki/AddressSanitizer) |
| 393 | | - | - **git**: [403292a1](https://gitlab.com/freepascal.org/fpc/source/-/commit/403292a13151dbc265748d2119f9d1bd52fb9d54) |
| 1 | + | Free Pascal Compiler - User Changes (Release Notes) |
| 394 | 2 | | |
| 395 | | - | ### Support for the Z80 |
| 3 | + | User Changes: |
| 396 | 4 | | |
| 397 | | - | - **Overview**: Support has been added for generating Z80 code. |
| 398 | | - | - **More information**: [[Z80]] |
| 5 | + | [[User Changes 2.2.0|2.2.0]] | [[User Changes 2.2.2|2.2.2]] | [[User Changes 2.2.4|2.2.4]] | [[User Changes 2.4.0|2.4.0]] | [[User Changes 2.4.2|2.4.2]] | [[User Changes 2.4.4|2.4.4]] | [[User Changes 2.6.0|2.6.0]] | [[User Changes 2.6.2|2.6.2]] | [[User Changes 2.6.4|2.6.4]] | [[User Changes 3.0|3.0]] | [[User Changes 3.0.2|3.0.2]] | [[User Changes 3.0.4|3.0.4]] | [[User Changes 3.2.0|3.2.0]] | [[User Changes 3.2.2|3.2.2]] | [[User Changes 3.2.4|3.2.4]] | [[User Changes Trunk|trunk (current development)]] |
| 399 | 6 | | |
| 400 | | - | ### Support for the WebAssembly target |
| 7 | + | New Features: |
| 401 | 8 | | |
| 402 | | - | - **Overview**: Support has been added for generating WebAssembly code. |
| 403 | | - | - **More information**: [[WebAssembly/Compiler]] |
| 9 | + | [[FPC New Features 2.4.2|2.4.2]] | [[FPC New Features 2.4.4|2.4.4]] | [[FPC New Features 2.6.0|2.6.0]] | [[FPC New Features 2.6.2|2.6.2]] | [[FPC New Features 3.0.0|3.0.0]] | [[FPC New Features 3.2.0|3.2.0]] | [[FPC New Features 3.2.2|3.2.2]] | trunk (current development) |
| 404 | 10 | | |
| 405 | 11 | | --- |
| 406 | | - | *From the Free Pascal wiki, page "FPC New Features Trunk", as it stood on 2024-01-27 after a change by Maxim, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
| 407 | | - | Category: FPC New Features by release |
| 408 | | - | Category: Release Notes |
| 12 | + | *From the Free Pascal wiki, page "FPC New Features Trunk", as the Internet Archive kept it on 2026-09-26, last changed on 2026-09-23. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |