File tree Expand file tree Collapse file tree 4 files changed +21
-12
lines changed Expand file tree Collapse file tree 4 files changed +21
-12
lines changed Original file line number Diff line number Diff line change 46
46
command : fmt
47
47
args : --all -- --check
48
48
49
- - uses : actions-rs/cargo@v1
50
- with :
51
- command : clippy
52
-
53
49
- uses : actions-rs/cargo@v1
54
50
with :
55
51
command : test
Original file line number Diff line number Diff line change 3
3
use phper_sys:: { _efree, _emalloc} ;
4
4
use std:: {
5
5
alloc:: { AllocError , AllocRef , Layout } ,
6
- os:: raw:: c_char,
7
6
ptr:: { slice_from_raw_parts_mut, NonNull } ,
8
7
} ;
9
8
10
9
pub type EBox < T > = Box < T , Allocator > ;
11
10
12
11
pub struct Allocator {
13
12
#[ cfg( phper_debug) ]
14
- zend_filename : * const c_char ,
13
+ zend_filename : * const std :: os :: raw :: c_char ,
15
14
#[ cfg( phper_debug) ]
16
15
zend_lineno : u32 ,
17
16
#[ cfg( phper_debug) ]
18
- zend_orig_filename : * const c_char ,
17
+ zend_orig_filename : * const std :: os :: raw :: c_char ,
19
18
#[ cfg( phper_debug) ]
20
19
zend_orig_lineno : u32 ,
21
20
}
22
21
23
22
impl Allocator {
24
23
pub const fn new (
25
- #[ cfg( phper_debug) ] zend_filename : * const c_char ,
24
+ #[ cfg( phper_debug) ] zend_filename : * const std :: os :: raw :: c_char ,
26
25
#[ cfg( phper_debug) ] zend_lineno : u32 ,
27
- #[ cfg( phper_debug) ] zend_orig_filename : * const c_char ,
26
+ #[ cfg( phper_debug) ] zend_orig_filename : * const std :: os :: raw :: c_char ,
28
27
#[ cfg( phper_debug) ] zend_orig_lineno : u32 ,
29
28
) -> Self {
30
29
Self {
Original file line number Diff line number Diff line change @@ -19,6 +19,11 @@ pub fn register_configures() {
19
19
"cargo:rustc-cfg=phper_release_version=\" {}\" " ,
20
20
PHP_RELEASE_VERSION
21
21
) ;
22
+ println ! (
23
+ "cargo:rustc-cfg=phper_php_version=\" {}.{}\" " ,
24
+ PHP_MAJOR_VERSION ,
25
+ PHP_MINOR_VERSION ,
26
+ ) ;
22
27
23
28
if PHP_DEBUG > 0 {
24
29
println ! ( "cargo:rustc-cfg=phper_debug" ) ;
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ use crate::{
5
5
use std:: {
6
6
cell:: Cell ,
7
7
mem:: { size_of, transmute} ,
8
- os:: raw:: c_int,
9
8
ptr:: null_mut,
10
9
} ;
11
10
@@ -35,6 +34,16 @@ impl<T: 'static> ModuleGlobals<T> {
35
34
on_modify : Option < Mh > ,
36
35
modifiable : u32 ,
37
36
) -> zend_ini_entry_def {
37
+ #[ cfg( phper_php_version = "7.3" ) ]
38
+ let modifiable = modifiable as std:: os:: raw:: c_uchar ;
39
+ #[ cfg( phper_php_version = "7.2" ) ]
40
+ let modifiable = modifiable as std:: os:: raw:: c_int ;
41
+
42
+ #[ cfg( phper_php_version = "7.3" ) ]
43
+ let name_length = name. len ( ) as u16 ;
44
+ #[ cfg( phper_php_version = "7.2" ) ]
45
+ let name_length = name. len ( ) as u32 ;
46
+
38
47
zend_ini_entry_def {
39
48
name : name. as_ptr ( ) . cast ( ) ,
40
49
on_modify,
@@ -43,8 +52,8 @@ impl<T: 'static> ModuleGlobals<T> {
43
52
mh_arg3 : null_mut ( ) ,
44
53
value : default_value. as_ptr ( ) . cast ( ) ,
45
54
displayer : None ,
46
- modifiable : modifiable as c_int ,
47
- name_length : name . len ( ) as u32 ,
55
+ modifiable,
56
+ name_length,
48
57
value_length : default_value. len ( ) as u32 ,
49
58
}
50
59
}
You can’t perform that action at this time.
0 commit comments