diff --git a/build.rs b/build.rs index d1e0ca6f..a83ea031 100644 --- a/build.rs +++ b/build.rs @@ -27,13 +27,17 @@ fn main() { for f in flags.split(",") { // write out flags as --cfg so that the same #cfg blocks can be used // in rust-cpython as in the -sys libs - let key_and_val: Vec<&str> = f.split("=").collect(); - let key = key_and_val[0]; - let val = key_and_val[1]; - if key.starts_with("FLAG") { - println!("cargo:rustc-cfg={}=\"{}\"", CFG_KEY, &key[5..]) + if f.starts_with("CFG") { + println!("cargo:rustc-cfg={}", &f[4..]) } else { - println!("cargo:rustc-cfg={}=\"{}_{}\"", CFG_KEY, &key[4..], val); + let key_and_val: Vec<&str> = f.split("=").collect(); + let key = key_and_val[0]; + let val = key_and_val[1]; + if key.starts_with("FLAG") { + println!("cargo:rustc-cfg={}=\"{}\"", CFG_KEY, &key[5..]); + } else { + println!("cargo:rustc-cfg={}=\"{}_{}\"", CFG_KEY, &key[4..], val); + } } } } diff --git a/python3-sys/build.rs b/python3-sys/build.rs index a139993b..33dafa1d 100644 --- a/python3-sys/build.rs +++ b/python3-sys/build.rs @@ -306,7 +306,7 @@ print(sys.exec_prefix);"; /// cargo vars to stdout. /// /// Note that if the python doesn't satisfy expected_version, this will error. -fn configure_from_path(expected_version: &PythonVersion) -> Result { +fn configure_from_path(expected_version: &PythonVersion) -> Result<(String, String), String> { let (interpreter_version, interpreter_path, lines) = try!(find_interpreter_and_get_config(expected_version)); let libpath: &str = &lines[1]; @@ -325,6 +325,7 @@ fn configure_from_path(expected_version: &PythonVersion) -> Result Result 0 { &flags[..flags.len()-1] } else { "" }); } diff --git a/src/py_class/slots.rs b/src/py_class/slots.rs index 3836ad88..2daf7576 100644 --- a/src/py_class/slots.rs +++ b/src/py_class/slots.rs @@ -109,7 +109,7 @@ macro_rules! py_class_type_object_dynamic_init { } } -#[cfg(not(Py_3_4))] +#[cfg(not(Py_3_5))] #[macro_export] #[doc(hidden)] macro_rules! py_class_type_object_dynamic_init { @@ -221,6 +221,7 @@ macro_rules! py_class_as_number { macro_rules! py_class_as_async { ([]) => (0 as *mut $crate::_detail::ffi::PyAsyncMethods); ([$( $slot_name:ident : $slot_value:expr ,)+]) => {{ + println!("register async"); static mut ASYNC_METHODS : $crate::_detail::ffi::PyAsyncMethods = $crate::_detail::ffi::PyAsyncMethods { $( $slot_name : $slot_value, )*