@@ -9,32 +9,32 @@ if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platforms only");
9
9
--FILE--
10
10
<?php
11
11
$ header = <<<HEADER
12
- void __cdecl cdecl_func(int arg1, double arg2);
13
- void __stdcall stdcall_func(int arg1, double arg2);
14
- void __fastcall fastcall_func(int arg1, double arg2);
12
+ void __cdecl cdecl_func(int arg1, double arg2, char arg3 );
13
+ void __stdcall stdcall_func(int arg1, double arg2, char arg3 );
14
+ void __fastcall fastcall_func(int arg1, double arg2, char arg3 );
15
15
HEADER ;
16
16
$ headername = __DIR__ . '/callconv.h ' ;
17
17
$ dllname = __DIR__ . "/callconv_x86.dll " ;
18
18
19
19
$ ffi1 = FFI ::cdef ($ header , $ dllname );
20
- $ ffi1 ->cdecl_func (1 , 2.3 );
21
- $ ffi1 ->stdcall_func (4 , 5.6 );
22
- $ ffi1 ->fastcall_func (7 , 8.9 );
20
+ $ ffi1 ->cdecl_func (1 , 2.3 , ' a ' );
21
+ $ ffi1 ->stdcall_func (4 , 5.6 , ' b ' );
22
+ $ ffi1 ->fastcall_func (7 , 8.9 , ' c ' );
23
23
24
24
file_put_contents ($ headername , "#define FFI_LIB \"$ dllname \"\n$ header " );
25
25
26
26
$ ffi2 = FFI ::load ($ headername );
27
- $ ffi2 ->cdecl_func (2 , 3.4 );
28
- $ ffi2 ->stdcall_func (5 , 6.7 );
29
- $ ffi2 ->fastcall_func (8 , 9.1 );
27
+ $ ffi2 ->cdecl_func (2 , 3.4 , ' a ' );
28
+ $ ffi2 ->stdcall_func (5 , 6.7 , ' b ' );
29
+ $ ffi2 ->fastcall_func (8 , 9.1 , ' c ' );
30
30
?>
31
31
--EXPECT--
32
- cdecl: 1, 2.300000
33
- stdcall: 4, 5.600000
34
- fastcall: 7, 8.900000
35
- cdecl: 2, 3.400000
36
- stdcall: 5, 6.700000
37
- fastcall: 8, 9.100000
32
+ cdecl: 1, 2.300000, a
33
+ stdcall: 4, 5.600000, b
34
+ fastcall: 7, 8.900000, c
35
+ cdecl: 2, 3.400000, a
36
+ stdcall: 5, 6.700000, b
37
+ fastcall: 8, 9.100000, c
38
38
--CLEAN--
39
39
<?php
40
40
unlink (__DIR__ . '/callconv.h ' );
0 commit comments