PHP5's C extension API has changed substantially so you need to use -php7 to specify you want PHP7 compatible wrappers. Fixes https://github.com/swig/swig/issues/571
17 lines
216 B
C
17 lines
216 B
C
/* File : example.c */
|
|
|
|
int do_op(int a, int b, int (*op)(int,int)) {
|
|
return (*op)(a,b);
|
|
}
|
|
|
|
int add(int a, int b) {
|
|
return a+b;
|
|
}
|
|
|
|
int sub(int a, int b) {
|
|
return a-b;
|
|
}
|
|
|
|
int mul(int a, int b) {
|
|
return a*b;
|
|
}
|