Op Thu, 31 Jan 2008, schreef Graeme Geldenhuys:
On 31/01/2008, Marco van de Voort <[EMAIL PROTECTED]> wrote:
Something like
{$ifdef cpu386}
{$ifdef linux}
{$define linux386}
{$endif}
{$endif}
Wow you guys reply quickly. :) The above code doesn't look nice
either, so I think I will rather implement a alternative.
All I really use 'libc' for is to retrieve the user name and group
name from the user and group id's of files. As I said, it's not
critical, I can always display the id's only. Or maybe parse the
/etc/groups and /etc/passwd files to get the names, but I heard that's
not very accurate for some reason.
Thanks again Marco and Daniël for the quick replies!
Rather than use the libc unit, you might want to declare getpwent in your
own code; a few naming service procedures are a whole lot easier to keep
portable than the entire libc unit.
This doesn't guarantee you anything (getpwent could well be a
macro on a random unix), but it wouldn't be that much work to make it
work on the known Unixes.
Daniël
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel