Skip to content
Open
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
9 changes: 9 additions & 0 deletions python3-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,11 @@ fn configure_from_path(expected_version: &PythonVersion) -> Result<String, Strin
println!("cargo:rustc-link-lib=static-nobundle=pythonXY");
}

const MAX_MINOR: u8 = 14;
println!("cargo:rustc-check-cfg=cfg(Py_LIMITED_API)");
for i in 4..MAX_MINOR {
println!("cargo::rustc-check-cfg=cfg(Py_3_{i})");
}
if let PythonVersion {
major: 3,
minor: some_minor,
Expand Down Expand Up @@ -450,6 +455,10 @@ fn main() {
if is_not_none_or_zero(config_map.get("Py_TRACE_REFS")) {
config_map.insert("Py_REF_DEBUG".to_owned(), "1".to_owned()); // Py_TRACE_REFS implies Py_REF_DEBUG.
}
println!(
"cargo:rustc-check-cfg=cfg({CFG_KEY}, values({}))",
SYSCONFIG_FLAGS.map(|f| format!(r#""{f}""#)).join(",")
);
for (key, val) in &config_map {
if let Some(line) = cfg_line_for_var(key, val) {
println!("{}", line);
Expand Down
5 changes: 5 additions & 0 deletions python3-sys/src/tupleobject.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
use libc::c_int;

#[cfg(not(Py_LIMITED_API))]
#[cfg(Py_3_14)]
use crate::Py_hash_t;
use crate::object::*;
use crate::pyport::Py_ssize_t;

#[repr(C)]
#[cfg(not(Py_LIMITED_API))]
pub struct PyTupleObject {
pub ob_base: PyVarObject,
#[cfg(Py_3_14)]
pub ob_hash: Py_hash_t,
pub ob_item: [*mut PyObject; 1],
}

Expand Down