[Python-checkins] r69206 - in python/branches/release26-maint: Misc/NEWS PC/getpathp.c

martin.v.loewis python-checkins at python.org
Mon Feb 2 15:24:18 CET 2009


Author: martin.v.loewis
Date: Mon Feb  2 15:24:18 2009
New Revision: 69206

Log:
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.
........


Modified:
   python/branches/release26-maint/   (props changed)
   python/branches/release26-maint/Misc/NEWS
   python/branches/release26-maint/PC/getpathp.c

Modified: python/branches/release26-maint/Misc/NEWS
==============================================================================
--- python/branches/release26-maint/Misc/NEWS	(original)
+++ python/branches/release26-maint/Misc/NEWS	Mon Feb  2 15:24:18 2009
@@ -311,6 +311,8 @@
 Build
 -----
 
+- Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows.
+
 - Issue #4895: Use _strdup on Windows CE.
 
 - Issue #4472: "configure --enable-shared" now works on OSX

Modified: python/branches/release26-maint/PC/getpathp.c
==============================================================================
--- python/branches/release26-maint/PC/getpathp.c	(original)
+++ python/branches/release26-maint/PC/getpathp.c	Mon Feb  2 15:24:18 2009
@@ -201,6 +201,7 @@
 }
 
 #ifdef MS_WINDOWS
+#ifdef Py_ENABLE_SHARED
 
 /* a string loaded from the DLL at startup.*/
 extern const char *PyWin_DLLVersionString;
@@ -363,6 +364,7 @@
 		free(keyBuf);
 	return retval;
 }
+#endif /* Py_ENABLE_SHARED */
 #endif /* MS_WINDOWS */
 
 static void
@@ -380,6 +382,7 @@
 	   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 @@
 		                    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 @@
 	}
 #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 @@
 	}
  
 	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 || \


More information about the Python-checkins mailing list