Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2019-04

sharing units between lazarus and delphi

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Andrea Mauri

Dear all,
I have a project fully developed on Lazarus. It is a desktop application running on win, linux and mac.
I would like to test Delphi in order to try to build a mobile application using my lazarus units.
I can suppose to divide my units in those that should act exactly the same and those that should be modified.
The first group belongs to not graphical units, the second group includes units that uses the canvas.
What should be the preferable way to make my units compilable both by fpc/Lazarus and Delphi?
Is it better to use MODE DELPHI or is it better to introduce IFDEFs all along the code? (e.g. for different usage of @ between fpc and delphi). What are the pros and cons of the two strategies?
Code compiled using MODEL DELPHI is comparable, e.g. in terms of performance, to code compiled using OBJFPC?

Any hint is really appreciated.
Andrea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190401/c0e0c554/attachment.html>

Reply by email

Sven Barth
to Andrea Mauri

Andrea Mauri via lazarus schrieb am Mo., 1.
Apr. 2019, 13:08:

Show quoted text 8 lines
What should be the preferable way to make my units compilable both by fpc/Lazarus and Delphi? Is it better to use MODE DELPHI or is it better to introduce IFDEFs all along the code? (e.g. for different usage of @ between fpc and delphi). What are the pros and cons of the two strategies? Code compiled using MODEL DELPHI is comparable, e.g. in terms of performance, to code compiled using OBJFPC?

One of the main purposes of the Delphi mode *is* to be able to easily share code between FPC and Delphi. So yes, that is the recommended way. Also I'm not aware of any features that would have a difference in performance in those two modes.

Regards,
Sven

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190401/ca077b87/attachment.html>

Reply by email