Kevin A. Foss wrote:
On Sat, 23 Jan 1999 22:15:55 +0100, Frank Heckenbach wrote:
- __OS_DOS__ is defined in Pascal on Dos like systems (including
EMX). It is defined automatically and should not (need to) be defined by the user. It's used in Pascal parts of the RTS (rts/filename.pas [1], e.g. for directory and path separators), in some standard units (DosUnix and Printer) and is available to user programs (I need it for a few things in my own programs).
Okay this is more what I was concerned about (GPC's behavior with __OS_DOS__ defined) and once I get the system working I'll investigate its effects, my only real issue is that OS/2 can use either / or \ as a directory separator internally and I don't know if that will mess up some routines. In fact you can even mix separators within a path. A quick look at the source doesn't show any problems as most of the routines in filename.pas are looking at DirSeparators rather than DirSeparator and the ones using DirSeparator are mostly 'fixing' paths for the OS -- if I read them correctly.
Yes, exactly. The `DirSeparator' char constant is used when appending a slash or converting paths before passing them to libc routines (though this might not even be necessary, I think it shouldn't hurt), and the `DirSeparators' set of char constant is used when checking for directroy separators. Since the situation is the same on DJGPP, I tested it at least moderately.
BTW, other units might need some porting as well:
CRT needs a curses version, but I suppose either or both ncurses and/or PDCurses should work under OS/2 (probably PDCurses would be preferable for EMX, since it runs under Dos as well), so CRT should work after setting some ifdefs. A few system specific functions (which are not vital, however), can be ported as well, cf. crtdospc.h for the DJGPP version for them.
The printer unit needs porting if you want it to use some native printing capabilities of OS/2. (I don't know if there are any, and what they look like, however.) Otherwise, it will currently use the Dos printer device ('lpt1') which might work under OS/2, but perhaps not be optimal, I don't know.
The system unit contains specific MemAvail/MaxAvail routines for DJGPP and mingw. If you want to port them to EMX, go ahead, otherwise the unit will just use the portable (but in this case less efficient) replacements.
If the shell supports I/O redirections beyond the simple ones that Dos' command.com knows, and their syntax is different from bash's, (like DJGPP's redir utility), the DosUnix unit should be adapted.
If accessing I/O ports requires getting special permissions (like under Linux), the ports unit needs adaption.
A few other units require C libraries that ought to just be recompiled for EMX. Binaries can then be stored on Agnes together with the other library binaries.
Frank
PS: Does EMX work again? Last thing I heard was that it didn't work with GCC 2.8.x. Did you fix it, or did EM finally do something about it?