cvs: php4 /ext/standard php_smart_str.h
| From: | Sascha Schumann | Date: | Wed, 16 Apr 2003 09:14:32 +0000 |
| Subject: | cvs: php4 /ext/standard php_smart_str.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20306@lists.php.net to get a copy of this message | ||
sas Wed Apr 16 05:14:32 2003 EDT
Modified files:
/php4/ext/standard php_smart_str.h
Log:
Simplify use of this header in external apps
Index: php4/ext/standard/php_smart_str.h
diff -u php4/ext/standard/php_smart_str.h:1.24 php4/ext/standard/php_smart_str.h:1.25
--- php4/ext/standard/php_smart_str.h:1.24 Sun Mar 16 18:02:19 2003
+++ php4/ext/standard/php_smart_str.h Wed Apr 16 05:14:32 2003
@@ -22,7 +22,9 @@
#include "php_smart_str_public.h"
#include <stdlib.h>
+#ifndef SMART_STR_USE_REALLOC
#include <zend.h>
+#endif
#define smart_str_0(x) do { \
if ((x)->c) { \
@@ -34,12 +36,19 @@
#define SMART_STR_PREALLOC 128
#endif
+#ifdef SMART_STR_USE_REALLOC
+#define SMART_STR_REALLOC(a,b,c) realloc((a),(b))
+#else
+#define SMART_STR_REALLOC(a,b,c) perealloc((a),(b),(c))
+#endif
+
+
#define smart_str_alloc4(d, n, what, newlen) do { \
if (!(d)->c) (d)->len = (d)->a = 0; \
newlen = (d)->len + (n); \
if (newlen >= (d)->a) { \
(d)->a = newlen + SMART_STR_PREALLOC; \
- (d)->c = perealloc((d)->c, (d)->a + 1, (what)); \
+ (d)->c = SMART_STR_REALLOC((d)->c, (d)->a + 1, (what)); \
} \
} while (0)