Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 57c33af

Browse files
committed
tack compiler name/version to version string if known
1 parent 67ca701 commit 57c33af

1 file changed

Lines changed: 31 additions & 3 deletions

File tree

Modules/config.c.in

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,47 @@ getargcargv(argc,argv)
107107
version number (from patchlevel.h), and the current date (if known
108108
to the compiler, else a manually inserted date). */
109109

110-
#define VERSION "%s (%s)"
110+
#define VERSION "%s (%s)%s"
111111

112112
#ifdef __DATE__
113113
#define DATE __DATE__
114114
#else
115-
#define DATE "Aug 17 1994"
115+
#define DATE "Feb 13 1995"
116+
#endif
117+
118+
#ifdef THINK_C
119+
#define COMPILER " [THINK C]"
120+
#endif
121+
122+
#ifdef __MWERKS__
123+
#ifdef __powerc
124+
#define COMPILER " [CW PPC]"
125+
#else
126+
#define COMPILER " [CW 68K]"
127+
#endif
128+
#endif
129+
130+
#ifdef MPW
131+
#ifdef __SC__
132+
#define COMPILER " [Symantec MPW]"
133+
#else
134+
#define COMPILER " [Apple MPW]"
135+
#endif
136+
#endif
137+
138+
#ifdef __GNUC__
139+
#define COMPILER " [GCC " ##__VERSION__ "]"
140+
#endif
141+
142+
#ifndef COMPILER
143+
#define COMPILER ""
116144
#endif
117145

118146
char *
119147
getversion()
120148
{
121149
static char version[80];
122-
sprintf(version, VERSION, PATCHLEVEL, DATE);
150+
sprintf(version, VERSION, PATCHLEVEL, DATE, COMPILER);
123151
return version;
124152
}
125153

0 commit comments

Comments
 (0)