Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bc186a8

Browse files
committed
Merged revisions 69205 via svnmerge from
svn+ssh://[email protected]/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. ........
1 parent 49db063 commit bc186a8

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ Tools/Demos
375375
Build
376376
-----
377377

378+
- Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows.
379+
378380
- Issue #4895: Use _strdup on Windows CE.
379381

380382
- Issue #4472: "configure --enable-shared" now works on OSX

PC/getpathp.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ search_for_prefix(wchar_t *argv0_path, wchar_t *landmark)
200200
}
201201

202202
#ifdef MS_WINDOWS
203+
#ifdef Py_ENABLE_SHARED
203204

204205
/* a string loaded from the DLL at startup.*/
205206
extern const char *PyWin_DLLVersionString;
@@ -349,6 +350,7 @@ getpythonregpath(HKEY keyBase, int skipcore)
349350
free(keyBuf);
350351
return retval;
351352
}
353+
#endif /* Py_ENABLE_SHARED */
352354
#endif /* MS_WINDOWS */
353355

354356
static void
@@ -359,11 +361,15 @@ get_progpath(void)
359361
wchar_t *prog = Py_GetProgramName();
360362

361363
#ifdef MS_WINDOWS
364+
#ifdef Py_ENABLE_SHARED
362365
extern HANDLE PyWin_DLLhModule;
363366
/* static init of progpath ensures final char remains \0 */
364367
if (PyWin_DLLhModule)
365368
if (!GetModuleFileNameW(PyWin_DLLhModule, dllpath, MAXPATHLEN))
366369
dllpath[0] = 0;
370+
#else
371+
dllpath[0] = 0;
372+
#endif
367373
if (GetModuleFileNameW(NULL, progpath, MAXPATHLEN))
368374
return;
369375
#endif
@@ -471,8 +477,10 @@ calculate_path(void)
471477
}
472478

473479
skiphome = pythonhome==NULL ? 0 : 1;
480+
#ifdef Py_ENABLE_SHARED
474481
machinepath = getpythonregpath(HKEY_LOCAL_MACHINE, skiphome);
475482
userpath = getpythonregpath(HKEY_CURRENT_USER, skiphome);
483+
#endif
476484
/* We only use the default relative PYTHONPATH if we havent
477485
anything better to use! */
478486
skipdefault = envpath!=NULL || pythonhome!=NULL || \

0 commit comments

Comments
 (0)