| #ifndef DONT_HAVE_STDIO_H |
| /* on unix, SVNVERSION is passed on the command line. |
| * on Windows, the string is interpolated using |
| #define SVNVERSION "$WCRANGE$$WCMODS?M:$" |
| /* XXX Only unix build process has been tested */ |
| static char buildinfo[50 + sizeof(HGVERSION) + |
| ((sizeof(HGTAG) > sizeof(HGBRANCH)) ? |
| sizeof(HGTAG) : sizeof(HGBRANCH))]; |
| const char *revision = _Py_hgversion(); |
| const char *sep = *revision ? ":" : ""; |
| const char *hgid = _Py_hgidentifier(); |
| PyOS_snprintf(buildinfo, sizeof(buildinfo), |
| "%s%s%s, %.20s, %.9s", hgid, sep, revision, |
| /* the following string can be modified by subwcrev.exe */ |
| static const char svnversion[] = SVNVERSION; |
| if (svnversion[0] != '$') |
| return svnversion; /* it was interpolated, or passed on command line */ |
| return "Unversioned directory"; |
| const char *hgtag, *hgid; |
| if ((*hgtag) && strcmp(hgtag, "tip") != 0) |