com php-src: properly export tsrm_strtok_r(): TSRM/ tsrm_strtok_r.c TSRM/tsrm_strtok_r.h ext/phar/p har.c
| From: | Anatol Belski | Date: | Sun, 05 Oct 2014 11:20:27 +0000 |
| Subject: | com php-src: properly export tsrm_strtok_r(): TSRM/ tsrm_strtok_r.c TSRM/tsrm_strtok_r.h ext/phar/p har.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82104@lists.php.net to get a copy of this message | ||
Commit: d58b70622a7e99ceee074e420d9271c2d8de116c
Author: Anatol Belski <ab@php.net> Sun, 5 Oct 2014 13:20:27 +0200
Parents: 7c7b9184b1fdf7add1715079f22241bc1185fcb0
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d58b70622a7e99ceee074e420d9271c2d8de116c
Log:
properly export tsrm_strtok_r()
for this particular case fixing phar shared build, but for the
general usage anyway
Changed paths:
M TSRM/tsrm_strtok_r.c
M TSRM/tsrm_strtok_r.h
M ext/phar/phar.c
Diff:
diff --git a/TSRM/tsrm_strtok_r.c b/TSRM/tsrm_strtok_r.c
index e9ad26a..2522cf1 100644
--- a/TSRM/tsrm_strtok_r.c
+++ b/TSRM/tsrm_strtok_r.c
@@ -14,7 +14,7 @@ static inline int in_character_class(char ch, const char *delim)
return 0;
}
-char *tsrm_strtok_r(char *s, const char *delim, char **last)
+TSRM_API char *tsrm_strtok_r(char *s, const char *delim, char **last)
{
char *token;
diff --git a/TSRM/tsrm_strtok_r.h b/TSRM/tsrm_strtok_r.h
index 8c9e819..323b401 100644
--- a/TSRM/tsrm_strtok_r.h
+++ b/TSRM/tsrm_strtok_r.h
@@ -1,6 +1,8 @@
#ifndef TSRM_STRTOK_R
#define TSRM_STRTOK_R
-char *tsrm_strtok_r(char *s, const char *delim, char **last);
+#include "TSRM.h"
+
+TSRM_API char *tsrm_strtok_r(char *s, const char *delim, char **last);
#endif
diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index 8f17c77..cdc61fe 100644
--- a/ext/phar/phar.c
+++ b/ext/phar/phar.c
@@ -2072,54 +2072,6 @@ static int php_check_dots(const char *element, int n) /* {{{ */
#define IS_BACKSLASH(c) ((c) == '/')
-#ifdef COMPILE_DL_PHAR
-/* stupid-ass non-extern declaration in tsrm_strtok.h breaks dumbass MS compiler */
-static inline int in_character_class(char ch, const char *delim) /* {{{ */
-{
- while (*delim) {
- if (*delim == ch) {
- return 1;
- }
- ++delim;
- }
- return 0;
-}
-/* }}} */
-
-char *tsrm_strtok_r(char *s, const char *delim, char **last) /* {{{ */
-{
- char *token;
-
- if (s == NULL) {
- s = *last;
- }
-
- while (*s && in_character_class(*s, delim)) {
- ++s;
- }
-
- if (!*s) {
- return NULL;
- }
-
- token = s;
-
- while (*s && !in_character_class(*s, delim)) {
- ++s;
- }
-
- if (!*s) {
- *last = s;
- } else {
- *s = '\0';
- *last = s + 1;
- }
-
- return token;
-}
-/* }}} */
-#endif
-
/**
* Remove .. and . references within a phar filename
*/