mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
work build# into version string
This commit is contained in:
parent
3bb63a8dbe
commit
2fff2e6b05
2 changed files with 39 additions and 2 deletions
30
Modules/getbuildinfo.c
Normal file
30
Modules/getbuildinfo.c
Normal file
|
@ -0,0 +1,30 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#ifndef DATE
|
||||
#ifdef __DATE__
|
||||
#define DATE __DATE__
|
||||
#else
|
||||
#define DATE "xx/xx/xx"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef TIME
|
||||
#ifdef __TIME__
|
||||
#define TIME __TIME__
|
||||
#else
|
||||
#define TIME "xx:xx:xx"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef BUILD
|
||||
#define BUILD 0
|
||||
#endif
|
||||
|
||||
|
||||
const char *
|
||||
Py_GetBuildInfo()
|
||||
{
|
||||
static char buildinfo[40];
|
||||
sprintf(buildinfo, "#%d, %.12s, %.8s", BUILD, DATE, TIME);
|
||||
return buildinfo;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue