Add explicit check for expected PHP version

Should give a clearer error if PHP7 bindings are compiled against
PHP5 or vice versa.
This commit is contained in:
Olly Betts 2016-12-01 12:12:06 +13:00
commit 774311f11e
2 changed files with 10 additions and 0 deletions

View file

@ -11,6 +11,11 @@ extern "C" {
#include "zend_API.h"
#include "zend_exceptions.h"
#include "php.h"
#if PHP_MAJOR_VERSION != 7
# error These bindings need PHP7 - to generate PHP5 bindings use: swig -php5
#endif
#include "ext/standard/php_string.h"
#include <stdlib.h> /* for abort(), used in generated code. */