summaryrefslogtreecommitdiffstats
path: root/Modules/getbuildinfo.c
diff options
context:
space:
mode:
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;
+}