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

Side by Side Diff: Modules/_freeze_importlib.c

Issue 3871: cross and native build of python for mingw32 with distutils
Patch Set: Created 7 years, 2 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 | « Modules/faulthandler.c ('k') | Modules/getaddrinfo.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* This is built as a stand-alone executable by the Makefile, and helps turn 1 /* This is built as a stand-alone executable by the Makefile, and helps turn
2 Lib/importlib/_bootstrap.py into a frozen module in Python/importlib.h 2 Lib/importlib/_bootstrap.py into a frozen module in Python/importlib.h
3 */ 3 */
4 4
5 #include <Python.h> 5 #include <Python.h>
6 #include <marshal.h> 6 #include <marshal.h>
7 7
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 #include <sys/stat.h> 10 #include <sys/stat.h>
11 #ifndef MS_WINDOWS 11 #ifndef MS_WINDOWS
12 #include <unistd.h> 12 #include <unistd.h>
13 #endif 13 #endif
14 14
15 15
16 /* To avoid a circular dependency on frozen.o, we create our own structure 16 /* To avoid a circular dependency on frozen.o, we create our own structure
17 of frozen modules instead, left deliberately blank so as to avoid 17 of frozen modules instead, left deliberately blank so as to avoid
18 unintentional import of a stale version of _frozen_importlib. */ 18 unintentional import of a stale version of _frozen_importlib. */
19 19
20 static struct _frozen _PyImport_FrozenModules[] = { 20 static struct _frozen _PyImport_FrozenModules[] = {
21 {0, 0, 0} /* sentinel */ 21 {0, 0, 0} /* sentinel */
22 }; 22 };
23 23
24 #ifndef MS_WINDOWS 24 #ifndef _MSC_VER
25 /* On Windows, this links with the regular pythonXY.dll, so this variable comes 25 /* On MSVC, this links with the regular pythonXY.dll, so this variable comes
26 from frozen.obj. In the Makefile, frozen.o is not linked into this executable , 26 from frozen.obj. In the Makefile, frozen.o is not linked into this executable ,
27 so we define the variable here. */ 27 so we define the variable here. */
28 struct _frozen *PyImport_FrozenModules; 28 struct _frozen *PyImport_FrozenModules;
29 #endif 29 #endif
30 30
31 const char header[] = "/* Auto-generated by Modules/_freeze_importlib.c */"; 31 const char header[] = "/* Auto-generated by Modules/_freeze_importlib.c */";
32 32
33 int 33 int
34 main(int argc, char *argv[]) 34 main(int argc, char *argv[])
35 { 35 {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 error: 134 error:
135 PyErr_Print(); 135 PyErr_Print();
136 Py_Finalize(); 136 Py_Finalize();
137 if (infile) 137 if (infile)
138 fclose(infile); 138 fclose(infile);
139 if (outfile) 139 if (outfile)
140 fclose(outfile); 140 fclose(outfile);
141 return 1; 141 return 1;
142 } 142 }
OLDNEW
« no previous file with comments | « Modules/faulthandler.c ('k') | Modules/getaddrinfo.c » ('j') | no next file with comments »

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