FPC New Features 3.2.0

This is an old revision of FPC New Features 3.2.0, edited by PascalDragon at . The current revision is 133294.

/* Default unit scopes */

About this page

FPC 3.2 has not yet been released. It will be released later this year.

Below you can find a list of new features introduced since the previous release, along with some background information and examples.

A list of changes that may break existing code can be found here.

All systems

Compiler options

Default unit scopes

Language

Support for interfacing with C blocks functionality

Support for Default Namespaces

Dynamic Arrays supported by Insert()

Dynamic Arrays supported by Delete()

Dynamic Arrays supported by Concat()

Dynamic Arrays have built in + operator support

Dynamic Array constants and variable initialization

Dynamic Arrays constructors

More settings supported by $Push/$Pop

Support for threadvar sections inside class and record types

Support for generic routines

unit UTest;
{$mode objfpc}

interface

generic function Add<T>(aArg1, aArg2: T): T;

implementation

generic function Add<T>(aArg1, aArg2: T): T;
begin
  Result := aArg1 + aArg2;
end;

end.
program Test;

{$mode objfpc}{$H+}

uses
  UTest;

begin
  Writeln(specialize Add<String>('Hello', 'World'));
  Writeln(specialize Add<LongInt>(23, 19));
end.

Management operators for record types

Method RTTI for interfaces

Support for helper types extending interface types

Units

Rtti unit

ProcessUnicode unit

Registry unit

IDE

GDB/MI support

(Mac) OS X/iOS

New iosxwstr unit

i8086-msdos

Huge memory model

Internal assembler (object writer)

Internal linker

FarAddr internal function

Near and far procedure variables

type
  TFarProc = procedure(a, b: Integer); far;
  TNearProc = procedure(a, b: Integer); near;

Near procedure variables are 2 bytes long, so they contain only an offset. They are invoked with a near call instruction. Far procedure variables are 4 bytes long (16-bit offset + 16-bit offset) and are invoked with a far call. Note that you cannot simply convert a near procedure to a far procedure, by just filling in the segment part, because the call model is also different between near and far procedures. A far call instruction pushes a 4-byte far (segment:offset) return address and the function must terminate with a far return instruction - retf. A near call instruction pushes only a 2-byte offset on the stack and the function must terminate with a near return instruction - retn.

x86_64-win64

Support for Microsoft's vectorcall calling convention

New compiler targets

Support for the AArch64 target

Support for the Linux/ppc64le target

Support for the i8086-win16 (16-bit Windows) target

New Features from other versions

Lazarus - Release Notes and GIT Branch with Release Fixes

Release notes for Version:

0.9.24 | 0.9.26 | 0.9.28 | 0.9.28.2 | 0.9.30 | 1.0 | 1.2 | 1.4 | 1.6 | 1.8 | 2.0 | 2.2 | 3.0 | 4.0 | 5.0

Fixes branch (How to merge):

0.9 | 1.0 | 1.2 | 1.4 | 1.6 | 1.8 | 2.0 | 2.2 | 3.0 | 4.0

Free Pascal Compiler - User Changes (Release Notes)