summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorNikita Nemkin <nikita@nemkin.ru>2020-06-23 19:05:57 (GMT)
committerGitHub <noreply@github.com>2020-06-23 19:05:57 (GMT)
commit4efc3360c9a83d5891f27ed67b4f0ab7275d2ab4 (patch)
treee9a69c77b7ada22a765eb6258eef296abdd80543 /PC
parent930f4518aea7f3f0f914ce93c3fb92831a7e1d2a (diff)
downloadcpython-4efc3360c9a83d5891f27ed67b4f0ab7275d2ab4.zip
cpython-4efc3360c9a83d5891f27ed67b4f0ab7275d2ab4.tar.gz
cpython-4efc3360c9a83d5891f27ed67b4f0ab7275d2ab4.tar.bz2
bpo-41054: Simplify resource compilation on Windows (GH-21004)
Remove auto-generated resource header. Pass definitions required by resource files (ORIGINAL_FILENAME and FIELD3) directly to resource compiler. Remove unused MS_DLL_ID resource string and related dead code.
Diffstat (limited to 'PC')
-rw-r--r--PC/dl_nt.c13
-rw-r--r--PC/python_nt.rc8
-rw-r--r--PC/python_ver_rc.h1
3 files changed, 2 insertions, 20 deletions
diff --git a/PC/dl_nt.c b/PC/dl_nt.c
index 0bf04f1..7f17ee1 100644
--- a/PC/dl_nt.c
+++ b/PC/dl_nt.c
@@ -12,16 +12,10 @@ forgotten) from the programmer.
#include "windows.h"
#ifdef Py_ENABLE_SHARED
-#ifdef MS_DLL_ID
-// The string is available at build, so fill the buffer immediately
-char dllVersionBuffer[16] = MS_DLL_ID;
-#else
-char dllVersionBuffer[16] = ""; // a private buffer
-#endif
// Python Globals
HMODULE PyWin_DLLhModule = NULL;
-const char *PyWin_DLLVersionString = dllVersionBuffer;
+const char *PyWin_DLLVersionString = MS_DLL_ID;
BOOL WINAPI DllMain (HANDLE hInst,
ULONG ul_reason_for_call,
@@ -31,11 +25,6 @@ BOOL WINAPI DllMain (HANDLE hInst,
{
case DLL_PROCESS_ATTACH:
PyWin_DLLhModule = hInst;
-#ifndef MS_DLL_ID
- // If we have MS_DLL_ID, we don't need to load the string.
- // 1000 is a magic number I picked out of the air. Could do with a #define, I spose...
- LoadString(hInst, 1000, dllVersionBuffer, sizeof(dllVersionBuffer));
-#endif
break;
case DLL_PROCESS_DETACH:
diff --git a/PC/python_nt.rc b/PC/python_nt.rc
index fac6105..b5fb58f 100644
--- a/PC/python_nt.rc
+++ b/PC/python_nt.rc
@@ -7,12 +7,6 @@
#include <winuser.h>
2 RT_MANIFEST "python.manifest"
-// String Tables
-STRINGTABLE DISCARDABLE
-BEGIN
- 1000, MS_DLL_ID
-END
-
/////////////////////////////////////////////////////////////////////////////
//
// Version
@@ -40,7 +34,7 @@ BEGIN
VALUE "FileVersion", PYTHON_VERSION
VALUE "InternalName", "Python DLL\0"
VALUE "LegalCopyright", PYTHON_COPYRIGHT "\0"
- VALUE "OriginalFilename", PYTHON_DLL_NAME "\0"
+ VALUE "OriginalFilename", ORIGINAL_FILENAME "\0"
VALUE "ProductName", "Python\0"
VALUE "ProductVersion", PYTHON_VERSION
END
diff --git a/PC/python_ver_rc.h b/PC/python_ver_rc.h
index f95e755..c318d44 100644
--- a/PC/python_ver_rc.h
+++ b/PC/python_ver_rc.h
@@ -9,7 +9,6 @@
#define MS_WINDOWS
#include "modsupport.h"
#include "patchlevel.h"
-#include <pythonnt_rc.h>
#ifdef _DEBUG
# define PYTHON_DEBUG_EXT "_d"
#else