summaryrefslogtreecommitdiffstats
path: root/Modules/getbuildinfo.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-01-20 18:34:26 (GMT)
committerGuido van Rossum <guido@python.org>1997-01-20 18:34:26 (GMT)
commit2fff2e6b05b8eb11898186f218d1656ec64a6091 (patch)
tree57c0be226e1e5293275df623edbd2bcaf7386379 /Modules/getbuildinfo.c
parent3bb63a8dbe19592641330a8f1e12bec5dfd147d2 (diff)
downloadcpython-2fff2e6b05b8eb11898186f218d1656ec64a6091.zip
cpython-2fff2e6b05b8eb11898186f218d1656ec64a6091.tar.gz
cpython-2fff2e6b05b8eb11898186f218d1656ec64a6091.tar.bz2
work build# into version string
Diffstat (limited to 'Modules/getbuildinfo.c')
-rw-r--r--Modules/getbuildinfo.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/Modules/getbuildinfo.c b/Modules/getbuildinfo.c
new file mode 100644
index 0000000..0bf031a
--- /dev/null
+++ b/Modules/getbuildinfo.c
@@ -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;
+}