/* sys_ver.c */

#include "ed/inc/sys_ver.h"

int puts (const char *);

/* Inspired from Antoine Leca f.c.l.c */
void sys_print_ver (void)
{

#define val(q) #q
#define str(q) val(q)

#ifdef __STDC__
   puts ("__STDC__ = '" str (__STDC__) "'");
#else
   puts ("Not standard C compile mode");
#endif

#ifdef __TURBOC__
   puts ("Borland compiler: " str (__TURBOC__));
#endif

#ifdef __GNUC__
#ifndef __GNUC_MINOR__
#define __GNUC_MINOR__ ?
#endif
#ifndef __GNUC_PATCHLEVEL__
#define __GNUC_PATCHLEVEL__ ?
#endif

   puts ("gcc compiler version: "
         str (__GNUC__) "." str (__GNUC_MINOR__)
         "." str (__GNUC_PATCHLEVEL__));
#endif

#ifdef __LCC__
   puts ("lcc or lcc-win32 compiler");
#endif

#ifdef _MSC_VER
   puts ("Microsoft compiler version: " str (_MSC_VER));
#endif

#ifdef __WATCOMC__
   puts ("Watcom compiler version: " str (__WATCOMC__));
#endif

#ifdef __ZTC__
   puts ("Zortech/Symantec/DigitalMars compiler "
         " version: " str (__ZTC__));
#endif

#ifdef __MSDOS__
   puts ("__MSDOS__ is defined");
#endif
#ifdef _WIN32
   puts ("_WIN32 is defined");
#endif
#ifdef _WIN64
   puts ("_WIN64 is defined");
#endif
#ifdef WIN32
   puts ("WIN32 is defined");
#else
   puts ("WIN32 is not defined");
#endif

}
