annotate PC/make_versioninfo.c @ 80661:94de77bd0b4b 2.7

Issue #16194: document imp.load_dynamic problems when read several extension modules from the same binary object file.
author Andrew Svetlov <andrew.svetlov@gmail.com>
date Thu, 29 Nov 2012 19:51:28 +0200
parents fd25030223b0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30747
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
1 #include <stdio.h>
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
2 #include "patchlevel.h"
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
3 /*
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
4 * This program prints out an include file containing fields required to build
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
5 * the version info resource of pythonxx.dll because the resource compiler
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
6 * cannot do the arithmetic.
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
7 */
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
8 /*
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
9 * FIELD3 is the third field of the version number.
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
10 * This is what we'd like FIELD3 to be:
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
11 *
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
12 * #define FIELD3 (PY_MICRO_VERSION*1000 + PY_RELEASE_LEVEL*10 + PY_RELEASE_SERIAL)
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
13 *
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
14 * but that neither gives an error nor comes anywhere close to working.
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
15 *
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
16 * For 2.4a0,
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
17 * PY_MICRO_VERSION = 0
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
18 * PY_RELEASE_LEVEL = 'alpha' = 0xa
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
19 * PY_RELEASE_SERIAL = 0
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
20 *
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
21 * gives FIELD3 = 0*1000 + 10*10 + 0 = 100
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
22 */
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
23 int main(int argc, char **argv)
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
24 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 41716
diff changeset
25 printf("/* This file created by make_versioninfo.exe */\n");
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 41716
diff changeset
26 printf("#define FIELD3 %d\n",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 41716
diff changeset
27 PY_MICRO_VERSION*1000 + PY_RELEASE_LEVEL*10 + PY_RELEASE_SERIAL);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 41716
diff changeset
28 printf("#define MS_DLL_ID \"%d.%d\"\n",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 41716
diff changeset
29 PY_MAJOR_VERSION, PY_MINOR_VERSION);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 41716
diff changeset
30 printf("#ifndef _DEBUG\n");
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 41716
diff changeset
31 printf("#define PYTHON_DLL_NAME \"python%d%d.dll\"\n",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 41716
diff changeset
32 PY_MAJOR_VERSION, PY_MINOR_VERSION);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 41716
diff changeset
33 printf("#else\n");
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 41716
diff changeset
34 printf("#define PYTHON_DLL_NAME \"python%d%d_d.dll\"\n",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 41716
diff changeset
35 PY_MAJOR_VERSION, PY_MINOR_VERSION);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 41716
diff changeset
36 printf("#endif\n");
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 41716
diff changeset
37 return 0;
30747
77d5308bedae This commit was manufactured by cvs2svn to create branch
cvs2svn <tools@python.org>
parents:
diff changeset
38 }