Kevin A. Foss wrote:
The compiler pre-defines `__BORLAND_PASCAL__' etc. depending on the dialect option used or `__GNU_PASCAL__' by default if no dialect option was given (besides `__GPC__' as before, regardless of the dialect used). `__OS_DOS__' is pre-defined on Dos-like systems.
I remember some discussion on the list about this, but never heard what the final verdict was -- can someone give a brief description of what is affected when defining __OS_DOS__. I know at one time things like device names (lptX) and path separators (which I think may be an issue with EMX) were an issue and I was just wondering if anything else was altered.
Well, I think there are two things to consider.
1) Some C routines in the RTS do some OS dependent stuff (like device names). Since __OS_DOS__ is not available in C, they use a combination of #ifdefs. You might want to check them in rts/{bind,file,pexecute}.c. The former two check for `__EMX__', the latter checks for `OS2' and `__MSDOS__', so they should be OK for EMX.
2) __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).
[1] To see exactly what is affected, please see rts/filename.pas. Users of GPC binaries can look at the GPC unit (gpc.pas) which also contains the constants affected by __OS_DOS__ (just search for `__OS_DOS__' in gpc.pas).
Frank
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.
-Kevin
-- Kevin A. Foss --- kfoss@mint.net