mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Merged revisions 69205 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r69205 | martin.v.loewis | 2009-02-02 15:23:16 +0100 (Mo, 02 Feb 2009) | 1 line Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. ........
This commit is contained in:
parent
021e92a6d0
commit
8bcbbb4e3b
2 changed files with 14 additions and 0 deletions
|
@ -311,6 +311,8 @@ Tools/Demos
|
||||||
Build
|
Build
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
- Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows.
|
||||||
|
|
||||||
- Issue #4895: Use _strdup on Windows CE.
|
- Issue #4895: Use _strdup on Windows CE.
|
||||||
|
|
||||||
- Issue #4472: "configure --enable-shared" now works on OSX
|
- Issue #4472: "configure --enable-shared" now works on OSX
|
||||||
|
|
|
@ -201,6 +201,7 @@ search_for_prefix(char *argv0_path, char *landmark)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MS_WINDOWS
|
#ifdef MS_WINDOWS
|
||||||
|
#ifdef Py_ENABLE_SHARED
|
||||||
|
|
||||||
/* a string loaded from the DLL at startup.*/
|
/* a string loaded from the DLL at startup.*/
|
||||||
extern const char *PyWin_DLLVersionString;
|
extern const char *PyWin_DLLVersionString;
|
||||||
|
@ -363,6 +364,7 @@ done:
|
||||||
free(keyBuf);
|
free(keyBuf);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
#endif /* Py_ENABLE_SHARED */
|
||||||
#endif /* MS_WINDOWS */
|
#endif /* MS_WINDOWS */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -380,6 +382,7 @@ get_progpath(void)
|
||||||
but makes no mention of the null terminator. Play it safe.
|
but makes no mention of the null terminator. Play it safe.
|
||||||
PLUS Windows itself defines MAX_PATH as the same, but anyway...
|
PLUS Windows itself defines MAX_PATH as the same, but anyway...
|
||||||
*/
|
*/
|
||||||
|
#ifdef Py_ENABLE_SHARED
|
||||||
wprogpath[MAXPATHLEN]=_T('\0');
|
wprogpath[MAXPATHLEN]=_T('\0');
|
||||||
if (PyWin_DLLhModule &&
|
if (PyWin_DLLhModule &&
|
||||||
GetModuleFileName(PyWin_DLLhModule, wprogpath, MAXPATHLEN)) {
|
GetModuleFileName(PyWin_DLLhModule, wprogpath, MAXPATHLEN)) {
|
||||||
|
@ -388,6 +391,9 @@ get_progpath(void)
|
||||||
dllpath, MAXPATHLEN+1,
|
dllpath, MAXPATHLEN+1,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
dllpath[0] = 0;
|
||||||
|
#endif
|
||||||
wprogpath[MAXPATHLEN]=_T('\0');
|
wprogpath[MAXPATHLEN]=_T('\0');
|
||||||
if (GetModuleFileName(NULL, wprogpath, MAXPATHLEN)) {
|
if (GetModuleFileName(NULL, wprogpath, MAXPATHLEN)) {
|
||||||
WideCharToMultiByte(CP_ACP, 0,
|
WideCharToMultiByte(CP_ACP, 0,
|
||||||
|
@ -398,9 +404,13 @@ get_progpath(void)
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/* static init of progpath ensures final char remains \0 */
|
/* static init of progpath ensures final char remains \0 */
|
||||||
|
#ifdef Py_ENABLE_SHARED
|
||||||
if (PyWin_DLLhModule)
|
if (PyWin_DLLhModule)
|
||||||
if (!GetModuleFileName(PyWin_DLLhModule, dllpath, MAXPATHLEN))
|
if (!GetModuleFileName(PyWin_DLLhModule, dllpath, MAXPATHLEN))
|
||||||
dllpath[0] = 0;
|
dllpath[0] = 0;
|
||||||
|
#else
|
||||||
|
dllpath[0] = 0;
|
||||||
|
#endif
|
||||||
if (GetModuleFileName(NULL, progpath, MAXPATHLEN))
|
if (GetModuleFileName(NULL, progpath, MAXPATHLEN))
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
@ -501,8 +511,10 @@ calculate_path(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
skiphome = pythonhome==NULL ? 0 : 1;
|
skiphome = pythonhome==NULL ? 0 : 1;
|
||||||
|
#ifdef Py_ENABLE_SHARED
|
||||||
machinepath = getpythonregpath(HKEY_LOCAL_MACHINE, skiphome);
|
machinepath = getpythonregpath(HKEY_LOCAL_MACHINE, skiphome);
|
||||||
userpath = getpythonregpath(HKEY_CURRENT_USER, skiphome);
|
userpath = getpythonregpath(HKEY_CURRENT_USER, skiphome);
|
||||||
|
#endif
|
||||||
/* We only use the default relative PYTHONPATH if we havent
|
/* We only use the default relative PYTHONPATH if we havent
|
||||||
anything better to use! */
|
anything better to use! */
|
||||||
skipdefault = envpath!=NULL || pythonhome!=NULL || \
|
skipdefault = envpath!=NULL || pythonhome!=NULL || \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue