diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2009-02-02 14:24:18 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2009-02-02 14:24:18 (GMT) |
commit | 8bcbbb4e3b89d01de0e5275ea2e0adbef60a43d3 (patch) | |
tree | 184d796a60acb8e21899a43093552400a0a10e77 /PC | |
parent | 021e92a6d094662f872b4f5fdbe1d4ca76b2c204 (diff) | |
download | cpython-8bcbbb4e3b89d01de0e5275ea2e0adbef60a43d3.zip cpython-8bcbbb4e3b89d01de0e5275ea2e0adbef60a43d3.tar.gz cpython-8bcbbb4e3b89d01de0e5275ea2e0adbef60a43d3.tar.bz2 |
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.
........
Diffstat (limited to 'PC')
-rw-r--r-- | PC/getpathp.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/PC/getpathp.c b/PC/getpathp.c index e62b936..78f4465 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -201,6 +201,7 @@ search_for_prefix(char *argv0_path, char *landmark) } #ifdef MS_WINDOWS +#ifdef Py_ENABLE_SHARED /* a string loaded from the DLL at startup.*/ extern const char *PyWin_DLLVersionString; @@ -363,6 +364,7 @@ done: free(keyBuf); return retval; } +#endif /* Py_ENABLE_SHARED */ #endif /* MS_WINDOWS */ static void @@ -380,6 +382,7 @@ get_progpath(void) but makes no mention of the null terminator. Play it safe. PLUS Windows itself defines MAX_PATH as the same, but anyway... */ +#ifdef Py_ENABLE_SHARED wprogpath[MAXPATHLEN]=_T('\0'); if (PyWin_DLLhModule && GetModuleFileName(PyWin_DLLhModule, wprogpath, MAXPATHLEN)) { @@ -388,6 +391,9 @@ get_progpath(void) dllpath, MAXPATHLEN+1, NULL, NULL); } +#else + dllpath[0] = 0; +#endif wprogpath[MAXPATHLEN]=_T('\0'); if (GetModuleFileName(NULL, wprogpath, MAXPATHLEN)) { WideCharToMultiByte(CP_ACP, 0, @@ -398,9 +404,13 @@ get_progpath(void) } #else /* static init of progpath ensures final char remains \0 */ +#ifdef Py_ENABLE_SHARED if (PyWin_DLLhModule) if (!GetModuleFileName(PyWin_DLLhModule, dllpath, MAXPATHLEN)) dllpath[0] = 0; +#else + dllpath[0] = 0; +#endif if (GetModuleFileName(NULL, progpath, MAXPATHLEN)) return; #endif @@ -501,8 +511,10 @@ calculate_path(void) } skiphome = pythonhome==NULL ? 0 : 1; +#ifdef Py_ENABLE_SHARED machinepath = getpythonregpath(HKEY_LOCAL_MACHINE, skiphome); userpath = getpythonregpath(HKEY_CURRENT_USER, skiphome); +#endif /* We only use the default relative PYTHONPATH if we havent anything better to use! */ skipdefault = envpath!=NULL || pythonhome!=NULL || \ |