Skip to content

Commit bf4155b

Browse files
authored
Merge pull request #6 from hkoba/gh-5-perl5_38
GH-5 perl5.38
2 parents 91c3e7d + 983e759 commit bf4155b

File tree

8 files changed

+29
-65
lines changed

8 files changed

+29
-65
lines changed

.github/workflows/rust.yml

+4-10
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,10 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
19+
- uses: actions-rust-lang/setup-rust-toolchain@v1
1920
- name: Install dependencies
2021
run: apt-get update && apt-get install -y llvm-dev libclang-dev clang
21-
- name: Install ${{ matrix.rust-version }}
22-
uses: actions-rs/toolchain@v1
23-
with:
24-
toolchain: ${{ matrix.rust-version }}-${{ matrix.target.triple }}
25-
profile: minimal
26-
override: true
2722
- name: Build
2823
run: cargo build --verbose
2924
- name: Run tests
@@ -40,10 +35,9 @@ jobs:
4035
- '5.30'
4136
- '5.32'
4237
- '5.34'
38+
- '5.36'
39+
- '5.38'
4340
- '5'
44-
rust-version:
45-
- 1.54.0 # MSRV
46-
- stable
4741
target:
4842
- { name: Linux, os: ubuntu-latest, triple: x86_64-unknown-linux-gnu }
4943

.travis.yml

-30
This file was deleted.

examples/110_call_method.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fn my_test() {
4545
fn call_list_method(perl: &mut Perl, class_name: String, method_name: String, args: Vec<String>) -> Result<Vec<Sv>,String>
4646
{
4747

48-
let mut my_perl = perl.my_perl();
48+
let my_perl = perl.my_perl();
4949

5050
// dSP
5151
let mut sp = my_perl.Istack_sp;
@@ -71,7 +71,7 @@ fn call_list_method(perl: &mut Perl, class_name: String, method_name: String, ar
7171
my_perl.Istack_sp = sp;
7272

7373
// call_method
74-
let cnt = unsafe_perl_api!{Perl_call_method(perl.my_perl, method_name.as_ptr() as *const i8, (G_METHOD_NAMED | G_ARRAY) as i32)};
74+
let cnt = unsafe_perl_api!{Perl_call_method(perl.my_perl, method_name.as_ptr() as *const i8, (G_METHOD_NAMED | G_LIST) as i32)};
7575

7676
// SPAGAIN
7777
// sp = my_perl.Istack_sp;

examples/eg/op1.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![allow(non_snake_case)]
2+
#![allow(unused_imports)]
23

34
#[cfg(perlapi_ver26)]
45
use std::convert::TryFrom;

libperl-sys/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ crate-type = ["rlib", "cdylib"]
3030
[dependencies]
3131

3232
[build-dependencies]
33-
bindgen = "0.44"
33+
bindgen = "0.69"
3434
regex = "1"
3535

3636
libperl-config = {"path" = "../libperl-config", version = "^0.2"}

libperl-sys/build.rs

+13-21
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,16 @@ fn main() {
3232
let perl = PerlConfig::default();
3333
perl.emit_cargo_ldopts();
3434

35+
let archlib = String::from(&perl.dict["archlib"]);
36+
let perl_h = Path::new(&archlib).join("CORE/perl.h");
37+
let cop_h = Path::new(&archlib).join("CORE/cop.h");
38+
3539
let ccopts = perl.read_ccopts().unwrap();
3640
println!("# perl ccopts = {:?}, ", ccopts);
3741

3842
perl.emit_features(&["useithreads"]); // "usemultiplicity"
3943

40-
perl.emit_perlapi_vers(10, 34);
44+
perl.emit_perlapi_vers(10, 38);
4145

4246
let src_file_name = "wrapper.h";
4347
let src_path = cargo_topdir_file(src_file_name);
@@ -72,10 +76,9 @@ fn main() {
7276
// the resulting bindings.
7377
let bindings = bindgen::Builder::default()
7478

75-
.rustfmt_bindings(true)
7679
.derive_debug(true)
7780
.impl_debug(true)
78-
81+
.formatter(bindgen::Formatter::Prettyplease)
7982
.rustified_enum("OPclass|opcode|svtype")
8083

8184
// The input header we would like to generate
@@ -87,24 +90,13 @@ fn main() {
8790

8891
.opaque_type("timex")
8992

90-
.blacklist_type("max_align_t")
91-
92-
.blacklist_item("IPPORT_RESERVED")
93-
94-
.blacklist_item("FP_.*")
95-
// .blacklist_item("FP_INT_UPWARD")
96-
// .blacklist_item("FP_INT_DOWNWARD")
97-
// .blacklist_item("FP_INT_TOWARDZERO")
98-
// .blacklist_item("FP_INT_TONEARESTFROMZERO")
99-
// .blacklist_item("FP_INT_TONEAREST")
100-
// .blacklist_item("FP_NAN")
101-
// .blacklist_item("FP_INFINITE")
102-
// .blacklist_item("FP_ZERO")
103-
// .blacklist_item("FP_SUBNORMAL")
104-
// .blacklist_item("FP_NORMAL")
105-
106-
.blacklist_function("f?printf")
107-
.blacklist_function("f?scanf")
93+
.allowlist_file(perl_h.to_str().unwrap())
94+
.allowlist_file(cop_h.to_str().unwrap())
95+
.allowlist_item("opcode")
96+
.allowlist_item("(Perl|perl|PL)_.*")
97+
.allowlist_item("([SAHRGC]V|xpv).*")
98+
.allowlist_item("OP.*")
99+
.allowlist_item("G_.*")
108100

109101
// Finish the builder and generate the bindings.
110102
.generate()

libperl-sys/wrapper.h

+7
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
#include <INTERN.h> /* from the Perl distribution */
2+
#define PERL_IN_GLOBALS_C
23
#include <perl.h> /* from the Perl distribution */
4+
5+
#if defined(G_ARRAY) && !defined(G_LIST)
6+
# define G_LIST G_ARRAY
7+
#elif !defined(G_ARRAY)
8+
# define G_ARRAY G_LIST
9+
#endif

src/perl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ impl Perl {
232232

233233
#[cfg(perl_useithreads)]
234234
pub fn pushmark(&self, sp: *mut *mut SV) {
235-
let mut my_perl = self.my_perl();
235+
let my_perl = self.my_perl();
236236
unsafe {
237237
my_perl.Imarkstack_ptr = my_perl.Imarkstack_ptr.add(1)
238238
};

0 commit comments

Comments
 (0)