Question

Since XE2 the Delphi units are scoped.

Unit Scope Names

Unit Names

Is is right to say that if I use only System and Data scoped units my code will be multiplatform and compiled for both Mac and Windows targets?

and the rest of the Vcl, Winapi, and Posix references must be governed by conditional compilation platform symbols?

Was it helpful?

Solution

Data - in general, no. For example, Data.DBXMsSQL (SQL Server dbExpress driver) is supported on Windows only. Also System and Data "root" scopes may have Win subscope, supported on Windows only. For example, Data.Win.ADODB (dbGo) or System.Win.Registry (Windows registry). Beside that System and Data are crossplatform. Additionally to Data the DataSnap scope is crossplatform.

Vcl, Winapi, and Posix you can IFDEF. Other option is to create and use platform specific application units and IFDEF them in uses.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top