Clean up includes of PHP API headers

Eliminate redundant and unused includes.

Only include the minimum headers needed before the PHP_MAJOR_VERSION
check in case future PHP versions remove some of the headers we
include.
This commit is contained in:
Olly Betts 2021-05-05 10:48:10 +12:00
commit 228b04974d
2 changed files with 3 additions and 5 deletions

View file

@ -9,16 +9,15 @@
#ifdef __cplusplus
extern "C" {
#endif
#include "zend.h"
#include "zend_API.h"
#include "zend_exceptions.h"
#include "php.h"
#if PHP_MAJOR_VERSION < 7
# error These bindings need PHP 7 or later - to generate PHP5 bindings use: SWIG < 4.0.0 and swig -php5
#endif
#include "ext/standard/php_string.h"
#include "zend_exceptions.h"
#include <stdlib.h> /* for abort(), used in generated code. */
#define SWIG_BOOL_CONSTANT(N, V) REGISTER_BOOL_CONSTANT(#N, V, CONST_CS | CONST_PERSISTENT)

View file

@ -386,7 +386,6 @@ public:
Printf(s_header, "#ifdef __cplusplus\n");
Printf(s_header, "extern \"C\" {\n");
Printf(s_header, "#endif\n");
Printf(s_header, "#include \"php.h\"\n");
Printf(s_header, "#include \"php_ini.h\"\n");
Printf(s_header, "#include \"ext/standard/info.h\"\n");
Printf(s_header, "#include \"php_%s.h\"\n", module);