TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Francois Thunus
from: hugo landsman
date: 1996-04-24 12:31:16
subject: compiler ID

hi Francois,

 FT> most compiler (if not all) have an internal ID number  which can be
 FT> used either to display the compiler characteristics or to maintain
 FT> multiple source. for example

 FT>  printf("Compiled on "__DATE__" {at} "
__TIME__".");
 FT> #if defined(__ZTC__)
 FT>   printf(" with Zortech C++ ver. %x.%xr%x\n",
 FT>             __ZTC__ >> 8, (__ZTC__ >> 4) & 0xf,
__ZTC__ & 0xf);
 FT> #elif defined(__POWERC)
 FT>       printf (" with MIX Power C ver. %d.%d
 FT> \n",(__POWERC/100),(__POWERC%100)); #endif

 FT> My question is: what are the internal codes for GNU C, dos and os/2
 FT> versions ?

Why don't you read the documentation yourself?   It is the fastest way to
answer your questions...   From \emx\info\cpp.inf &
\emx\{doc\emxlib.doc|book\emxlib.inf}:

#elif defined(__GNUC__)
    printf(" with GNU C ver. %d.%d, emx RTL ver. %s, operating in
%s-mode\n",
        __GNUC__, __GNUC_MINOR__, _emx_vptr, (_osmode == DOS_MODE ?
"DOS" : "OS/2"));

See also _emx_env, _osmajor and _osminor.

regards,
         hugo
* Origin: huug{at}telebyte.nl (2:283/608.5)
SEEN-BY: 50/99 78/0 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 283/608 2802/40 777 28/777 2/777 396/1 270/101 712/515 711/808 809
@PATH: 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.