@@ -201,6 +201,7 @@ search_for_prefix(char *argv0_path, char *landmark)
201
201
}
202
202
203
203
#ifdef MS_WINDOWS
204
+ #ifdef Py_ENABLE_SHARED
204
205
205
206
/* a string loaded from the DLL at startup.*/
206
207
extern const char * PyWin_DLLVersionString ;
@@ -363,6 +364,7 @@ getpythonregpath(HKEY keyBase, int skipcore)
363
364
free (keyBuf );
364
365
return retval ;
365
366
}
367
+ #endif /* Py_ENABLE_SHARED */
366
368
#endif /* MS_WINDOWS */
367
369
368
370
static void
@@ -380,6 +382,7 @@ get_progpath(void)
380
382
but makes no mention of the null terminator. Play it safe.
381
383
PLUS Windows itself defines MAX_PATH as the same, but anyway...
382
384
*/
385
+ #ifdef Py_ENABLE_SHARED
383
386
wprogpath [MAXPATHLEN ]= _T ('\0' );
384
387
if (PyWin_DLLhModule &&
385
388
GetModuleFileName (PyWin_DLLhModule , wprogpath , MAXPATHLEN )) {
@@ -388,6 +391,9 @@ get_progpath(void)
388
391
dllpath , MAXPATHLEN + 1 ,
389
392
NULL , NULL );
390
393
}
394
+ #else
395
+ dllpath [0 ] = 0 ;
396
+ #endif
391
397
wprogpath [MAXPATHLEN ]= _T ('\0' );
392
398
if (GetModuleFileName (NULL , wprogpath , MAXPATHLEN )) {
393
399
WideCharToMultiByte (CP_ACP , 0 ,
@@ -398,9 +404,13 @@ get_progpath(void)
398
404
}
399
405
#else
400
406
/* static init of progpath ensures final char remains \0 */
407
+ #ifdef Py_ENABLE_SHARED
401
408
if (PyWin_DLLhModule )
402
409
if (!GetModuleFileName (PyWin_DLLhModule , dllpath , MAXPATHLEN ))
403
410
dllpath [0 ] = 0 ;
411
+ #else
412
+ dllpath [0 ] = 0 ;
413
+ #endif
404
414
if (GetModuleFileName (NULL , progpath , MAXPATHLEN ))
405
415
return ;
406
416
#endif
@@ -501,8 +511,10 @@ calculate_path(void)
501
511
}
502
512
503
513
skiphome = pythonhome == NULL ? 0 : 1 ;
514
+ #ifdef Py_ENABLE_SHARED
504
515
machinepath = getpythonregpath (HKEY_LOCAL_MACHINE , skiphome );
505
516
userpath = getpythonregpath (HKEY_CURRENT_USER , skiphome );
517
+ #endif
506
518
/* We only use the default relative PYTHONPATH if we havent
507
519
anything better to use! */
508
520
skipdefault = envpath != NULL || pythonhome != NULL || \
0 commit comments