mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Second half of #1752175: #ifdef out references to PyImport_DynLoadFiletab if HAVE_DYNAMIC_LOADING is not defined.
This commit is contained in:
		
							parent
							
								
									7cf40799ef
								
							
						
					
					
						commit
						add36e5fdf
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		|  | @ -119,15 +119,19 @@ _PyImport_Init(void) | ||||||
| 	/* prepare _PyImport_Filetab: copy entries from
 | 	/* prepare _PyImport_Filetab: copy entries from
 | ||||||
| 	   _PyImport_DynLoadFiletab and _PyImport_StandardFiletab. | 	   _PyImport_DynLoadFiletab and _PyImport_StandardFiletab. | ||||||
| 	 */ | 	 */ | ||||||
|  | #ifdef HAVE_DYNAMIC_LOADING | ||||||
| 	for (scan = _PyImport_DynLoadFiletab; scan->suffix != NULL; ++scan) | 	for (scan = _PyImport_DynLoadFiletab; scan->suffix != NULL; ++scan) | ||||||
| 		++countD; | 		++countD; | ||||||
|  | #endif | ||||||
| 	for (scan = _PyImport_StandardFiletab; scan->suffix != NULL; ++scan) | 	for (scan = _PyImport_StandardFiletab; scan->suffix != NULL; ++scan) | ||||||
| 		++countS; | 		++countS; | ||||||
| 	filetab = PyMem_NEW(struct filedescr, countD + countS + 1); | 	filetab = PyMem_NEW(struct filedescr, countD + countS + 1); | ||||||
| 	if (filetab == NULL) | 	if (filetab == NULL) | ||||||
| 		Py_FatalError("Can't initialize import file table."); | 		Py_FatalError("Can't initialize import file table."); | ||||||
|  | #ifdef HAVE_DYNAMIC_LOADING | ||||||
| 	memcpy(filetab, _PyImport_DynLoadFiletab, | 	memcpy(filetab, _PyImport_DynLoadFiletab, | ||||||
| 	       countD * sizeof(struct filedescr)); | 	       countD * sizeof(struct filedescr)); | ||||||
|  | #endif | ||||||
| 	memcpy(filetab + countD, _PyImport_StandardFiletab, | 	memcpy(filetab + countD, _PyImport_StandardFiletab, | ||||||
| 	       countS * sizeof(struct filedescr)); | 	       countS * sizeof(struct filedescr)); | ||||||
| 	filetab[countD + countS].suffix = NULL; | 	filetab[countD + countS].suffix = NULL; | ||||||
|  | @ -1364,7 +1368,7 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf, | ||||||
| 		saved_namelen = namelen; | 		saved_namelen = namelen; | ||||||
| #endif /* PYOS_OS2 */ | #endif /* PYOS_OS2 */ | ||||||
| 		for (fdp = _PyImport_Filetab; fdp->suffix != NULL; fdp++) { | 		for (fdp = _PyImport_Filetab; fdp->suffix != NULL; fdp++) { | ||||||
| #if defined(PYOS_OS2) | #if defined(PYOS_OS2) && defined(HAVE_DYNAMIC_LOADING) | ||||||
| 			/* OS/2 limits DLLs to 8 character names (w/o
 | 			/* OS/2 limits DLLs to 8 character names (w/o
 | ||||||
| 			   extension) | 			   extension) | ||||||
| 			 * so if the name is longer than that and its a | 			 * so if the name is longer than that and its a | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Georg Brandl
						Georg Brandl