Sign in Join
Wiki copytemporary

FPC New Features 2.6.2: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: FPC New Features 2.6.2

OldNewLine
1+## About this page
2+
3+Below you can find a list of new features introduced since the [[FPC New Features 2.6.0|previous release]], along with some background information and examples.
4+
5+## Darwin/Mac OS X
6+
7+### Support for specifying and querying the deployment version
8+
9+- **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
10+- **More information**
11+ - 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.
12+ - 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
13+ - 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)
14+ - 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.
15+- **Example**:
16+
17+``` pascal
18+procedure CGImageSourceUpdateDataProvider( isrc: CGImageSourceRef; provider: CGDataProviderRef; final: CBool ); cdecl;
19+ {$if MAC_OS_X_VERSION_MIN_REQUIRED >= 1040}external;{$else}weakexternal;{$endif}
20+```
21+
22+## New Features from other versions
23+
24+---
25+*From the Free Pascal wiki, page "FPC New Features 2.6.2", as it stood on 2020-02-16 after a change by Trev, 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).*

Back to history