<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 11/01/2024 16:34, Marco van de Voort
via fpc-devel wrote:<br>
</div>
<blockquote type="cite"
cite="mid:287fa0f6-0d16-458f-ba05-a58519d25388@pascalprogramming.org">
<br>
Op 11-1-2024 om 15:48 schreef Martin Frb via fpc-devel:
<br>
<blockquote type="cite">- Can (on any linux/unix) "uses SysCall"
be compiled (without error)
<br>
</blockquote>
<br>
You can test that yourself on a Linux system by compiling a cycle
with -dFPC_USE_LIBC and then compiling a test program (without
defines) Since there was a bugfix necessary, I assume not.
<br>
</blockquote>
<br>
Not necessary. (as far as I understand the comments that had been
made already)<br>
-dFPC_USE_LIBC would not change the os target to sunos. And
therefore FPC would not look at the tsysteminfo containing<br>
extradefines : 'UNIX;LIBC;SUNOS;HASUNIX';
<br>
<br>
-dFPC_USE_LIBC would just affect the "uses SysCall" (and that
hopefully in *exactly* the same manner as compiling on sunos)<br>
<br>
<br>
<blockquote type="cite"
cite="mid:287fa0f6-0d16-458f-ba05-a58519d25388@pascalprogramming.org">
<br>
<blockquote type="cite">- Does it need to be guarded {$IFnDEF
LIBC} ?
<br>
</blockquote>
<br>
That define would be FPC_USE_LIBC. But afaik that is only defined
ad hoc on spots where it is needed during the FPC compilation.
I.e. it is set in the build system rather than being a compiler
built in. So no.
<br>
</blockquote>
<br>
Sure?<br>
<br>
-dFPC_USE_LIBC would be specified be the user or Makefile when
the fpc/rtl is build.<br>
<br>
But when an fpc (that had been build with -dFPC_USE_LIBC ) is used
to compile a random project, will then this fpc by tiself define
-dFPC_USE_LIBC (without the user needing to do so?)<br>
<br>
--------------------------<br>
<br>
I have 2 different concerns<br>
<br>
1) What happens on sunos? <br>
(Where the compiler defaults to LIBC)<br>
<br>
That is the case I wont to cover.<br>
<br>
2) What happens, if the user "tampers" with settings building a non
default fpc.<br>
<br>
That 2nd part is not that important in respect to my questions in
this mail.<br>
If the user does that, then (when compiling lazarus or any project)<br>
- no special define may be set by FPC (and that is ok) <br>
- the user may have to set a define according to the project
(lazarus could offer a workaround define)<br>
<br>
<br>
-----------------------------<br>
as for point 1<br>
To make sure it compiles with<br>
- normal build fpc on linux/darwin<br>
- normal build fpc on sunos<br>
<br>
<br>
<pre>{$ifdef linux}
uses SysCall;
{$endif}</pre>
<pre>
{$ifdef darwin}
{$DEFINE FPDEBUG_USE_LIBC} // darwin: always libc
{$else}
{$IF not declared(Do_SysCall)} // Linux, but no Do_SysCall
{$IFDEF LIBC} // Does this define ever exist (by fpc)
{$DEFINE FPDEBUG_USE_LIBC} // no DoSysCall ==> use libc
{$ELSE}
{$DEFINE FPDEBUG_USE_DUMMY} // no DoSysCall ==> empty dummy proc
{$ENDIF}
{$ENDIF}
// ELSE: Do_Syscall exists and can be used
{$endif}</pre>
<br>
<br>
Will that work?<br>
==>> Will (on linux, including sunos) <br>
"uses SysCall" <br>
compile (not throw an error during compilation). (that is for NORMAL
/ non-tampered FPC)<br>
<br>
If yes, then that should work. (even if LIBC isn't defined)<br>
If yes, then I can check if "DoSysCall" can be used<br>
<br>
<br>
</body>
</html>