TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

16 lines
482 B

#define TYPEPHP_LIB_DEMO_BUILD
#include "../include/typephp_lib_demo.h"
#include <phpx.h>
extern "C" int typephp_runtime_init(int argc, char **argv);
extern php::Int php_demo_add(php::Int a, php::Int b);
extern "C" TYPEPHP_LIB_DEMO_API int typephp_lib_demo_add(int a, int b)
{
char app_name[] = "typephp_lib_demo";
char *argv[] = {app_name, nullptr};
if (typephp_runtime_init(1, argv) != 0) {
return 0;
}
return static_cast<int>(php_demo_add(a, b));
}