[fpc-devel] M1 and Mac system support?

Sven Barth pascaldragon at googlemail.com
Thu Sep 22 11:09:17 CEST 2022

Richard Hyman via fpc-devel <fpc-devel at lists.freepascal.org> schrieb am
Do., 22. Sep. 2022, 09:00:

> 1.  Does FPC compile natively for the ARM Macs, specifically an M1? Docs I
> found do not directly answer this question (he's thinking about purchasing
> an M1 Mac mini).

This is supported since 3.2.2.

2.  Does FPC provide any support for interfacing to the system?

Aside from interfacing through the C API FPC can also interact with
Objective C objects.

> a.  Can an FPC compiled app be run from the terminal with recognition of
> input parameters (standard I/O). E.G. run something such as "myApp
> /../myInputFile.txt   /../myOutputFile.txt", and have the app parse $1 and
> $2 for the input and output files?

You can access parameter values using the ParamStr functions and then you
need to open the files with the file APilI of your choice.

> If FPC supports standard I/O, how is it accomplished within the app?

FPC supports the standard Pascal I/O using Assign, Read, Write and friends,
an imperative style FileOpen, FileRead, FileWrite API as well as the
TStream based API.

> b.  Does FPC support Mac system APIs? This is a general question since API
> support in any one of several areas (beyond graphics for example) would be
> beneficial.

Since FPC can interact with the system as mentioned above, it does. A unit
with various converted API headers is provided.

Just look at what Lazarus can do. It's a native macOS application and
without interfacing with the macOS API this wouldn't be possible.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20220922/b648008a/attachment.htm>

More information about the fpc-devel mailing list