bukka / php-fann

PHP wrapper for FANN (Fast Artificial Neural Network Library)
Other
213 stars 35 forks source link

Build fails with PHP 5.3.3 #6

Closed remicollet closed 11 years ago

remicollet commented 11 years ago

From http://pecl.php.net/package/fann, PHP Version: PHP 5.2.0 or newer

But: /builddir/build/BUILD/php-pecl-fann-1.0.3/NTS/fann.c:907: error: 'PHP_FE_END' undeclared here (not in a function)

PHP_FE_END was introduce in PHP 5.3.8.

Perhaps it's simpler to raise the minimal version required. I will try to see if PHP_FE_END is the only problem.

P.S. PHP 5.3.3 still the official version provided in RHEL / CentOS 6

remicollet commented 11 years ago

I confirm, only PHP_FE_END, so using (in fann.c and fann_connection.c)

#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION >= 7) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4) || (PHP_MAJOR_VERSION > 5)
    PHP_FE_END
#else
    {NULL,NULL,NULL}
#endif

Fix the build with 5.3.3 (can't test with older versions)

bukka commented 11 years ago

Hi thanks for reporting this. I haven't done a proper testing on all supported versions - didn't realize that there were so many changes between 5.2 and 5.3... :)

I just fixed all compilation issues for 5.2.18-dev which includes this. It's this commit: https://github.com/bukka/php-fann/commit/97edb7fcdd143f2c4254fc7b2e28f0a81085d3ce

I haven't checked if it works properly on 5.3+. I will do that this weekend and then release new version that should finally support all versions.

Thanks again for your work on the RPM.

bukka commented 11 years ago

Hi, all compilation errors and warnings have been fixed and released in 1.0.4. Thanks!