<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Bo Berglund via lazarus <<a href="mailto:lazarus@lists.lazarus-ide.org">lazarus@lists.lazarus-ide.org</a>> schrieb am So., 10. Nov. 2019, 23:29:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have ported a console application from Windows to Linux (Raspbian<br>
Buster) and I got to wonder about the check for a defined symbol<br>
appearing in the beginning of the code as produced by the Lazarus<br>
template:<br>
<br>
uses<br>
{$IFDEF UNIX}{$IFDEF UseCThreads}<br>
cthreads,<br>
{$ENDIF}{$ENDIF}<br>
<br>
Would it not be enough to use this instead:<br>
uses<br>
{$IFDEF UNIX}<br>
cthreads,<br>
{$ENDIF}<br>
<br>
Is there a heavy hit on perfortmance or such if the conditional is not<br>
used but instead just checking if we are on UNIX?<br>
<br>
What happens if one does not use threads in ones code but removes the<br>
conditional UseCThreads as shown above?<br>
<br>
For example if I am using Indy10 objects they are threaded so in that<br>
case I assume I need to use cthreads. But in any other case, how can I<br>
know that some used package might rely on threads and so needs this<br>
uses clause?<br>
<br>
Basically:<br>
What damage does it do if cthreads are in the uses clause but no<br>
thread appears in the program code (yet)?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">The "damage" is that your application will link against the C library. Sometimes that's not desirable and quite some FPC code can be used without that (e.g. the compiler itself does not need to link against the C library and thus the binary is usable on various Linux distributions and versions). </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>