FPC New Features 2.6.2

From Free Pascal wiki
Jump to navigationJump to search

English (en)

About this page

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

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; 
  {$if MAC_OS_X_VERSION_MIN_REQUIRED >= 1040}external;{$else}weakexternal;{$endif}

New Features from other versions