equal
deleted
inserted
replaced
|
1 #include "Python.h" |
|
2 |
|
3 #ifndef DONT_HAVE_STDIO_H |
|
4 #include <stdio.h> |
|
5 #endif |
|
6 |
|
7 #ifndef DATE |
|
8 #ifdef __DATE__ |
|
9 #define DATE __DATE__ |
|
10 #else |
|
11 #define DATE "xx/xx/xx" |
|
12 #endif |
|
13 #endif |
|
14 |
|
15 #ifndef TIME |
|
16 #ifdef __TIME__ |
|
17 #define TIME __TIME__ |
|
18 #else |
|
19 #define TIME "xx:xx:xx" |
|
20 #endif |
|
21 #endif |
|
22 |
|
23 /* on unix, SVNVERSION is passed on the command line. |
|
24 * on Windows, the string is interpolated using |
|
25 * subwcrev.exe |
|
26 */ |
|
27 #ifndef SVNVERSION |
|
28 #define SVNVERSION "$WCRANGE$$WCMODS?M:$" |
|
29 #endif |
|
30 |
|
31 const char * |
|
32 Py_GetBuildInfo(void) |
|
33 { |
|
34 static char buildinfo[50]; |
|
35 const char *revision = Py_SubversionRevision(); |
|
36 const char *sep = *revision ? ":" : ""; |
|
37 const char *branch = Py_SubversionShortBranch(); |
|
38 PyOS_snprintf(buildinfo, sizeof(buildinfo), |
|
39 "%s%s%s, %.20s, %.9s", branch, sep, revision, |
|
40 DATE, TIME); |
|
41 return buildinfo; |
|
42 } |
|
43 |
|
44 const char * |
|
45 _Py_svnversion(void) |
|
46 { |
|
47 /* the following string can be modified by subwcrev.exe */ |
|
48 static const char svnversion[] = SVNVERSION; |
|
49 if (svnversion[0] != '$') |
|
50 return svnversion; /* it was interpolated, or passed on command line */ |
|
51 return "exported"; |
|
52 } |