Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(27357)

Side by Side Diff: Python/dynload_shlib.c

Issue 14040: Deprecate some of the module file formats
Patch Set: Created 7 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Python/dynload_next.c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* Support for dynamic loading of extension modules */ 2 /* Support for dynamic loading of extension modules */
3 3
4 #include "Python.h" 4 #include "Python.h"
5 #include "importdl.h" 5 #include "importdl.h"
6 6
7 #include <sys/types.h> 7 #include <sys/types.h>
8 #include <sys/stat.h> 8 #include <sys/stat.h>
9 9
10 #if defined(__NetBSD__) 10 #if defined(__NetBSD__)
(...skipping 21 matching lines...) Expand all
32 32
33 /* The .so extension module ABI tag, supplied by the Makefile via 33 /* The .so extension module ABI tag, supplied by the Makefile via
34 Makefile.pre.in and configure. This is used to discriminate between 34 Makefile.pre.in and configure. This is used to discriminate between
35 incompatible .so files so that extensions for different Python builds can 35 incompatible .so files so that extensions for different Python builds can
36 live in the same directory. E.g. foomodule.cpython-32.so 36 live in the same directory. E.g. foomodule.cpython-32.so
37 */ 37 */
38 38
39 const struct filedescr _PyImport_DynLoadFiletab[] = { 39 const struct filedescr _PyImport_DynLoadFiletab[] = {
40 #ifdef __CYGWIN__ 40 #ifdef __CYGWIN__
41 {".dll", "rb", C_EXTENSION}, 41 {".dll", "rb", C_EXTENSION},
42 {"module.dll", "rb", C_EXTENSION},
43 #else /* !__CYGWIN__ */ 42 #else /* !__CYGWIN__ */
44 #if defined(PYOS_OS2) && defined(PYCC_GCC) 43 #if defined(PYOS_OS2) && defined(PYCC_GCC)
45 {".pyd", "rb", C_EXTENSION}, 44 {".pyd", "rb", C_EXTENSION},
46 {".dll", "rb", C_EXTENSION}, 45 {".dll", "rb", C_EXTENSION},
47 #else /* !(defined(PYOS_OS2) && defined(PYCC_GCC)) */ 46 #else /* !(defined(PYOS_OS2) && defined(PYCC_GCC)) */
48 #ifdef __VMS 47 #ifdef __VMS
49 {".exe", "rb", C_EXTENSION}, 48 {".exe", "rb", C_EXTENSION},
50 {".EXE", "rb", C_EXTENSION}, 49 {".EXE", "rb", C_EXTENSION},
51 {"module.exe", "rb", C_EXTENSION},
52 {"MODULE.EXE", "rb", C_EXTENSION},
53 #else /* !__VMS */ 50 #else /* !__VMS */
54 {"." SOABI ".so", "rb", C_EXTENSION}, 51 {"." SOABI ".so", "rb", C_EXTENSION},
55 {"module." SOABI ".so", "rb", C_EXTENSION},
56 {".abi" PYTHON_ABI_STRING ".so", "rb", C_EXTENSION}, 52 {".abi" PYTHON_ABI_STRING ".so", "rb", C_EXTENSION},
57 {"module.abi" PYTHON_ABI_STRING ".so", "rb", C_EXTENSION},
58 {".so", "rb", C_EXTENSION}, 53 {".so", "rb", C_EXTENSION},
59 {"module.so", "rb", C_EXTENSION},
60 #endif /* __VMS */ 54 #endif /* __VMS */
61 #endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */ 55 #endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */
62 #endif /* __CYGWIN__ */ 56 #endif /* __CYGWIN__ */
63 {0, 0} 57 {0, 0}
64 }; 58 };
65 59
66 static struct { 60 static struct {
67 dev_t dev; 61 dev_t dev;
68 #ifdef __VMS 62 #ifdef __VMS
69 ino_t ino[3]; 63 ino_t ino[3];
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 if (error == NULL) 137 if (error == NULL)
144 error = "unknown dlopen() error"; 138 error = "unknown dlopen() error";
145 PyErr_SetString(PyExc_ImportError, error); 139 PyErr_SetString(PyExc_ImportError, error);
146 return NULL; 140 return NULL;
147 } 141 }
148 if (fp != NULL && nhandles < 128) 142 if (fp != NULL && nhandles < 128)
149 handles[nhandles++].handle = handle; 143 handles[nhandles++].handle = handle;
150 p = (dl_funcptr) dlsym(handle, funcname); 144 p = (dl_funcptr) dlsym(handle, funcname);
151 return p; 145 return p;
152 } 146 }
OLDNEW
« no previous file with comments | « Python/dynload_next.c ('k') | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+