]> git.pld-linux.org Git - packages/linux-gpib.git/blobdiff - linux-gpib-php7.patch
- added php7 patch, package php binding
[packages/linux-gpib.git] / linux-gpib-php7.patch
diff --git a/linux-gpib-php7.patch b/linux-gpib-php7.patch
new file mode 100644 (file)
index 0000000..045fbf0
--- /dev/null
@@ -0,0 +1,37 @@
+--- linux-gpib-4.0.3/language/php/gpib.c.orig  2016-04-09 15:33:09.000000000 +0200
++++ linux-gpib-4.0.3/language/php/gpib.c       2016-07-14 16:47:47.929605503 +0200
+@@ -60,6 +60,10 @@
+ #include "php.h"
+ #include "ext/standard/info.h"
++#if PHP_MAJOR_VERSION >= 7
++#define PZVAL_IS_REF(pz) Z_ISREF_P(pz)
++#endif
++
+ /* ---- macros for declarations -------------------------- */
+ #define FUN_ACCESSOR(functionName) \
+@@ -495,7 +499,11 @@
+               ) == FAILURE) {
+               return;
+       }
++#if PHP_MAJOR_VERSION >= 7
++      RETURN_STRING((char*)gpib_error_string(n));
++#else
+       RETURN_STRING((char*)gpib_error_string(n), 1);
++#endif
+ }
+ #endif
+@@ -550,7 +558,11 @@
+         memset(p,0,len+1);
+       r=ibrd(n,p,len);
+         p[ibcnt]='\0';
++#if PHP_MAJOR_VERSION >= 7
++        ZVAL_STRING(z,p);
++#else
+         ZVAL_STRING(z,p,1);
++#endif
+       free(p);
+       RETURN_LONG(r);
+ }
This page took 0.062539 seconds and 4 git commands to generate.