Skip to content

[3.12] Moved most extension modules to the pythoncore project file (GH-107463) #107480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Modules/_ctypes/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,12 @@ STDAPI DllCanUnloadNow(void)
return result;
}

/*
* When this is included in the pythoncore Visual Studio project
* this results in the following compile error:
* "dl_nt.obj : error LNK2005: DllMain already defined in callbacks.obj"
*/
#ifndef Py_BUILD_CORE
#ifndef Py_NO_ENABLE_SHARED
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvRes)
{
Expand All @@ -602,6 +608,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvRes)
return TRUE;
}
#endif
#endif

#endif

Expand Down
55 changes: 55 additions & 0 deletions PC/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,33 @@ extern PyObject* PyInit__tokenize(void);

extern PyObject* PyMarshal_Init(void);
extern PyObject* PyInit__imp(void);
extern PyObject* PyInit__asyncio(void);
extern PyObject* PyInit__bz2(void);
extern PyObject* PyInit__ctypes(void);
extern PyObject* PyInit__decimal(void);
extern PyObject* PyInit__elementtree(void);
extern PyObject* PyInit__hashlib(void);
extern PyObject* PyInit__lzma(void);
#ifdef MS_WINDOWS
extern PyObject* PyInit__msi(void);
#endif
extern PyObject* PyInit__multiprocessing(void);
#ifdef MS_WINDOWS
extern PyObject* PyInit__overlapped(void);
#endif
extern PyObject* PyInit__queue(void);
extern PyObject* PyInit__socket(void);
extern PyObject* PyInit__sqlite3(void);
extern PyObject* PyInit__ssl(void);
extern PyObject* PyInit__uuid(void);
extern PyObject* PyInit__zoneinfo(void);
extern PyObject* PyInit_pyexpat(void);
extern PyObject* PyInit_select(void);
extern PyObject* PyInit_unicodedata(void);
#ifdef MS_WINDOWS
extern PyObject* PyInit_winsound(void);
extern PyObject* PyInit__wmi(void);
#endif

struct _inittab _PyImport_Inittab[] = {
{"_abc", PyInit__abc},
Expand Down Expand Up @@ -177,6 +204,34 @@ struct _inittab _PyImport_Inittab[] = {
{"_opcode", PyInit__opcode},

{"_contextvars", PyInit__contextvars},
/* Used to be in separate extension modules. */
{"_asyncio", PyInit__asyncio},
{"_bz2", PyInit__bz2},
{"_ctypes", PyInit__ctypes},
{"_decimal", PyInit__decimal},
{"_elementtree", PyInit__elementtree},
{"_hashlib", PyInit__hashlib},
{"_lzma", PyInit__lzma},
#ifdef MS_WINDOWS
{"_msi", PyInit__msi},
#endif
{"_multiprocessing", PyInit__multiprocessing},
#ifdef MS_WINDOWS
{"_overlapped", PyInit__overlapped},
#endif
{"_queue", PyInit__queue},
{"_socket", PyInit__socket},
{"_sqlite3", PyInit__sqlite3},
{"_ssl", PyInit__ssl},
{"_uuid", PyInit__uuid},
{"_zoneinfo", PyInit__zoneinfo},
{"pyexpat", PyInit_pyexpat},
{"select", PyInit_select},
{"unicodedata", PyInit_unicodedata},
#ifdef MS_WINDOWS
{"winsound", PyInit_winsound},
{"_wmi", PyInit__wmi},
#endif

/* Sentinel */
{0, 0}
Expand Down
6 changes: 5 additions & 1 deletion PC/dl_nt.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ BOOL WINAPI DllMain (HANDLE hInst,
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
{
PyWin_DLLhModule = hInst;
break;

// This should be safe to call here?
DisableThreadLibraryCalls(hInst);
break;
}
case DLL_PROCESS_DETACH:
break;
}
Expand Down
109 changes: 0 additions & 109 deletions PCbuild/_asyncio.vcxproj

This file was deleted.

21 changes: 0 additions & 21 deletions PCbuild/_asyncio.vcxproj.filters

This file was deleted.

59 changes: 0 additions & 59 deletions PCbuild/_bz2.vcxproj.filters

This file was deleted.

Loading