Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mypy/cache.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
This module contains high-level logic for fixed format serialization.
Lower-level parts are implemented in C in mypyc/lib-rt/librt_internal.c
Lower-level parts are implemented in C in mypyc/lib-rt/internal/librt_internal.c
Short summary of low-level functionality:
* integers are automatically serialized as 1, 2, or 4 bytes, or arbitrary length.
* str/bytes are serialized as size (1, 2, or 4 bytes) followed by bytes buffer.
Expand Down
6 changes: 3 additions & 3 deletions mypyc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ class ModDesc(NamedTuple):


LIBRT_MODULES = [
ModDesc("librt.internal", ["librt_internal.c"], [], []),
ModDesc("librt.strings", ["librt_strings.c"], [], []),
ModDesc("librt.internal", ["internal/librt_internal.c"], [], ["internal"]),
ModDesc("librt.strings", ["strings/librt_strings.c"], [], ["strings"]),
ModDesc(
"librt.base64",
[
"librt_base64.c",
"base64/librt_base64.c",
"base64/lib.c",
"base64/codec_choose.c",
"base64/tables/tables.c",
Expand Down
6 changes: 3 additions & 3 deletions mypyc/codegen/emitmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,11 +625,11 @@ def generate_c_for_modules(self) -> list[tuple[str, str]]:
ext_declarations.emit_line("#include <Python.h>")
ext_declarations.emit_line("#include <CPy.h>")
if self.compiler_options.depends_on_librt_internal:
ext_declarations.emit_line("#include <librt_internal.h>")
ext_declarations.emit_line("#include <internal/librt_internal.h>")
if any(LIBRT_BASE64 in mod.dependencies for mod in self.modules.values()):
ext_declarations.emit_line("#include <librt_base64.h>")
ext_declarations.emit_line("#include <base64/librt_base64.h>")
if any(LIBRT_STRINGS in mod.dependencies for mod in self.modules.values()):
ext_declarations.emit_line("#include <librt_strings.h>")
ext_declarations.emit_line("#include <strings/librt_strings.h>")
# Include headers for conditional source files
source_deps = collect_source_dependencies(self.modules)
for source_dep in sorted(source_deps, key=lambda d: d.path):
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion mypyc/lib-rt/byteswriter_extra_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <stdint.h>
#include <Python.h>

#include "librt_strings.h"
#include "strings/librt_strings.h"

static inline CPyTagged
CPyBytesWriter_Len(PyObject *obj) {
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions mypyc/lib-rt/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,33 +89,33 @@ def run(self) -> None:
Extension(
"librt.internal",
[
"librt_internal.c",
"internal/librt_internal.c",
"init.c",
"int_ops.c",
"exc_ops.c",
"pythonsupport.c",
"getargsfast.c",
],
include_dirs=["."],
include_dirs=[".", "internal"],
extra_compile_args=cflags,
),
Extension(
"librt.strings",
[
"librt_strings.c",
"strings/librt_strings.c",
"init.c",
"int_ops.c",
"exc_ops.c",
"pythonsupport.c",
"getargsfast.c",
],
include_dirs=["."],
include_dirs=[".", "strings"],
extra_compile_args=cflags,
),
Extension(
"librt.base64",
[
"librt_base64.c",
"base64/librt_base64.c",
"base64/lib.c",
"base64/codec_choose.c",
"base64/tables/tables.c",
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion mypyc/lib-rt/stringwriter_extra_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <stdint.h>
#include <Python.h>

#include "librt_strings.h"
#include "strings/librt_strings.h"

static inline CPyTagged
CPyStringWriter_Len(PyObject *obj) {
Expand Down