[Lazarus] sharing units between lazarus and delphi

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] sharing units between lazarus and delphi

Free Pascal - Lazarus mailing list
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



--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] sharing units between lazarus and delphi

Free Pascal - Lazarus mailing list
Andrea Mauri via lazarus <[hidden email]> schrieb am Mo., 1. Apr. 2019, 13:08:
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 

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus