update swig on windows
This commit is contained in:
20
winx64/bin/swigwin-4.0.0/Examples/php/sync/Makefile
Normal file
20
winx64/bin/swigwin-4.0.0/Examples/php/sync/Makefile
Normal file
@@ -0,0 +1,20 @@
|
||||
TOP = ../..
|
||||
SWIGEXE = $(TOP)/../swig
|
||||
SWIG_LIB_DIR = $(TOP)/../$(TOP_BUILDDIR_TO_TOP_SRCDIR)Lib
|
||||
CXXSRCS = example.cxx
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_run
|
||||
|
||||
build:
|
||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' \
|
||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||
php_cpp
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_clean
|
||||
13
winx64/bin/swigwin-4.0.0/Examples/php/sync/example.cxx
Normal file
13
winx64/bin/swigwin-4.0.0/Examples/php/sync/example.cxx
Normal file
@@ -0,0 +1,13 @@
|
||||
#include "example.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int x = 42;
|
||||
char *s = (char *)"Test";
|
||||
|
||||
void Sync::printer(void) {
|
||||
|
||||
printf("The value of global s is %s\n", s);
|
||||
printf("The value of global x is %d\n", x);
|
||||
printf("The value of class s is %s\n", s);
|
||||
printf("The value of class x is %d\n", x);
|
||||
}
|
||||
9
winx64/bin/swigwin-4.0.0/Examples/php/sync/example.h
Normal file
9
winx64/bin/swigwin-4.0.0/Examples/php/sync/example.h
Normal file
@@ -0,0 +1,9 @@
|
||||
extern char *s;
|
||||
extern int x;
|
||||
|
||||
class Sync {
|
||||
public:
|
||||
int x;
|
||||
char *s;
|
||||
void printer(void);
|
||||
};
|
||||
7
winx64/bin/swigwin-4.0.0/Examples/php/sync/example.i
Normal file
7
winx64/bin/swigwin-4.0.0/Examples/php/sync/example.i
Normal file
@@ -0,0 +1,7 @@
|
||||
%module example
|
||||
|
||||
%{
|
||||
#include "example.h"
|
||||
%}
|
||||
|
||||
%include "example.h"
|
||||
15
winx64/bin/swigwin-4.0.0/Examples/php/sync/runme.php
Normal file
15
winx64/bin/swigwin-4.0.0/Examples/php/sync/runme.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?
|
||||
|
||||
// Load module and PHP classes.
|
||||
include("example.php");
|
||||
|
||||
echo "Got new object\n";
|
||||
echo "Got string $s and value $x \n";
|
||||
|
||||
$s = new Sync();
|
||||
echo "Got new object\n";
|
||||
|
||||
$s->printer();
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user