blob: b9f9b88fe3a073328c7202270e25ad96474bc277 [file] [log] [blame]
Thomas Heller13dbabe2003-10-10 16:57:45 +00001#include <stdio.h>
2#include "patchlevel.h"
3/*
4 * This program prints out an include file containing fields required to build
5 * the version info resource of pythonxx.dll because the resource compiler
6 * cannot do the arithmetic.
7 */
8/*
9 * FIELD3 is the third field of the version number.
10 * This is what we'd like FIELD3 to be:
11 *
12 * #define FIELD3 (PY_MICRO_VERSION*1000 + PY_RELEASE_LEVEL*10 + PY_RELEASE_SERIAL)
13 *
14 * but that neither gives an error nor comes anywhere close to working.
15 *
16 * For 2.4a0,
17 * PY_MICRO_VERSION = 0
18 * PY_RELEASE_LEVEL = 'alpha' = 0xa
19 * PY_RELEASE_SERIAL = 0
20 *
21 * gives FIELD3 = 0*1000 + 10*10 + 0 = 100
22 */
23int main(int argc, char **argv)
24{
25 printf("/* This file created by make_versioninfo.exe */\n");
26 printf("#define FIELD3 %d\n",
27 PY_MICRO_VERSION*1000 + PY_RELEASE_LEVEL*10 + PY_RELEASE_SERIAL);
28 printf("#define MS_DLL_ID \"%d.%d\"\n",
29 PY_MAJOR_VERSION, PY_MINOR_VERSION);
Guido van Rossum360e4b82007-05-14 22:51:27 +000030 printf("#ifndef _DEBUG\n");
Thomas Heller13dbabe2003-10-10 16:57:45 +000031 printf("#define PYTHON_DLL_NAME \"python%d%d.dll\"\n",
32 PY_MAJOR_VERSION, PY_MINOR_VERSION);
Guido van Rossum360e4b82007-05-14 22:51:27 +000033 printf("#else\n");
34 printf("#define PYTHON_DLL_NAME \"python%d%d_d.dll\"\n",
35 PY_MAJOR_VERSION, PY_MINOR_VERSION);
36 printf("#endif\n");
Thomas Heller13dbabe2003-10-10 16:57:45 +000037 return 0;
38}