Skip to content

Commit 5cc34c8

Browse files
committed
uri: Make php_uri_parser structs PHPAPI
This allows extensions that already know which parser to use and don't need the generic lookup facility to directly refer to the desired parser without needing to go through `php_uri_get_parser()` (which also requires allocating a `zend_string*`). Following php#20173 Related to php#19868
1 parent 28d8b8f commit 5cc34c8

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

ext/uri/uri_parser_php_parse_url.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static void uri_parser_php_parse_url_destroy(void *uri)
165165
php_url_free(parse_url_uri);
166166
}
167167

168-
const php_uri_parser php_uri_parser_php_parse_url = {
168+
PHPAPI const php_uri_parser php_uri_parser_php_parse_url = {
169169
.name = PHP_URI_PARSER_PHP_PARSE_URL,
170170
.parse = uri_parser_php_parse_url_parse,
171171
.clone = NULL,

ext/uri/uri_parser_php_parse_url.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020

2121
#include "php_uri_common.h"
2222

23-
extern const php_uri_parser php_uri_parser_php_parse_url;
23+
PHPAPI extern const php_uri_parser php_uri_parser_php_parse_url;
2424

2525
#endif

ext/uri/uri_parser_rfc3986.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ static void php_uri_parser_rfc3986_destroy(void *uri)
615615
efree(uriparser_uris);
616616
}
617617

618-
const php_uri_parser php_uri_parser_rfc3986 = {
618+
PHPAPI const php_uri_parser php_uri_parser_rfc3986 = {
619619
.name = PHP_URI_PARSER_RFC3986,
620620
.parse = php_uri_parser_rfc3986_parse,
621621
.clone = php_uri_parser_rfc3986_clone,

ext/uri/uri_parser_rfc3986.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "php_uri_common.h"
2121

22-
extern const php_uri_parser php_uri_parser_rfc3986;
22+
PHPAPI extern const php_uri_parser php_uri_parser_rfc3986;
2323

2424
typedef struct php_uri_parser_rfc3986_uris php_uri_parser_rfc3986_uris;
2525

ext/uri/uri_parser_whatwg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ static void php_uri_parser_whatwg_destroy(void *uri)
621621
lxb_url_destroy(lexbor_uri);
622622
}
623623

624-
const php_uri_parser php_uri_parser_whatwg = {
624+
PHPAPI const php_uri_parser php_uri_parser_whatwg = {
625625
.name = PHP_URI_PARSER_WHATWG,
626626
.parse = php_uri_parser_whatwg_parse,
627627
.clone = php_uri_parser_whatwg_clone,

ext/uri/uri_parser_whatwg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "php_uri_common.h"
2121
#include "lexbor/url/url.h"
2222

23-
extern const php_uri_parser php_uri_parser_whatwg;
23+
PHPAPI extern const php_uri_parser php_uri_parser_whatwg;
2424

2525
lxb_url_t *php_uri_parser_whatwg_parse_ex(const char *uri_str, size_t uri_str_len, const lxb_url_t *lexbor_base_url, zval *errors, bool silent);
2626

0 commit comments

Comments
 (0)