Skip to content

Commit 128318d

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Support for __restrict and few GCC attributes
2 parents 03618d2 + 363e8dd commit 128318d

File tree

3 files changed

+53
-45
lines changed

3 files changed

+53
-45
lines changed

ext/ffi/ffi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5907,6 +5907,12 @@ void zend_ffi_add_attribute(zend_ffi_dcl *dcl, const char *name, size_t name_len
59075907
/* ignore */
59085908
} else if (name_len == sizeof("deprecated")-1 && memcmp(name, "deprecated", sizeof("deprecated")-1) == 0) {
59095909
/* ignore */
5910+
} else if (name_len == sizeof("__nothrow__")-1 && memcmp(name, "__nothrow__", sizeof("__nothrow__")-1) == 0) {
5911+
/* ignore */
5912+
} else if (name_len == sizeof("__leaf__")-1 && memcmp(name, "__leaf__", sizeof("__leaf__")-1) == 0) {
5913+
/* ignore */
5914+
} else if (name_len == sizeof("__malloc__")-1 && memcmp(name, "__malloc__", sizeof("__malloc__")-1) == 0) {
5915+
/* ignore */
59105916
} else {
59115917
zend_ffi_parser_error("unsupported attribute '%.*s' at line %d", name_len, name, FFI_G(line));
59125918
}

ext/ffi/ffi.g

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ type_qualifier(zend_ffi_dcl *dcl):
158158
("const"|"__const"|"__const__")
159159
{dcl->flags |= ZEND_FFI_DCL_CONST;}
160160
{dcl->attr |= ZEND_FFI_ATTR_CONST;}
161-
| ("restrict"|"__restict"|"__restrict__")
161+
| ("restrict"|"__restrict"|"__restrict__")
162162
{dcl->flags |= ZEND_FFI_DCL_RESTRICT;}
163163
| ("volatile"|"__volatile"|"__volatile__")
164164
{dcl->flags |= ZEND_FFI_DCL_VOLATILE;}

0 commit comments

Comments
 (0)