develooper Front page | perl.perl6.internals | Postings from March 2002

Misc portability cleanups

Thread Next
From:
Melvin Smith
Date:
March 30, 2002 21:50
Subject:
Misc portability cleanups
Message ID:
5.1.0.14.2.20020331003324.0735c5b0@pop.mindspring.com
I did some browsing of the code for potential problems in compiling
for embedded platforms and/or general porting and here are some of the
things I found.

1- assert.h and use of assert()
     assert is easy enough to implement we need to do this and not depend
     on its existence on the target because its not guaranteed.
2- errno.h same thing. Any use of errno is typically a system call, so it 
should
     be wrapped in a platform generic way. On Win32 and WinCE we use
     GetLastError(), on UNIX and many others we can use errno.
3- Use of stat and statbuf.  embed.c needs to be redone without it, period.
     We should go ahead and call the PIO routines instead, and add to PIO 
as needed.
     We can implement a generic stat routine.
4- Configure.pl needs to prompt for targetting another environment and
     have some specific hints file for each targettable environment.
     For WinCE stuff it might be worth querying ENV{} for stuff like CC, 
TARGETCPU,
     PLATFORM, OSVERSION.
5- Other misc includes that should be wrapped in ifdefs are:
     sys/types.h, sys/stat.h, fcntl.h (btw parrot.h includes fcntl.h twice, 
once
     inside an ifdef and then by default).
6- Need to check for definition of size_t and generate one if needed.

Thats enough for now; baby steps. :)

-Melvin


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About