summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
Diffstat (limited to 'PC')
-rw-r--r--PC/.cvsignore2
-rw-r--r--PC/make_versioninfo.c33
-rw-r--r--PC/python_nt.rc38
3 files changed, 39 insertions, 34 deletions
diff --git a/PC/.cvsignore b/PC/.cvsignore
new file mode 100644
index 0000000..df8a29e
--- /dev/null
+++ b/PC/.cvsignore
@@ -0,0 +1,2 @@
+pythonnt_rc.h
+pythonnt_rc_d.h
diff --git a/PC/make_versioninfo.c b/PC/make_versioninfo.c
new file mode 100644
index 0000000..41c026f
--- /dev/null
+++ b/PC/make_versioninfo.c
@@ -0,0 +1,33 @@
+#include <stdio.h>
+#include "patchlevel.h"
+/*
+ * This program prints out an include file containing fields required to build
+ * the version info resource of pythonxx.dll because the resource compiler
+ * cannot do the arithmetic.
+ */
+/*
+ * FIELD3 is the third field of the version number.
+ * This is what we'd like FIELD3 to be:
+ *
+ * #define FIELD3 (PY_MICRO_VERSION*1000 + PY_RELEASE_LEVEL*10 + PY_RELEASE_SERIAL)
+ *
+ * but that neither gives an error nor comes anywhere close to working.
+ *
+ * For 2.4a0,
+ * PY_MICRO_VERSION = 0
+ * PY_RELEASE_LEVEL = 'alpha' = 0xa
+ * PY_RELEASE_SERIAL = 0
+ *
+ * gives FIELD3 = 0*1000 + 10*10 + 0 = 100
+ */
+int main(int argc, char **argv)
+{
+ printf("/* This file created by make_versioninfo.exe */\n");
+ printf("#define FIELD3 %d\n",
+ PY_MICRO_VERSION*1000 + PY_RELEASE_LEVEL*10 + PY_RELEASE_SERIAL);
+ printf("#define MS_DLL_ID \"%d.%d\"\n",
+ PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ printf("#define PYTHON_DLL_NAME \"python%d%d.dll\"\n",
+ PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ return 0;
+}
diff --git a/PC/python_nt.rc b/PC/python_nt.rc
index 8b3858b..3cdc93c 100644
--- a/PC/python_nt.rc
+++ b/PC/python_nt.rc
@@ -6,42 +6,12 @@
#define MS_WINDOWS
#include "modsupport.h"
#include "patchlevel.h"
-
-/* Across releases, change:
- * MS_DLL_ID if the minor version number changes.
- * PYTHON_DLL_NAME ditto.
- * MS_DLL_ID must match PY_VERSION in the Windows install script.
- */
-#define MS_DLL_ID "2.4"
-
-#ifndef PYTHON_DLL_NAME
-#define PYTHON_DLL_NAME "python24.dll"
+#ifdef _DEBUG
+# include "pythonnt_rc_d.h"
+#else
+# include "pythonnt_rc.h"
#endif
-/* Nothing below this should need to be changed except for copyright
- * notices, company name, and FIELD3. Unfortunately, all attempts
- * to get the resource compiler to do arithmetic in macros have
- * failed miserably -- it gives syntax errors, ignores operators,
- * or does stuff that's simply bizarre.
- */
-
-
-/* This is what we'd like FIELD3 to be:
- *
- * #define FIELD3 (PY_MICRO_VERSION*1000 + PY_RELEASE_LEVEL*10 + PY_RELEASE_SERIAL)
- *
- * but that neither gives an error nor comes anywhere close to working. The
- * following comment and #define are output from PCbuild\field3.py:
- *
- * For 2.4a0,
- * PY_MICRO_VERSION = 0
- * PY_RELEASE_LEVEL = 'alpha' = 0xa
- * PY_RELEASE_SERIAL = 0
- *
- * and 0*1000 + 10*10 + 0 = 100
- */
-#define FIELD3 100
-
/* e.g., 2.1a2
* PY_VERSION comes from patchevel.h
*/