Mail Archives: djgpp/2002/11/10/15:00:20
"Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il> wrote in message news:Pine DOT SUN DOT 3 DOT 91 DOT 1021027161818 DOT 3459A-100000 AT is...
>
> On 27 Oct 2002, Rafal 'Raf256' Maj wrote:
>
> > I know about __GNUC__, __DJGPP__, are there more informations like this ?
>
> __DJGPP_MINOR__ might also be of interest.
>
> What other info are you interested in? Is it only versions of various
> tools or something else?
1. About __DJGPP_MINOR__ .
Here is some program :
--------- C++-code : BEGIN ---------
// File t1.cpp
#include <iostream>
using namespace std;
int main()
{
#ifdef __GNUC__
cout << "GNU gcc : " << __GNUC__ << "." << __GNUC_MINOR__ << "." << __GNUC_PATCHLEVEL__ << endl;
#endif
#ifdef __DJGPP__
cout << "DJGPP : " << __DJGPP__ << "." << __DJGPP_MINOR__ << endl;
#endif
return 0;
}
--------- C++-code : END -----------
--------- Compilation & Run : BEGIN ---------
% gpp t1.cpp
GNU gcc : 3.1.0
DJGPP : 2.3 ### So, __DJGPP_MINOR__ == 3
% redir -eo gpp -v t1.cpp | C:\cygwin\bin\tr.exe " " "\n" | grep "\-D" | sort
-D__DEPRECATED
-D__DJGPP__=2
-D__DJGPP__=2
-D__EXCEPTIONS
-D__GNUC__=3
-D__GNUC_MINOR__=1
-D__GNUC_PATCHLEVEL__=0
-D__GNUG__=3
-D__GO32__
-D__GO32__
-D__GXX_ABI_VERSION=100
-D__i386
-D__i386__
-D__MSDOS__
-D__MSDOS__
-D__NO_INLINE__
-D__STDC_HOSTED__=1
-D__tune_i586__
-D__tune_pentium__
-D__unix__
-D__unix__
-DDJGPP=2
-DGO32
-Di386
-DMSDOS
-Dunix
### __DJGPP_MINOR__ is absent in a list above.
--------- Compilation & Run : END -----------
Where does my program (t1.cpp) take __DJGPP_MINOR__ from ?
2. Another question.
We see that the following values are defined : __MSDOS__ and __unix__.
How can a program know where it is compiled : on MSDOS, on UNIX, on Windows 95/98/2000 etc.
Thanks in advance.
==================
Alex Vinokur
mailto:alexvn AT go DOT to
http://go.to/alexvn
==================
- Raw text -