Error compiling with PHP 5.4 and above
Brought to you by:
koucky
There is a compatibility problem with PHP 5.4:
libtool: compile: cc -I. -I/usr/local/src/saprfc-1.4.1 -DPHP_ATOM_INC -I/usr/local/src/saprfc-1.4.1/include -I/usr/local/src/saprfc-1.4.1/main -I/usr/local/src/saprfc-1.4.1 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/local/rfcsdk/include -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/saprfc-1.4.1/saprfc.c -fPIC -DPIC -o .libs/saprfc.o /usr/local/src/saprfc-1.4.1/saprfc.c:47:1: error: unknown type name 'function_entry' /usr/local/src/saprfc-1.4.1/saprfc.c:48:5: warning: braces around scalar initializer [enabled by default] /usr/local/src/saprfc-1.4.1/saprfc.c:48:5: warning: (near initialization for 'saprfc_functions[0]') [enabled by default] /usr/local/src/saprfc-1.4.1/saprfc.c:48:5: warning: initialization makes integer from pointer without a cast [enabled by default] /usr/local/src/saprfc-1.4.1/saprfc.c:48:5: warning: (near initialization for 'saprfc_functions[0]') [enabled by default] /usr/local/src/saprfc-1.4.1/saprfc.c:48:5: error: initializer element is not computable at load time /usr/local/src/saprfc-1.4.1/saprfc.c:48:5: error: (near initialization for 'saprfc_functions[0]') /usr/local/src/saprfc-1.4.1/saprfc.c:48:5: warning: excess elements in scalar initializer [enabled by default] /usr/local/src/saprfc-1.4.1/saprfc.c:48:5: warning: (near initialization for 'saprfc_functions[0]') [enabled by default] /usr/local/src/saprfc-1.4.1/saprfc.c:48:5: warning: excess elements in scalar initializer [enabled by default] /usr/local/src/saprfc-1.4.1/saprfc.c:48:5: warning: (near initialization for 'saprfc_functions[0]') [enabled by default] /usr/local/src/saprfc-1.4.1/saprfc.c:48:5: warning: excess elements in scalar initializer [enabled by default] /usr/local/src/saprfc-1.4.1/saprfc.c:48:5: warning: (near initialization for 'saprfc_functions[0]') [enabled by default] /usr/local/src/saprfc-1.4.1/saprfc.c:48:5: warning: excess elements in scalar initializer [enabled by default] /usr/local/src/saprfc-1.4.1/saprfc.c:48:5: warning: (near initialization for 'saprfc_functions[0]') [enabled by default] /usr/local/src/saprfc-1.4.1/saprfc.c:49:5: warning: braces around scalar initializer [enabled by default] /usr/local/src/saprfc-1.4.1/saprfc.c:49:5: warning: (near initialization for 'saprfc_functions[1]') [enabled by default] /usr/local/src/saprfc-1.4.1/saprfc.c:49:5: warning: initialization makes integer from pointer without a cast [enabled by default] /usr/local/src/saprfc-1.4.1/saprfc.c:49:5: warning: (near initialization for 'saprfc_functions[1]') [enabled by default] /usr/local/src/saprfc-1.4.1/saprfc.c:49:5: error: initializer element is not computable at load time /usr/local/src/saprfc-1.4.1/saprfc.c:49:5: error: (near initialization for 'saprfc_functions[1]') [...]
This code will change function_entry to zend_function_entry when PHP 5.4 or above is used:
#if PHP_VERSION_ID > 50400 #define function_entry zend_function_entry #endif
--- ../sap/saprfc.c 2005-12-19 12:35:14.000000000 +0100 +++ saprfc.c 2015-02-20 11:35:49.773872032 +0100 @@ -37,6 +37,11 @@ #define TSRMLS_FETCH() ELS_FETCH() #endif +/* Compatibility with PHP 5.4.0 */ +#if PHP_VERSION_ID > 50400 +#define function_entry zend_function_entry +#endif + ZEND_DECLARE_MODULE_GLOBALS(saprfc) /* True global resources - no need for thread safety here */
I'll attach it to this issue.
Best regards.
Sorry, greater or equal!