1+ #include "frankenphp.h"
12#include <SAPI.h>
23#include <Zend/zend_alloc.h>
34#include <Zend/zend_exceptions.h>
45#include <Zend/zend_interfaces.h>
5- #include <Zend/zend_types.h>
66#include <errno.h>
77#include <ext/spl/spl_exceptions.h>
88#include <ext/standard/head.h>
99#include <inttypes.h>
1010#include <php.h>
11+ #ifdef PHP_WIN32
12+ #include <config.w32.h>
13+ #else
1114#include <php_config.h>
15+ #endif
1216#include <php_ini.h>
1317#include <php_main.h>
1418#include <php_output.h>
1923#include <stdint.h>
2024#include <stdio.h>
2125#include <stdlib.h>
26+ #ifndef ZEND_WIN32
2227#include <unistd.h>
28+ #endif
2329#if defined(__linux__ )
2430#include <sys/prctl.h>
2531#elif defined(__FreeBSD__ ) || defined(__OpenBSD__ )
@@ -205,7 +211,7 @@ bool frankenphp_shutdown_dummy_request(void) {
205211 return true;
206212}
207213
208- PHPAPI void get_full_env (zval * track_vars_array ) {
214+ void get_full_env (zval * track_vars_array ) {
209215 go_getfullenv (thread_index , track_vars_array );
210216}
211217
@@ -959,6 +965,7 @@ static void *php_thread(void *arg) {
959965}
960966
961967static void * php_main (void * arg ) {
968+ #ifndef ZEND_WIN32
962969 /*
963970 * SIGPIPE must be masked in non-Go threads:
964971 * https://pkg.go.dev/os/signal#hdr-Go_programs_that_use_cgo_or_SWIG
@@ -971,6 +978,7 @@ static void *php_main(void *arg) {
971978 perror ("failed to block SIGPIPE" );
972979 exit (EXIT_FAILURE );
973980 }
981+ #endif
974982
975983 set_thread_name ("php-main" );
976984
@@ -1188,6 +1196,7 @@ static void sapi_cli_register_variables(zval *track_vars_array) /* {{{ */
11881196}
11891197/* }}} */
11901198
1199+ #ifndef ZEND_WIN32
11911200static void * execute_script_cli (void * arg ) {
11921201 void * exit_status ;
11931202 bool eval = (bool )arg ;
@@ -1249,6 +1258,7 @@ int frankenphp_execute_script_cli(char *script, int argc, char **argv,
12491258
12501259 return (intptr_t )exit_status ;
12511260}
1261+ #endif
12521262
12531263int frankenphp_reset_opcache (void ) {
12541264 zend_function * opcache_reset =
@@ -1266,7 +1276,7 @@ static zend_module_entry *modules = NULL;
12661276static int modules_len = 0 ;
12671277static int (* original_php_register_internal_extensions_func )(void ) = NULL ;
12681278
1269- PHPAPI int register_internal_extensions (void ) {
1279+ int register_internal_extensions (void ) {
12701280 if (original_php_register_internal_extensions_func != NULL &&
12711281 original_php_register_internal_extensions_func () != SUCCESS ) {
12721282 return FAILURE ;
0 commit comments