Difference between revisions of "FPC New Features Trunk"

From Free Pascal wiki
Jump to navigationJump to search
m (Text replace - "delphi>" to "syntaxhighlight>")
Line 23: Line 23:
 
* '''Overview''': Support has been added to specify the minimum deployment target version of Mac OS X/iOS via a command line parameter, and for determining the specified deployment target version via a macro
 
* '''Overview''': Support has been added to specify the minimum deployment target version of Mac OS X/iOS via a command line parameter, and for determining the specified deployment target version via a macro
 
* '''More information'''
 
* '''More information'''
** Command line parameters: ''-WM10.4'' or ''-WM10.5.3'' and similar for Mac OS X targets, ''-WP4.1'' or ''-WP5.0.1'' and similar for iPhoneOS targets.
+
** Command line parameters: ''-WM10.4'' or ''-WM10.5.3'' and similar for Mac OS X targets, ''-WP4.1'' or ''-WP5.0.1'' and similar for the iPhoneOS/iPhoneSimulator targets.
 
** If no command line parameter with a deployment version is specified, the compiler will look at the ''MACOSX_DEPLOYMENT_TARGET'' resp. ''IPHONEOS_DEPLOYMENT_TARGET'' environment variables to get the deployment target version
 
** If no command line parameter with a deployment version is specified, the compiler will look at the ''MACOSX_DEPLOYMENT_TARGET'' resp. ''IPHONEOS_DEPLOYMENT_TARGET'' environment variables to get the deployment target version
 
** if the deployment target version has not been specified using any of the previous methods, a default will be used (Mac OS X/PPC: 10.3; Mac OS X/PPC64/i386: 10.4; Mac OS X/x86-64: 10.5; iOS/iPhoneSimulator: 3.0)
 
** if the deployment target version has not been specified using any of the previous methods, a default will be used (Mac OS X/PPC: 10.3; Mac OS X/PPC64/i386: 10.4; Mac OS X/x86-64: 10.5; iOS/iPhoneSimulator: 3.0)

Revision as of 19:14, 2 May 2012

About this page

Below you can find a list of new features introduced since the 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.

All systems

Language

Delphi-like namespaces units

  • Overview: Support has been added for unit names with dots.
  • Notes: Delphi-compatible.
  • More information: Unit names with dots creates namespace symbols which always have a precedence over unit names while an identifier search.

Dynamic array constructors

  • Overview: Support has been added for constructing dynamic arrays with class-like constructors.
  • Notes: Delphi-compatible.
  • More information: Only constructor name 'CREATE' is valid for dynamic arrays.
  • Examples: SomeArrayVar := TSomeDynArrayType.Create(value1, value2)

Darwin/Mac OS X

Support for specifying and querying the deployment version

  • Overview: Support has been added to specify the minimum deployment target version of Mac OS X/iOS via a command line parameter, and for determining the specified deployment target version via a macro
  • More information
    • Command line parameters: -WM10.4 or -WM10.5.3 and similar for Mac OS X targets, -WP4.1 or -WP5.0.1 and similar for the iPhoneOS/iPhoneSimulator targets.
    • If no command line parameter with a deployment version is specified, the compiler will look at the MACOSX_DEPLOYMENT_TARGET resp. IPHONEOS_DEPLOYMENT_TARGET environment variables to get the deployment target version
    • if the deployment target version has not been specified using any of the previous methods, a default will be used (Mac OS X/PPC: 10.3; Mac OS X/PPC64/i386: 10.4; Mac OS X/x86-64: 10.5; iOS/iPhoneSimulator: 3.0)
    • Apart from passing the deployment target version number to the linker and linking in the appropriate startup code, the compiler will also define a symbol called MAC_OS_X_VERSION_MIN_REQUIRED resp. IPHONE_OS_VERSION_MIN_REQUIRED containing a value equivalent to the one defined by Apple's Availability.h/AvailabilityMacros.h, i.e. 1043 for Mac OS X 10.4.3, and 40102 for iPhoneOS 4.1.2. Note that this is not a constant that can be used in Pascal expressions, it's only for use by preprocessor statements.
  • Example:
procedure CGImageSourceUpdateDataProvider( isrc: CGImageSourceRef; provider: CGDataProviderRef; final: CBool ); cdecl; external'; {$if MAC_OS_X_VERSION_MIN_REQUIRED >= 1040}external;{$else}weakexternal;{$endif}

See also