Skip to content

Commit d5cc584

Browse files
committed
Fix build issue with php >= 5.6.25 (#5318)
1 parent a6bc35d commit d5cc584

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Diff for: .travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: php
22
php:
33
- 5.5
4-
# - 5.6
4+
- 5.6
55

66
env:
77
global:

Diff for: mapscript/php/error.c

+11
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@
3131

3232
#include "php_mapscript.h"
3333

34+
#if PHP_VERSION_ID >= 50625
35+
#undef ZVAL_STRING
36+
#define ZVAL_STRING(z, s, duplicate) do { \
37+
const char *__s=(s); \
38+
zval *__z = (z); \
39+
Z_STRLEN_P(__z) = strlen(__s); \
40+
Z_STRVAL_P(__z) = (duplicate?estrndup(__s, Z_STRLEN_P(__z)):(char*)__s);\
41+
Z_TYPE_P(__z) = IS_STRING; \
42+
} while (0)
43+
#endif
44+
3445
zend_class_entry *mapscript_ce_error;
3546

3647
ZEND_BEGIN_ARG_INFO_EX(error___get_args, 0, 0, 1)

0 commit comments

Comments
 (0)