On Thu, 29 May 1997, The African Chief wrote:
On Wed, 28 May 1997 19:41:17 +0200 (MET DST) Peter Gerwinski peter@agnes.dida.physik.uni-essen.de wrote:
Is it possible to tell which GPC platform and version is being used? [...] This would really help in writing portable code. What do you think?
I agree in complete. Let's ask the list what they think, but I am almost sure that everybody will agree.
Ok. I am sending this response to the list.
[...] So, can this be done with GPC? It would help with a lot of things, e.g., in the SYSTEM unit - so, could we have these pre-defined in GPC; __LINUX__ __UNIX__ __DJGPP__ (or __MSDOS__) __EMX__ (or __OS2__) __WIN32__ (or __CYGWIN__)
- depending on which GPC port you are using.
They *are* defined Run gpc -v and see what's defined if gpc-cpp is executed.
Since `__MSDOS__' is ambiguous and with EMX one and the same executable runs on DOS as well as on OS/2 making this a run-time, not a compile-time decision, I vote for `__DJGPP__' and `__EMX__' rather than `__MSDOS__' and `__OS2__'.
Yes, I agree.
Since I agree with "xxxx" that Windows 95/NT is not a "win" in the sence of hacker's speech (see `jarg400.info.gz' from the GNU distribution), but Cygnus is, I'd vote for `__CYGWIN__' rather than `__WIN32__', although "Win32" is the official name of that API.
Yes, "__CYGWIN__" seems fine.
No. Read back the cygwin32 mailinglists. cygwin32 defines __CYGWIN32__ for code specific for the cygwin32 environment. It also defines _WIN32 for the more generic win32 dependencies. It used to define __WIN32__ but they don't do that anymore because they figured out that cygwin.dll wasn't presenting a WIN32 API (that's in kernel32, user32.dll etc. from M$)
DJGPP specific stuff (read: _go32_xxx and _dpmi_xxx functions) are best surrounded by __DJGPP__ MS-DOS related code (lets's see, something about CRLF conversions for example) should be surrounded by __MSDOS__ because it applies to EMX too.
and you could have; __VER20__
or whatever, depending on the GPC version.
See __GPC_MAJOR__ and __GPC_MINOR__
Greetings, JanJaap
--- With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC1925.