Issue #15431: Declare PyImport_FrozenModules conditionally on Unix only.
This commit is contained in:
parent
e3010a8d12
commit
ee365ac254
|
@ -21,6 +21,13 @@ static struct _frozen _PyImport_FrozenModules[] = {
|
||||||
{0, 0, 0} /* sentinel */
|
{0, 0, 0} /* sentinel */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef MS_WINDOWS
|
||||||
|
/* On Windows, this links with the regular pythonXY.dll, so this variable comes
|
||||||
|
from frozen.obj. In the Makefile, frozen.o is not linked into this executable,
|
||||||
|
so we define the variable here. */
|
||||||
|
struct _frozen *PyImport_FrozenModules;
|
||||||
|
#endif
|
||||||
|
|
||||||
const char header[] = "/* Auto-generated by Modules/_freeze_importlib.c */";
|
const char header[] = "/* Auto-generated by Modules/_freeze_importlib.c */";
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -91,8 +98,8 @@ main(int argc, char *argv[])
|
||||||
data_size = PyBytes_GET_SIZE(marshalled);
|
data_size = PyBytes_GET_SIZE(marshalled);
|
||||||
|
|
||||||
/* Open the file in text mode. The hg checkout should be using the eol extension,
|
/* Open the file in text mode. The hg checkout should be using the eol extension,
|
||||||
which in turn should cause the existing file to use CRLF */
|
which in turn should cause the EOL style match the C library's text mode */
|
||||||
outfile = fopen(outpath, "wt");
|
outfile = fopen(outpath, "w");
|
||||||
if (outfile == NULL) {
|
if (outfile == NULL) {
|
||||||
fprintf(stderr, "cannot open '%s' for writing\n", outpath);
|
fprintf(stderr, "cannot open '%s' for writing\n", outpath);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue