Tim Peters | 22a51ef | 2001-12-04 01:11:32 +0000 | [diff] [blame] | 1 | #include "Python.h" |
Guido van Rossum | 49bff65 | 1997-05-20 22:40:26 +0000 | [diff] [blame] | 2 | |
Guido van Rossum | ff7e83d | 1999-08-27 20:39:37 +0000 | [diff] [blame] | 3 | #ifndef DONT_HAVE_STDIO_H |
Guido van Rossum | 2fff2e6 | 1997-01-20 18:34:26 +0000 | [diff] [blame] | 4 | #include <stdio.h> |
Guido van Rossum | ff7e83d | 1999-08-27 20:39:37 +0000 | [diff] [blame] | 5 | #endif |
Guido van Rossum | 2fff2e6 | 1997-01-20 18:34:26 +0000 | [diff] [blame] | 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 | |||||
Guido van Rossum | 2fff2e6 | 1997-01-20 18:34:26 +0000 | [diff] [blame] | 23 | const char * |
Thomas Wouters | f3f33dc | 2000-07-21 06:00:07 +0000 | [diff] [blame] | 24 | Py_GetBuildInfo(void) |
Guido van Rossum | 2fff2e6 | 1997-01-20 18:34:26 +0000 | [diff] [blame] | 25 | { |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 26 | static char buildinfo[50]; |
Tim Peters | a9652f1 | 2006-01-06 02:45:17 +0000 | [diff] [blame^] | 27 | const char *revision = Py_SubversionRevision(); |
28 | const char *sep = *revision ? ":" : ""; | ||||
29 | const char *branch = Py_SubversionShortBranch(); | ||||
Tim Peters | 22a51ef | 2001-12-04 01:11:32 +0000 | [diff] [blame] | 30 | PyOS_snprintf(buildinfo, sizeof(buildinfo), |
Martin v. Löwis | 43b5780 | 2006-01-05 23:38:54 +0000 | [diff] [blame] | 31 | "%s%s%s, %.20s, %.9s", branch, sep, revision, |
32 | DATE, TIME); | ||||
Guido van Rossum | 2fff2e6 | 1997-01-20 18:34:26 +0000 | [diff] [blame] | 33 | return buildinfo; |
34 | } | ||||
Barry Warsaw | ce3a913 | 2005-12-19 14:43:44 +0000 | [diff] [blame] | 35 | |
36 | const char * | ||||
Martin v. Löwis | 43b5780 | 2006-01-05 23:38:54 +0000 | [diff] [blame] | 37 | _Py_svnversion(void) |
Barry Warsaw | ce3a913 | 2005-12-19 14:43:44 +0000 | [diff] [blame] | 38 | { |
Martin v. Löwis | 43b5780 | 2006-01-05 23:38:54 +0000 | [diff] [blame] | 39 | #ifdef SVNVERSION |
40 | return SVNVERSION; | ||||
41 | #else | ||||
42 | return "exported"; | ||||
43 | #endif | ||||
Barry Warsaw | ce3a913 | 2005-12-19 14:43:44 +0000 | [diff] [blame] | 44 | } |